Questions about ADC and Read status of pins

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

Questions about ADC and Read status of pins

762 Views
nimenhao
Contributor I

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).

2018-06-05_085810.png

This is PIT program.

2018-06-05_090516.png

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

2018-06-05_090534.png

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?

2018-06-05_092821.png

Thanks a lot!

Labels (1)
Tags (1)
0 Kudos
0 Replies