Problem with GPIO readning and writing ?

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

Problem with GPIO readning and writing ?

991 次查看
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.

标记 (2)
3 回复数

843 次查看
karthikpoojary
Contributor III

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

0 项奖励
回复

843 次查看
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

843 次查看
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