TIwilliam hill官网
直播中

刘婷婷

7年用户 204经验值
私信 关注

请问如何解决TI官方例程中28035关于ADC的寄存器设置对应不上芯片资料上的问题?

本帖最后由 一只耳朵怪 于 2018-6-6 14:30 编辑

各位大侠们,你们有发现ti28035官方例程中,设置ADC采集A、B相电流寄存器设置和28035datasheet对应不上,f280xileg_vdc.c文件中的初始化的寄存器和资料中不对应,是不是我找错了,还请指正!!!

回帖(8)

陈飞

2018-6-6 10:21:34
哪儿对不上了?贴出来看看
                                                                         Young Hu
举报

刘婷婷

2018-6-6 10:36:42
void F280X_ileg2_dcbus_drv_init(ILEG2DCBUSMEAS *p) [ DELAY_US(ADC_usDELAY); AdcRegs.ADCTRL1.all = ADC_RESET_FLAG; // Reset the ADC Module asm(" NOP "); asm(" NOP "); AdcRegs.ADCTRL3.bit.ADCBGRFDN = 0x3; // Power up bandgap/reference circuitry DELAY_US(ADC_usDELAY); // Delay before powering up rest of ADC AdcRegs.ADCTRL3.bit.ADCPWDN = 1; // Power up rest of ADC DELAY_US(ADC_usDELAY); AdcRegs.ADCTRL3.bit.ADCCLKPS = 16; // Set up ADCTRL3 register AdcRegs.ADCTRL1.all = ADCTRL1_INIT_STATE; // Set up ADCTRL1 register AdcRegs.ADCTRL2.all = ADCTRL2_INIT_STATE; // Set up ADCTRL2 register AdcRegs.ADCMAXCONV.bit.MAX_CONV1 = 2; // Specify three conversions AdcRegs.ADCCHSELSEQ1.all = p->ChSelect; // Configure channel selection AdcRegs.ADCREFSEL.all = 39; // Set up the ADC reference select register AdcRegs.ADCOFFTRIM.all = 65534; // Set up the ADC offset trim register // Set up Event Trigger with CNT_zero enable for Time-base of EPWM1 EPwm1Regs.ETSEL.bit.SOCAEN = 1; // Enable SOCA EPwm1Regs.ETSEL.bit.SOCASEL = 1; // Enable CNT_zero event for SOCA EPwm1Regs.ETPS.bit.SOCAPRD = 1; // Generate SOCA on the 1st event EPwm1Regs.ETCLR.bit.SOCA = 1; // Clear SOCA flag ]
里面的寄存器大多都和28035中ADCGEG寄存器对不上,请您帮忙看看,28035ADC模块关于采集AB相电流的程序在哪可以找到??
举报

刘婷婷

2018-6-6 10:42:59
void F280X_ileg2_dcbus_drv_init(ILEG2DCBUSMEAS *p)
[
   DELAY_US(ADC_usDELAY);
   AdcRegs.ADCTRL1.all = ADC_RESET_FLAG; // Reset the ADC Module
asm(" NOP ");
asm(" NOP ");    
   AdcRegs.ADCTRL3.bit.ADCBGRFDN = 0x3; // Power up bandgap/reference circuitry
DELAY_US(ADC_usDELAY);     // Delay before powering up rest of ADC
   AdcRegs.ADCTRL3.bit.ADCPWDN = 1;   // Power up rest of ADC
DELAY_US(ADC_usDELAY);
   AdcRegs.ADCTRL3.bit.ADCCLKPS = 16;     // Set up ADCTRL3 register
   AdcRegs.ADCTRL1.all = ADCTRL1_INIT_STATE; // Set up ADCTRL1 register
   AdcRegs.ADCTRL2.all = ADCTRL2_INIT_STATE; // Set up ADCTRL2 register
AdcRegs.ADCMAXCONV.bit.MAX_CONV1 = 2;       // Specify three conversions
   AdcRegs.ADCCHSELSEQ1.all = p->ChSelect;     // Configure channel selection
   AdcRegs.ADCREFSEL.all = 39;                 // Set up the ADC reference select register
   AdcRegs.ADCOFFTRIM.all = 65534;             // Set up the ADC offset trim register
   // Set up Event Trigger with CNT_zero enable for Time-base of EPWM1
   EPwm1Regs.ETSEL.bit.SOCAEN = 1;     // Enable SOCA
   EPwm1Regs.ETSEL.bit.SOCASEL = 1;    // Enable CNT_zero event for SOCA
   EPwm1Regs.ETPS.bit.SOCAPRD = 1;     // Generate SOCA on the 1st event
EPwm1Regs.ETCLR.bit.SOCA = 1;       // Clear SOCA flag
]  
这里的ADCREG寄存器里的位寄存器和28035芯片资料上的都对应不上,如AdcRegs.ADCREFSEL.all = 39;  而芯片资料上的ADCREG就没有ADCREFSEL这个位,ADCREFSEL是属于ADCCTL1寄存器中,请您帮忙看看
举报

刘婷婷

2018-6-6 10:52:38
请求大侠们给予指点啊!!!
举报

更多回帖

发帖
×
20
完善资料,
赚取积分