MC9S12E128 ATD Multi & Single Channel Operation

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

MC9S12E128 ATD Multi & Single Channel Operation

1,229 Views
EagleBeak
Contributor I

Greetings,

I have an application where I continuously scan 10 channels on the ATD port but now have a requirement to periodically scan only one channel several times fast, then switch back to multi channel scanning. The input to the channel is pulsing and I'm trying to determine the average power. Refering to MC9S12E128 Data Sheet, Rev. 1.07, it leads me to believe that I should be able to select between single or continuous on single channel or multiple channels.

 

The single channel that I want to monitor is Channel 6. ATDCTL3 has 4 bits S8C, S4C, S2C, S1C that  dictate the Conversion Sequence Length. If I select 0001, it never converts channel 6 and the minimum number I can put in and still get it to scan is 0111. This seems to be the problem.

 

ATDCTL5 is configured Single Channel Conversion(SCAN - Bit 5), Sample only one channel (MULT - Bit 4) set the Input Channel Select Code to 0110 for Channel 6. This makes sense.

 

I want to stop, change to single channel, convert channel 6 ten times fast, then restore ATDCTL3 and 5 back to the multi channel mode.

 

Shouldn't I be able to convert and read one channel in 1/10th the amount of time it takes to convert and read 10 channels? Could it be that you can only achieve this speed if the single channel you want to monitor is Channel 0?

 

If anyone knows how to do this it would be greatly appreciated because I'm hacking at this point having tried what the data sheet said and not getting the results I expect. It may be that I cannot do what I want to do.

 

Thanks,

Eagle Beak

Labels (1)
0 Kudos
2 Replies

282 Views
kef
Specialist I

Do you know that:

1) when you are converting multiple channels, from channel 0 to channel >6, then channel 6 data is placed to data register number 6

2) when you are converting single channel 6, then channel 6 data is placed to data register number 0.

3) if you convert 3 channels, channel 4 to channel 6, then channel 4 data goes to data register 0, channel 5 to data register 1, channel 6 to data register 2

 

Isn't that your problem?

 

0 Kudos

282 Views
EagleBeak
Contributor I

Kef

 

You are absolutely right and thanks a million ! This solved my problem. 

 

What I would like to know is how you knew this? I have read through the data sheet:

 

MC9S12E128 Data Sheet, Rev. 1.07, Chapter 6 Analog-to-Digital Converter (ATD10B16CV2).

 

Thanks again,

Eagle Beak

0 Kudos