ADC with internal trigger problems with JM128

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

ADC with internal trigger problems with JM128

1,749 Views
ariclowe
Contributor I
Hello again, I appreciate the last response I received from my previous post, it let me know I was on the right track.  Im currently trying to sample a signal with the ADC every 10 uS and I can see two possible ways of doing so.  First I could sample continually and set the conversion time to 10 uS or I could set the ADC to sample from an internal trigger set to every 10 uS. 

Currently I can get the continous samping to function correctly.  After the conversion is complete the OnEnd function is entered and the proper procedure is followed.  I dont know however how accurate to the 10 uS this method would be and if it would tie up the cpu too much for the other required operations to function.  The second option of setting the internal trigger however disables the interrupt event that I need it to execute after the conversion is complete.  Is the interupt code then to be transfered to the trigger interupt and pend executing upon the conversion complete flag asserting??  For this method I have also failed to locate the trigger source option within Processor Expert.  I might add that the end result of this project is a voltage monitor so upon completing this step I plan to active the compare function to decide whether the incoming voltages are within tolerances previously calculated for the time that this sample was taken, if that makes any difference.

Once again any insight into this would be greatly appreciated. I should also note that to completel the coding Im operating Codewarrion v. 6.2.
Labels (1)
0 Kudos
Reply
2 Replies

508 Views
ProcessorExpert
Senior Contributor III
Hello,

Regarding to setup the RTC module as internal trigger for the ADC bean in the Processor Expert your steps should be the following:

- enable the "Internal trigger" property in the ADC bean
- use bean selector to add Init_RTC or hi-level bean (e. g. Freecntr, TimerInt) with selected "RTCmod" in "Periodic interrupt source" property and configure timing
- in your code use "EnableIntChanTrigger" method to enable internal trigger

We will try to improve the trigger configuration in the ADC bean for the next PE release.

Note:
The RTC module is enabled as a hardware trigger for the ADC module when ADTRG bit is set in the in ADCSC2 register. Please for more detailed information refers to the chapter 21.1.2.3Hardware Trigger in the reference manual of JM128.

best regards
Vojtech Filip
Processor Expert Support Team
UNIS

0 Kudos
Reply

507 Views
ariclowe
Contributor I
Thanks, works good.  Its amazing what one little setting can do.
0 Kudos
Reply