Problem with GPIO readning and writing ?

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

Problem with GPIO readning and writing ?

627件の閲覧回数
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 返答(返信)

479件の閲覧回数
karthikpoojary
Contributor III

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

0 件の賞賛

479件の閲覧回数
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

479件の閲覧回数
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