mc9s08pa16 poblems with porta2 and porta3

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

mc9s08pa16 poblems with porta2 and porta3

1,651件の閲覧回数
slanfys
Contributor I

Hello I've come to you as my last resort because I am not able to configure a simple pins.

I want porta as a output. I set port_ptad = 0x0F and port_ptaoe = 0x0F

in other hand I realice that porta2 and porta3 can operate as a sci or iic, so I set SYS_SOPT1 register, bit IICPS = 1. And so, i set my pins as I/O port.

 

When I try to test all pins it turns out that porta2 and porta3 don't have tensions. 

At the end, I came to datasheet to study SDA(PTA2)/SCL(PTA3) structure (page 148 datahseet) and I cannot understand how I could send tension to the output pins.

 

Thanks!

0 件の賞賛
返信
3 返答(返信)

1,632件の閲覧回数
slanfys
Contributor I

Yes I know, but how could I come out data from there?

0 件の賞賛
返信

1,614件の閲覧回数
vicentegomez
NXP TechSupport
NXP TechSupport

Hi

recommend that you add an external pull up ( if you do not have it yet) and use the following code (this is just for the PTA2 )

//PTA2's Output Enable Register is set to enable output
PORT_PTAOE_PTAOE2 = 1 ;
//PTA2 pin is driven low 
PORT_PTAD_PTAD2 = 0;

....

PORT_PTAD_PTAD2 = 1;

 

Also you can set the internal pull up but I recommend using the external one

PORT_PTAPE_PTAPE2  = 1; // internal pull up enable

I hope this will help you

 

Regards

 

 

 

0 件の賞賛
返信

1,644件の閲覧回数
vicentegomez
NXP TechSupport
NXP TechSupport

Hi

 

Please be aware that the 

 PTA2 and PTA3 operate as true-open drain when working as output

 

I hope this will help you

 

have a good day

0 件の賞賛
返信