This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

ADC10, MSC bit and DTC

According to datasheets,

when MSC=1 and consq>0 the first rising edge of on the SHI signale triggers the first conversion, successive conversions are trigeered automatically as soon as the prior conversion is completed.

So, if I have SHI @500Hz (source is timerA0.1) and I want use trigger repeated sequence of channel mode (7downto0) , I have to set MSC=1 in ADC10CTL0. This means that every time the shi signal goes high (@500Hz) the ADC will perform 8 conversion(ch 7downto0). The diagram shows that at the end of conversion the ADC10IF is set. First of all, I am not able to figure if if ADC10IF is set at the end of conversion of EACH channel or only at the end of the sequence.
Anyway, the datasheet about MSC bits states

additional rising edges on SHI are ignored until [...]the ENc bit is toggled in [...] repeated-sequence-channel-mode

I can't understand when the ENC bit goes to zero. I set ENC to start conversion, so if I don't set it to zero conversions wil go on over and over?
Or I shall assume that,using interrupt and if the ADC10IF is set at the end of conversion of the sequence, i have to set ADC10CTL0 |= ENC into the adc10 ISR?.

Going on, I would like to use DTC (1 block mode) in repeated-sequence-channel-mode. I shall assume that ADC10IF HERE is set at the end of a complete transfer (so, 8 channels for 5 conversions=40 conversions) . I still have to toggle ENC like datasheet states?

Basically, I would like to perform a sampling of the 8 channels, ignoring ch1.1 and 1.2 and then send results over the UART. I am able to do it using a single burst conversion but not continuously.
Any hint would be appreciated.
Best regards,

Luca.

  • First, you should specify which MSP430 device you are using. The peripherals have some subtle differences depending on family, and in some cases, individual devices in the family.

    That said, I am going to assume F5xx devices since that's the User's Guide I have open all the time....

    luca toso said:
    First of all, I am not able to figure if if ADC10IF is set at the end of conversion of EACH channel or only at the end of the sequence.

    At the end of every conversion. Otherwise how else would you know to grab the value out of ADC10MEM before it get's overwritten by the next conversion?

    luca toso said:
    I can't understand when the ENC bit goes to zero.

    When you set it back to 0.

    luca toso said:
    so if I don't set it to zero conversions wil go on over and over?

    Yes. That's the idea of "repeated sequence of channels".

    You should make sure you understand the state diagrams that the User's Guide shows for each of the modes. (Page 704 of SLAU208L.pdf)

    luca toso said:
    I am able to do it using a single burst conversion but not continuously.

    Make sure you have setup the correct conditions to get from the "Wait for Trigger" state to the "Sample Input Channel x" state.

  • Thanks for your reply.
    Well, currently I am working on a G2553.

    I found out why my project didn't work (and the source of all the questions above) as expected.
    I didnt' set ADC10CT bit in ADC10DCT0, so there was only ONE block transfer.

    Problem solved setting ADC10DCT0|=ADC10CT.

  • luca toso said:
    I set ENC to start conversion, so if I don't set it to zero conversions wil go on over and over?

    Now and yes. No, setting ENC doesn't start the conversion. ADC10SC or the tiemr trigger starts the conversion. ENC jus tenable sthe state machine.
    And yes, if you set MSC, only one trigger is used and then the itnernal timings control all future conversion until end (and in repeated sequence, there is no end).
    Either you start each individual conversion by the timer (not set MSC bit), or you have to use sequence of channels mode ()not repeat) and reset and set ENC in the ADC10_ISR by software after each sequence.

    luca toso said:
    Going on, I would like to use DTC (1 block mode) in repeated-sequence-channel-mode. I shall assume that ADC10IF HERE is set at the end of a complete transfer (so, 8 channels for 5 conversions=40 conversions) .

    Right.

    luca toso said:
    I still have to toggle ENC like datasheet states?

    Yes. And since you don't get an interrupt when the sequence is complete, your only options here are to trigger each conversion individually by the timer or let the sequence run 5 times after triggered once (and then stop it manually by clearign ENC).



**Attention** This is a public forum