mc9s08pa16 poblems with porta2 and porta3

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

mc9s08pa16 poblems with porta2 and porta3

654 Views
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 Kudos
3 Replies

635 Views
slanfys
Contributor I

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

0 Kudos

617 Views
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 Kudos

647 Views
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 Kudos