单片机C8051F020开发实战:LCD显示时间日期项目

版权申诉
0 下载量 144 浏览量 更新于2024-11-23 收藏 2KB RAR 举报
资源摘要信息:"该资源是一组与单片机开发相关的文件,特别关注于使用C8051F020微控制器来控制LCD显示屏,并通过Visual C++环境进行编程和实现。资源中包含了实现时间日期显示以及其他功能的源代码和相关说明文件。" 知识点详细说明: 1. 单片机开发基础 单片机(Microcontroller Unit,简称MCU)是一种集成电路芯片,它将微处理器(CPU)、随机存取存储器(RAM)、只读存储器(ROM)、输入/输出端口和定时器等功能集成在一个芯片上,形成一个完整的微型计算机系统。单片机广泛应用于嵌入式系统中,用于控制各种电子设备和机电系统。在开发过程中,工程师需要具备嵌入式编程、电路设计、系统分析等多方面技能。 2. C8051F020微控制器 C8051F020是Silicon Labs公司生产的高性能8位微控制器,属于C8051系列。它具有与MCS-51指令集兼容的微处理器内核,提供了丰富的外设接口和功能,包括但不限于定时器、串行口、模拟-数字转换器、数字-模拟转换器等。C8051F020因其高集成度和高性能,在工业控制、通信设备、智能仪表等领域得到了广泛应用。 3. 控制1602显示屏 1602显示屏是一种常用的字符型LCD,拥有16个字符宽度和2行显示能力。在单片机开发中,使用1602显示屏显示信息是基础且常见的应用之一。开发者需要编写代码来初始化显示屏,然后通过发送指令和数据来控制显示屏显示特定的字符或字符串。控制方式通常分为两种:并行控制和串行控制。 4. 时间日期显示的实现 要在LCD上显示时间日期,开发者首先需要通过C8051F020的定时器功能来计时,根据定时器中断来更新时间信息。然后通过编写相应的函数来格式化时间日期数据,并将这些数据显示到LCD上。时间日期的更新可以通过软件算法实现,也可以结合外部时钟芯片(如DS1302)来实现。 5. 文件列表中的相关文件解释 - LCD input number.c:该文件包含了实现LCD输入数字显示功能的C语言源代码。开发者在编写此代码时,可能使用了按键输入功能来向LCD发送数字,并在LCD上显示出来。 - keyboard control Led.txt:该文件可能是对如何使用键盘控制LED灯亮灭的说明文档。说明文档中可能包含代码实现的要点和注意事项。 - set up timer.txt:此文档可能提供了设置定时器的详细指导,定时器的设置对于时间日期的准确显示至关重要。 - flash the LCD(frequency 1Hz).txt:该文档可能说明了如何通过编程让LCD以1Hz的频率闪烁。这涉及到对LCD显示模式的控制。 - LCD show time.txt:此文件可能是关于如何在LCD上显示时间信息的说明文档,文件中可能包含时间数据的获取、处理和显示方法。 6. Visual C++环境的应用 Visual C++是微软公司推出的一款集成开发环境(IDE),广泛用于C和C++语言的开发。在单片机开发中,使用Visual C++可以方便地编写代码、进行调试和编译。在文件名中提到Visual C++,说明开发者在编写和管理代码过程中可能使用了Visual C++提供的工具,以便更加高效地完成开发任务。需要注意的是,虽然Visual C++在PC端开发中非常流行,但在嵌入式开发中,为了更好地利用资源和性能,通常会使用专门的嵌入式开发环境,如Keil MDK、IAR Embedded Workbench等。 7. 开发工具和环境配置 在进行单片机开发时,除了掌握编程语言和相关硬件知识外,还需要配置好开发工具链。这通常包括编译器、汇编器、链接器和调试器等。开发者需要根据所使用的微控制器型号选择合适的开发板和编程器/调试器,并确保软件开发环境能够与硬件正确连接和交互。 8. 系统集成与测试 开发单片机应用系统时,将各个模块(如按键输入、LED控制、LCD显示和定时器管理)集成在一起,并进行充分的测试是非常重要的。测试应该覆盖功能验证、性能测试和稳定性验证等多个方面,确保系统在实际应用中的可靠性。 通过上述分析,我们可以看出,这份资源提供了关于使用C8051F020单片机和Visual C++工具链来控制LCD显示设备并实现时间日期显示的知识点。开发者通过这些文件可以学习到如何将硬件与软件结合来创建实用的嵌入式系统。

优化这个sql SELECT count( 1 ) FROM ( SELECT B.ID, B.PURCHASE_REQUEST_ID, B.MATERIAL_ID, B.MATERIAL_CODE, B.MATERIAL_NAME, B.STANDARD, B.MODEL_ID, B.BILL_ROW_ID, B.BILL_NO, BILL_NAME, B.MODEL_CODE, B.MODEL_NAME, B.PARENT_MODEL_ID, B.PARENT_MODEL_CODE, B.PARENT_MODEL_NAME, B.UNIT_CODE, B.UNIT_NAME, B.PURCHASE_TYPE_CODE, CAST( NVL( B.APPLY_NUM, 0 ) AS NUMBER ( 24, 10 ) ) AS APPLY_NUM, CAST( NVL( B.DEAL_NUM, 0 ) AS NUMBER ( 24, 10 ) ) AS DEAL_NUM, CAST( NVL( B.RETURN_NUM, 0 ) AS NUMBER ( 24, 10 ) ) AS RETURN_NUM, B.DEAL_USER_ID, B.DEAL_USER_NAME, CAST( NVL( B.PRICE, 0 ) AS NUMBER ( 24, 10 ) ) AS PRICE, CAST( NVL( B.AMOUNT, 0 ) AS NUMBER ( 24, 10 ) ) AMOUNT, B.IMPLEMENT_CODE, B.IMPLEMENT_NAME, B.IMPLEMENT_INVEST_AMOUNT, B.PURCHASE_MANAGER_ID, B.PURCHASE_MANAGER_NAME, B.PROVIDER_ID, B.PROVIDER_NAME, B.REMARK, B.DELIVER_AREA, B.DELIVER_ADDRESS, B.RECEIVE_PEOPLE, B.RECEIVE_PEOPLE_PHONE, B.ITEM_STATUS, B.COST_CENTER, B.COST_BUDGET_CODE, B.COST_IMPLEMENT_NAME, B.FRAME_CONT_ID, B.FRAME_CONT_CODE, B.FRAME_CONT_NAME, B.DETAIL_CONFIG, B.PURCHASE_CATEGORY_CODE, B.INVOICE_TITLE_CODE, B.INVOICE_SEND_ADDRRSS, B.MATERIAL_REQUEST_ITEM_ID, B.YEAR, B.DELETE_FLAG, B.PROVINCE_CODE, B.REASON, B.PARENT_ITEM_ID, B.FRAME_CONT_ITEM_ID, B.SUB_MATERIAL_REQUEST_ID, B.SUB_MATERIAL_REQUEST_CODE, B.MATERIAL_URL, B.RECOMMEND_PROVIDER_NAMES, C.PURCHASE_REQUEST_CODE, C.PURCHASE_REQUEST_NAME, C.APPLY_TYPE_CODE, C.CREATOR_NAME, C.APPLY_TELEPHONE, C.COMPANY_NAME, C.DEPT_NAME, B.CREATE_TIME, TO_CHAR( B.CREATE_TIME, 'YYYY-MM-DD' ) CREATE_TIME_STR, C.ARRIVE_TIME, C.IS_TO_END, C.MONEY_WAY_CODE, C.OWN, C.APPLY_CATEGORY_CODE, C.manu_Type, C.BILL_ID, MMD.MATERIAL_TYPE_CODE, B.BRANCH_COMPANY_DEAL_USER_ID, B.BRANCH_COMPANY_DEAL_USER_NAME, ( SELECT ORG_NAME FROM ORGANIZATIONS WHERE DELETE_FLAG = '0' AND ORG_CODE = ( SELECT PARENT_COMPANY_NO FROM ORGANIZATIONS WHERE ID = B.MATERIAL_DEPT_ID )) AS MATERIAL_COMPANY_NAME, B.ORIGINAL, B.PROVIDER_PRODUCT_MODEL, B.PROVIDER_PRODUCT_NAME, B.PRODUCT_DESC, B.Back_Flag, CASE WHEN MMD.material_type_code = 'WZ' THEN '1' WHEN MMD.material_type_code = 'FW' THEN '2' ELSE '3' END apply_category_code_item, NVL( C.IS_CARDSYSTEM_REQUEST, '0' ) IS_CARDSYSTEM_REQUEST, B.APPLY_GROUP_AUTHORITES, B.SCIENTIFIC_RESEARCH_ID, B.SCIENTIFIC_RESEARCH_CODE, B.SCIENTIFIC_RESEARCH_NAME, B.PREQUALFY_CODE, nvl( C.IS_QUICK, '0' ) AS IS_QUICK, C.PURCHASE_WAY_CODE, C.PURCHASE_TYPE_CODE PURCHASE_TYPE_CODE_P, C.ORIGINAL_TYPE, C.PURCHASE_REQUEST_BILLS_TYPE, B.IS_FRAME_CONT_MONAD FROM PURCHASE_REQUEST_ITEM B LEFT JOIN PURCHASE_REQUEST C ON B.PURCHASE_REQUEST_ID = C.ID LEFT JOIN MATERIAL_DATA MMD ON MMD.ID = B.MATERIAL_ID AND MMD.DELETE_FLAG = '0' WHERE B.delete_flag = '0' AND B.Item_Status IN ( 1 ) AND NOT EXISTS ( SELECT * FROM purchase_request_item_log pril WHERE B.id = pril.purchase_request_item_id AND pril.lock_status = '1' AND pril.delete_flag = '0' ) AND ( ( c.apply_type_code NOT IN ( '20', '41', '3' ) AND nvl( B.Apply_Num, 0 ) > nvl( B.Deal_Num, 0 )) OR c.apply_type_code IN ( '20', '41', '3' ) ) AND B.Deal_User_Id =: 1 AND C.MONEY_WAY_CODE =: 2 AND C.APPLY_TYPE_CODE =: 3 AND C.PAY_OUT_TYPE_CODE =: 4 AND C.APPLY_CATEGORY_CODE =: 5 AND NVL( C.IS_CARDSYSTEM_REQUEST, '0' ) = : 6 AND NOT EXISTS ( SELECT * FROM purchase_request_item p left join material_province mp ON p.material_id = mp.material_id WHERE p.delete_flag = 0 AND mp.delete_flag = 0 AND mp.material_status = 03 AND mp.org_code = p.province_code AND p.id = B.id ) ORDER BY C.ID, B.ID ASC)

2023-06-08 上传

优化sql:SELECT we.organization_id ,we.wip_entity_id ,case when wl.line_id is null then we.wip_entity_name else '' end wip_entity_name ,we.primary_item_id ,mtt.transaction_type_name ,mmt.transaction_date ,bd.department_code ,mmt.inventory_item_id ,mmt.subinventory_code ,mta.reference_account ,br.resource_code ,lu2.meaning as line_type_name ,mta.base_transaction_value ,mta.cost_element_id ,flv.meaning as cost_element ,wdj.class_code job_type_code ,ml.meaning job_type_name FROM (select * from gerp.mtl_material_transactions where substr(transaction_date,1,7) >= '2023-06' and transaction_source_type_id = 5) mmt inner join gerp.wip_entities we on mmt.organization_id = we.organization_id inner join gerp.mtl_transaction_accounts mta on mta.transaction_source_id = we.wip_entity_id and mta.transaction_id = mmt.transaction_id and mta.transaction_source_type_id = 5 inner join gerp.mtl_transaction_types mtt on mtt.transaction_type_id = mmt.transaction_type_id inner join mfg_lookups lu2 on lu2.lookup_code = mta.accounting_line_type and lu2.lookup_type = 'CST_ACCOUNTING_LINE_TYPE' inner join gerp.mtl_system_items_b msi on msi.inventory_item_id = mmt.inventory_item_id and msi.organization_id = mta.organization_id left join gerp.bom_departments bd on bd.department_id = mmt.department_id left join gerp.bom_resources br on br.resource_id = mta.resource_id left join gerp.wip_lines wl on wl.line_id = mmt.repetitive_line_id left join gerp.wip_discrete_jobs wdj on wdj.wip_entity_id = mta.transaction_source_id left join gerp.fnd_lookup_values_vl flv on cast(mta.cost_element_id as string) = flv.lookup_code and flv.lookup_type = 'CST_COST_CODE_TYPE' left join mfg_lookups ml on ml.lookup_code = wdj.job_type and ml.lookup_type = 'WIP_DISCRETE_JOB' 。其中mmt,we,mta,msi,wdj数据量很大

2023-06-10 上传

优化这条sql 解决bug select a.*,rownum num from ( SELECT t.PROJ_ID,t.PROJ_CODE,t.PROJ_NAME,t.CLIENT_CODE,t.CLIENT_NAME,t.SPEC_CODE,t.SPEC_NAME,t.BUS_UNIT_CODE,t.BUS_UNIT,t.PROJ_DEP_CODE,t.PROJ_DEP,t.PROJECT_MANAGER_CODE,t.PROJECT_MANAGER,t.PROJECT_DEP_MANAGER_CODE,t.PROJECT_DEP_MANAGER,t.IS_SUB_PROJ,t.SUB_PROJ_TYPE_CODE,t.SUB_PROJ_TYPE,t.PARENT_CODE,t.PROJ_GROSS,t.CLIENT_AREA_CODE,t.CLIENT_AREA,t.CLIENT_TYPE_FULL_PATH_CODE,t.CLIENT_TYPE_PULL_PATH,t.BUSINESS_TYPE_CODE,t.BUSINESS_TYPE,t.BUSINESS_LEVEL_CODE,t.BUSINESS_LEVEL,t.BUSINESS_AREA_CODE,t.BUSINESS_AREA_NAME,t.IS_CLOSE,t.IS_IN_COO,t.TAX_RATE,t.IS_AUTHORIZED,t.AUTHORIZED_AMOUNT,t.IS_VIRTUAL,t.INCOME_BUDGET,t.EXPENDITURE_BUDGET,t.P_VALUE,t.CREATE_TIME,t.P_BUD_VALUE,t.P1_BUD_VALUE,t.P2_BUD_VALUE,t.ORG_CODE,t.ORG_NAME,t.PROD_RES_TYPE,t.IS_TECH_COO,t.COO_UNIT_RATIO,t.PROJ_ACHIEVEMENTS_BUD,t.REIMBURSEMENT_COST_BUD,t.COO_COST_BUD,t.MATERIAL_COST_BUD,t.PERFORMANCE_PERCENT,t.SCHE_START_TIME,t.SCHE_END_TIME,t.PROJECT_ACCOUNT_CODE,t.CUSTOMER_TYPE_CODE,t.CUSTOMER_TYPE,t.IS_PURE_OUT_PROJ,t.PROJECT_CREATE_TIME,t.IS_RELATE,t.IS_QUOTA,t.MAIN_PROJECT_CODE,t.PROJ_STATUS,t.IS_LARGE_PROJECT,t.MARKET_DIS_COUNT_RATE,t.PROJECT_CAT,t.MGR_PER_FORMANCE_RATIO,t.P1_VALUE,t.S_VALUE,t.COOP_VALUE,t.H_VALUE,t.DEVICE_BUDGET_COST,t.SUR_FEE_DIS_COUNT_RATE,t.DES_FEE_DIS_COUNT_RATE, (select listagg(p.coo_unit_code, ',') within group(order by p.coo_unit_code) from ( select distinct coo_unit_code from t_spdi_proj where is_sub_proj = 'Y' and sub_proj_type_code = 'wbhz' and PROJ_STATUS != 'P_5' AND PROJ_STATUS != 'P_4' and parent_code = t.proj_code )p ) coo_unit_code, (select listagg(to_char(p.coo_unit), ',') within group(order by p.coo_unit) from ( select distinct coo_unit from t_spdi_proj where is_sub_proj = 'Y' and sub_proj_type_code = 'wbhz' and PROJ_STATUS != 'P_5' AND PROJ_STATUS != 'P_4' and parent_code = t.proj_code )p ) coo_unit from T_SPDI_PROJ t where t.PROJ_STATUS NOT IN ('E','H','W') order by t.proj_id )a

2023-06-01 上传