MC9S12ZVL ADC external trigger

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

MC9S12ZVL ADC external trigger

904 Views
lukasz_bittner
Contributor I

Hi Everyone,

I'm playing with the DEVKIT-S12ZVL board. What I'm trying to do it's an used an external trigger for ADC. I have created a project in the CW 11.1 with Processor Expert. As a trigger pin I'm using PAD5. To this pin I have connected logic analyzer as well. I have checked that the pin is pulled up. 

pastedImage_1.png

But the measuring is not starting. Could someone tell me what I'm doing wrong that I',m not able to start the measure?

0 Kudos
Reply
2 Replies

769 Views
kef2
Senior Contributor V

I don't know, should digital input enable (DIENADL) be set for PAD5 when uses as an ETRIG? Generated code seems not setting DIEANADx, I would try adding to main:

DIENADL |= (1<<5); 

0 Kudos
Reply

769 Views
lukasz_bittner
Contributor I

Hi Edward, 

You were right. PE didn't generate the code for pin setting. But in my code there is next issue apart from of this. After set the input pin, there is needed to set the RSTA bit in the ADCFLWCTL register, and in case when restart mode is used (as in my example)  when the end of list is reached, the RSTA bit has to be re-set.

Thanks for your reply :smileyhappy:

0 Kudos
Reply