AnsweredAssumed Answered

Questions about ADC and Read status of pins

Question asked by NI HAO on Jun 4, 2018

Hi,everyone!

My MCU is MPC5744P.When I use the adc to monitor my switch.When the switch is off , it will entry the PIT and count 10s,then the mcu will turn off the relay and the power will be off.

 

1.When I enable some adc channels,it works well.But when I enable the more channels,the power will be off no more than 10s,maybe 5s,and if I turn off the switch more time,the power will be off immediately.I don't know the PIT is right or not.Realy is open when RELY == 1(high),and off when RELY == 0(LOW).

 

This is PIT program.

 

 

This is the condition to entry the PIT. ADC_THRESHOLD = 2048u. PORT_RELT=PTA. RELY=4.I use A4 to control the relay.

 

2.I want to read the status of pins.I used the function of PINS_DRV_ReadPins(). But I found the values of the PINS not be changed.Is there any else step I have missed?

 

 

Thanks a lot!

Outcomes