Problem with GPIO readning and writing ?

cancel
Showing results for 
Search instead for 
Did you mean: 

Problem with GPIO readning and writing ?

299 Views
karthikpoojary
Contributor III

Hi

I am setting few portlines GPIO mux and enabling internal pulldown. I want this GPIO lines to remain low till externally pulled high.But when GPIO lines pulled high externally and try to read the values the process goes to hardset faults.

My MCU is k64

PORTC->PCR[8] = 0x102;
PORTC->PCR[9] = 0x102;
PORTC->PCR[10] = 0x102;
PORTC->PCR[11] = 0x102;
PORTC->PCR[12] = 0x102;
PORTC->PCR[13] = 0x102;

This are the commands I am using to enable internal pulldowns and set it as GPIOs.

Tags (2)
3 Replies

151 Views
karthikpoojary
Contributor III

I have enabled the clock but still the hardset fault is occuring

0 Kudos

151 Views
mjbcswitzerland
Specialist V

Hi

I think that you need to show the complete code in order for the cause to be visible if you are sure that clocks are enabled.

Regards

Mark

Kinetis for professionals: http://www.utasker.com/kinetis.html
K64 for professionals: http://www.utasker.com/kinetis/FRDM-K64F.html / http://www.utasker.com/kinetis/TWR-K64F120M.html

151 Views
mjbcswitzerland
Specialist V

Hi

It sounds as though you have forgotten to enable the clock to the port in SIM_SCGC5 (bit 0x00000800 for PORT C).

Regards

Mark