完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
扫一扫,分享给好友
Study-2812增强版的改动说明 雁塔菜农HotPower@126.com 2008.5.8 于雁塔菜地 1.CPLD的改动 对光盘内的Code-F2812Ex21_HDL2DEV2812.V进行了大改动 a.加入8个键盘测试 b.改进LCD的访问不好的习惯 c.改进74hc595的锁存信号为一次完成脉冲的发送且带密码访问 d.增加CPLD的版本号或密码的访问及动态改写 e.整理了已完成例程的Verilog语言规范,但实在不愿改写管脚不良的定义 2.改写或增加CMD文件 对F2812_EzDSP_RAM_lnk.cmd内的 PRAMH0 : origin = 0x3F8002, length = 0x000FFE 改写为: PRAMH0 : origin = 0x3F8002, length = 0x001FFE 3.增加F2812_UserVariableDefs.cmd文件 4.增加F2812_UserVariableDefs.cpp文件 5.完整可用于实战的例程 由于开始建立工程时第1个例程是LCD,所以就起名LCD_DEMO 目前抽空完成的例程主要有: LCD,SPI,tiMER,INT,KEY,LED,SCI,ADC等 6.非典再现 改写DSP281x_Adc.h,得到2种访问方式,不破坏原TI之习惯 struct ADC_REGS { union ADCTRL1_REG ADCTRL1; // ADC Control 1 union ADCTRL2_REG ADCTRL2; // ADC Control 2 union ADCMAXCONV_REG ADCMAXCONV; // Max conversions union ADCCHSELSEQ1_REG ADCCHSELSEQ1; // Channel select sequencing control 1 union ADCCHSELSEQ2_REG ADCCHSELSEQ2; // Channel select sequencing control 2 union ADCCHSELSEQ3_REG ADCCHSELSEQ3; // Channel select sequencing control 3 union ADCCHSELSEQ4_REG ADCCHSELSEQ4; // Channel select sequencing control 4 union ADCASEQSR_REG ADCASEQSR; // Autosequence status register Uint16 ADCRESULT[16]; /* Uint16 ADCRESULT0; // Conversion Result Buffer 0 Uint16 ADCRESULT1; // Conversion Result Buffer 1 Uint16 ADCRESULT2; // Conversion Result Buffer 2 Uint16 ADCRESULT3; // Conversion Result Buffer 3 Uint16 ADCRESULT4; // Conversion Result Buffer 4 Uint16 ADCRESULT5; // Conversion Result Buffer 5 Uint16 ADCRESULT6; // Conversion Result Buffer 6 Uint16 ADCRESULT7; // Conversion Result Buffer 7 Uint16 ADCRESULT8; // Conversion Result Buffer 8 Uint16 ADCRESULT9; // Conversion Result Buffer 9 Uint16 ADCRESULT10; // Conversion Result Buffer 10 Uint16 ADCRESULT11; // Conversion Result Buffer 11 Uint16 ADCRESULT12; // Conversion Result Buffer 12 Uint16 ADCRESULT13; // Conversion Result Buffer 13 Uint16 ADCRESULT14; // Conversion Result Buffer 14 Uint16 ADCRESULT15; // Conversion Result Buffer 15 */ union ADCTRL3_REG ADCTRL3; // ADC Control 3 union ADCST_REG ADCST; // ADC Status Register }; #define ADCRESULT0 ADCRESULT[0] #define ADCRESULT1 ADCRESULT[1] #define ADCRESULT2 ADCRESULT[2] #define ADCRESULT3 ADCRESULT[3] #define ADCRESULT4 ADCRESULT[4] #define ADCRESULT5 ADCRESULT[5] #define ADCRESULT6 ADCRESULT[6] #define ADCRESULT7 ADCRESULT[7] #define ADCRESULT8 ADCRESULT[8] #define ADCRESULT9 ADCRESULT[9] #define ADCRESULT10 ADCRESULT[10] #define ADCRESULT11 ADCRESULT[11] #define ADCRESULT12 ADCRESULT[12] #define ADCRESULT13 ADCRESULT[13] #define ADCRESULT14 ADCRESULT[14] #define ADCRESULT15 ADCRESULT[15] 应用例如: for (int i = 0; i < sizeof(Result); i ++) { Result = 0; } for (int i = 0; i < 16; i ++) { AdcRegs.ADCRESULT = 0; } AdcRegs.ADCRESULT[0] = 0; AdcRegs.ADCRESULT0 = 0; AdcRegs.ADCRESULT[1] = 0; AdcRegs.ADCRESULT1 = 0; 此思路可在其他类型一致连续的结构中都可利用~~~ 例如: 在DSP281x_ECan.h中 struct ECAN_MBOXES { struct MBOX MBOX0; //.......................... struct MBOX MBOX31; }; 改为: struct ECAN_MBOXES { struct MBOX MBOXS[32]; }; #define MBOX0 MBOXS[0] //....................... #define MBOX31 MBOXS[31] 在DSP281x_SysCtrl.h中 /* Password locations */ struct CSM_PWL { Uint16 PSWD0; // PSWD bits 15-0 Uint16 PSWD1; // PSWD bits 31-16 Uint16 PSWD2; // PSWD bits 47-32 Uint16 PSWD3; // PSWD bits 63-48 Uint16 PSWD4; // PSWD bits 79-64 Uint16 PSWD5; // PSWD bits 95-80 Uint16 PSWD6; // PSWD bits 111-96 Uint16 PSWD7; // PSWD bits 127-112 }; 可改为: /* Password locations */ struct CSM_PWL { Uint16 PSWD[8]; // PSWD bits 15-0 }; #define PSWD0 PSWD[0] //................... #define PSWD7 PSWD[7] /* CSM Register File */ struct CSM_REGS { Uint16 KEY0; // KEY reg bits 15-0 Uint16 KEY1; // KEY reg bits 31-16 Uint16 KEY2; // KEY reg bits 47-32 Uint16 KEY3; // KEY reg bits 63-48 Uint16 KEY4; // KEY reg bits 79-64 Uint16 KEY5; // KEY reg bits 95-80 Uint16 KEY6; // KEY reg bits 111-96 Uint16 KEY7; // KEY reg bits 127-112 Uint16 rsvd1; // reserved Uint16 rsvd2; // reserved Uint16 rsvd3; // reserved Uint16 rsvd4; // reserved Uint16 rsvd5; // reserved Uint16 rsvd6; // reserved Uint16 rsvd7; // reserved union CSMSCR_REG CSMSCR; // CSM Status & Control register }; 改为: struct CSM_REGS { Uint16 KEY[8]; //................................. }; #define KEY0 KEY[0] //........................... #define KEY7 KEY[7] |
|
相关推荐
2个回答
|
|
|
|
|
|
|
|
你正在撰写答案
如果你是对答案或其他答案精选点评或询问,请使用“评论”功能。
基于 DSP5509 进行数字图像处理中 Sobel 算子边缘检测的硬件连接电路图
2390 浏览 0 评论
689 浏览 0 评论
普中科技F28335开发板中,如何使用aic23播放由代码生成的正弦波
2827 浏览 0 评论
3592 浏览 1 评论
1200 浏览 1 评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-11-24 00:16 , Processed in 0.659964 second(s), Total 97, Slave 80 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号