The following code fragment is from objdump, and demonstrates a
problem. The
bit fields for the ADC registers are being treated as 2 8-bit entities
instead of a single 16 bit entity. As such, the compiler is generating code
to do byte accesses to registers that may be accessed only as words.
Based on my observations, the MSP430 is simply throwing away the
acceses. No
values are ever being set in the high byte of any of the words.
These structures are defined in adc12.h, in the include directory.
--John
adc12.ctl0.sht0 = 3; // Sample-and-hold times for
channels 0..7 (~6.5us, 4.9152Mhz / 32)
98be: 3d 40 a1 01 mov #417, r13 ;#0x01a1
98c2: 6e 4d mov.b @r13, r14 ;
98c4: 7e f0 f0 ff and.b #-16, r14 ;#0xfff0
98c8: 7e d0 03 00 bis.b #3, r14 ;#0x0003
98cc: cd 4e 00 00 mov.b r14, 0(r13) ;
adc12.ctl0.sht1 = 3; // Sample-and-hold times for
channels 8..15 (~6.5us, 4.9152Mhz / 32)
98d0: 6e 4d mov.b @r13, r14 ;
98d2: 7e f0 0f 00 and.b #15, r14 ;#0x000f
98d6: 7e d0 30 00 bis.b #48, r14 ;#0x0030
98da: cd 4e 00 00 mov.b r14, 0(r13) ;