is there no need pin function choose in source code with S12ZVC ?

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

is there no need pin function choose in source code with S12ZVC ?

178 Views
iysheng
Contributor II

I looked [Simple Serial Bootloader for S12Z - AN draft - NXP Community](Simple Serial Bootloader for S12Z - AN draft - NXP Community) and want to build a serial code on my S12ZVC board. Now I can build with the SCI.c and releate files success. I do ``InitSCI()`` function , then I call OutStr("\f\r\nS12Z Bootloader v1.0\r\n")。I use SCI1 as default.But I couldn't catch data out on PIN38(PT1/IOC1_1/SCL0/TXD1)。I wonder PIN38 has so many funcs, but I couldn't find where to config PIN38 pin mux in sample code? How could sample code choose PIN38 pin function?

0 Kudos
4 Replies

149 Views
lama
NXP TechSupport
NXP TechSupport

Hi,

 

The pin 38

38   PS5 / KWS5 / MOSI1 / TXD1 / IOC0_2

37  PS4 / KWS4 / MISO1 / RXD1 / IOC0_3

 

The pin description in the table 1-6 presents>

38 PS5 KWS5 MOSI1 TXD1 IOC0_22

The default function is GPIO in input mode. All other function have priority from left(lowest) to right(highest).

If the alternative peripheral/peripherals is/are enabled at the pin then the peripheral with the highest priority takes precedence over other and controls the pin. So if the pin is used as SCI then there is nothing necessary to be set and the pin works like Rx/Tx pinr SCI.

Moreover it is worth to look on the default connection of the peripheral to the pin. In this case, for SCI1, the Rx/Tx can be routed by MODRR register to

Bit 5 of MODRR0, SCI1RR, Module Routing Register — SCI1 routing
(Table 2-4. MODRR0 Routing Register Field Descriptions)

1 TXD1 on PT1; RXD1 on PT0

0 TXD1 on PS5; RXD1 on PS4

The default status of the bit is 0 so TXD1 is on PS5 by default.

 

BTW, The bootloader selection pin is selected in the config,h file…

 

Best regards,

Ladislav

Tags (1)
0 Kudos

136 Views
iysheng
Contributor II
thanks for your patient reply. I wonder after I set RXD1(PT0), then whether I can set the pin with internal pull up?
0 Kudos

97 Views
lama
NXP TechSupport
NXP TechSupport

Hi,

if you use the pin as UART x you do not have to do anything with it.

Of course, if you enable pull-up it will cause nothing from principal point of view.

Best regards,

Ladislav.

 

0 Kudos

53 Views
iysheng
Contributor II

For I use this pin connect with a RS485 convert chip , and I found I always get 0X00 when I switch rs485 in and or. After I searched some soolution, I found someone told to pull up with RX pin. And after I add some code like this

```

PERT_PERT0 = 1;

```

It works.

0 Kudos