ATD module on HCS12DP256 Overflow Error?

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

ATD module on HCS12DP256 Overflow Error?

2,419 Views
mcu_guy
Contributor I
Hello,
 
I am working with an HCS12DP256 processor.  The application that I am writing requires that an interrupt be generated by the ATD module completes 1 conversion on all 8 of its channels.  I used Processor Expert to configure the ATD module.  Processor Expert had a tool tip on the "conversion time" attribute that stated that if the conversion time was set too short, that it may cause the system to overflow.
 
I've tried looking for information regarding error conditions on the ATD module, and I have not found any information on it.  Does anyone out there have any information on an ATD system overflow?
 
The reason I ask, is that occassionally, it looks like the ATD module is triggering an interrupt continously.  When I increased the conversion time, it stopped doing this.
 
Thanks. :smileyhappy:
Labels (1)
0 Kudos
3 Replies

582 Views
ProcessorExpert
Senior Contributor III
Hello,
The term "system overflow" in the hint of the Start method means, that the conversion is so fast that when the ATD service routine is completed (including the code in the OnEnd event) there is already another conversion ready so the service routine is executed again and again. Thus, the system is stuck in an infinite loop.

Here are some tips to avoid this situation:

- Increase the total conversion time, either by increasing
conversion time or sample time.
- Enable the Autoscan property, when consecutive channels are used.
The ATD then fires and interrupt only when conversion of all
channels is completed, not after every channel.
- If the continuous measurement is not necessary, use Measure
method instead of Start method.
- If the conversion time is really short, is it really necessary
to use interrupts?
- Disabling the EnableEvent/DisableEvent methods can also bring
a small ISR execution speed increase.

best regards
Petr Hradsky
Processor Expert Support Team
UNIS
0 Kudos

582 Views
mcu_guy
Contributor I

Thanks for the clarification.  :smileyhappy:

I do have a followup question...

If I call the ATD_Stop() method in my ATD interrupt service routine would it prevent the "system overflow" from occuring (assuming I don't slow down the conversion rate)?

 

0 Kudos

582 Views
ProcessorExpert
Senior Contributor III
Yes, calling the Stop() method will stop the continuos conversion and the system won't overflow.
However, it's no use to start continuos conversion if you plan just one measurement. Then it's better to use the Measure method, which will do just one measurement and call the On_End event once (if the Interrupt service is enabled).
best regards
Petr Hradsky
Processor Expert Support Team
UNIS
0 Kudos