Quantcast
Channel: Forums - Recent Threads
Viewing all articles
Browse latest Browse all 262198

MSP430F5529: Running ADC and USB problem

$
0
0

Part Number: MSP430F5529

Hello,

in my code I use code from 2 example codes- USB send data and ADC12 Repeated Sequence of Conversions.

When I set:

    ADC12CTL0 = ADC12ON + ADC12MSC + ADC12SHT02;
    ADC12CTL1 = ADC12SHP+ADC12CONSEQ_3;       // Use sampling timer, repeated sequence
    ADC12MCTL0 = ADC12INCH_0;                 // ref+=AVcc, channel = A0
    ADC12MCTL1 = ADC12INCH_1;                 // ref+=AVcc, channel = A1
    ADC12MCTL2 = ADC12INCH_2;                 // ref+=AVcc, channel = A2
    ADC12MCTL3 = ADC12INCH_3;                 // ref+=AVcc, channel = A3
    ADC12MCTL4 = ADC12INCH_4;                 // ref+=AVcc, channel = A4
    ADC12MCTL5 = ADC12INCH_5;                 // ref+=AVcc, channel = A5
    ADC12MCTL6 = ADC12INCH_6;                 // ref+=AVcc, channel = A6
    ADC12MCTL7 = ADC12INCH_7+ADC12EOS;        // ref+=AVcc, channel = A7, end seq.
    ADC12IE = 0x80;                           // Enable ADC12IFG.3
    ADC12CTL0 |= ADC12ENC;                    // Enable conversions
    ADC12CTL0 |= ADC12SC;                     // Start convn - software trigger

The USB doesn't work and when I set:

    PMM_setVCore(PMM_CORE_LEVEL_2);
    USBHAL_initPorts();           // Config GPIOS for low-power (output low)
    USBHAL_initClocks(8000000);   // Config clocks. MCLK=SMCLK=FLL=8MHz; ACLK=REFO=32kHz
    USB_setup(TRUE, TRUE); // Init USB & events; if a host is present, connect

The ADC doesn't work.

I think its a clock problem but I don't know what. Any ideas?

Thanks,

Ofer.


Viewing all articles
Browse latest Browse all 262198

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>