hi people i'm doing a wireless sensor project using the cc2430 SoC. The general operation is that an accelerometer will pick up vibrations (upto 100Hz) and this will be digitised via the 2430 ADC, buffered using external RAM (found serial FRAM to do this) along SPI and finally wirelessly transmit this to the base station (cc2430 dev. board).
We are now at the stage to program the CC2430 and am asking for advice of how to program it exactly, i have C knowledge but none in MCU prog. domain. I'm using IAR workbench 7.20H to do the programming/compliling etc.
For peripheral programming we need a 32 MHz clock and want to initialise ADC.
The "CC2430.h" has the following for the ADC:
Looking at the cc2430 data sheet and at these corresponding registers ADCCON1:
bit 7(EOC): 0 -conversion not complete, 1-conv. complete
bit 6(ST): 0-no conv. in progress, 1- start a conv. seq, if ADCCON1.STSEL =11
bit 5-4(STSEL): start select, 00- ext trigg, 01- full spd, ..... 11- ADCCON1.ST=1
bit 3-2(RCTRL): controls 16bit num. generator
bit 1-0(-): reserved always 11.
So therefore if i want to start a conversion would i be correct in coding this in my c code:
We are now at the stage to program the CC2430 and am asking for advice of how to program it exactly, i have C knowledge but none in MCU prog. domain. I'm using IAR workbench 7.20H to do the programming/compliling etc.
For peripheral programming we need a 32 MHz clock and want to initialise ADC.
The "CC2430.h" has the following for the ADC:
Rich (BB code):
SFR( ADCCON1 , 0xB4 ) /* ADC Control 1 */
bit 7(EOC): 0 -conversion not complete, 1-conv. complete
bit 6(ST): 0-no conv. in progress, 1- start a conv. seq, if ADCCON1.STSEL =11
bit 5-4(STSEL): start select, 00- ext trigg, 01- full spd, ..... 11- ADCCON1.ST=1
bit 3-2(RCTRL): controls 16bit num. generator
bit 1-0(-): reserved always 11.
So therefore if i want to start a conversion would i be correct in coding this in my c code:
Rich (BB code):
SFR(ADCCON1, 0x73)
// 01110011 : 0x73