jayashree pasane

S32K116 UART Communication protocol emulation over FLEXIO 

Discussion created by jayashree pasane on Oct 19, 2019
Latest reply on Nov 25, 2019 by Jorge Antonio Alcala Vazquez

I'm trying to emulate UART over flexi on the S32116EVB developer kit. I want to keep the TX of UART by default high (open drain) and then start putting data on tx line. As explained in the reference manual I have the following bits in the register to make it supprort opendrain. 

 

FLEXIO-> SHIFTCTL [0] | = FLEXIO_SHIFTCTL_PINCFG (0x01);
FLEXIO-> SHIFTCTL [0] | = FLEXIO_SHIFTCTL_PINPOL (0x01);

 

When I do the setting as mentioned above in the register , TX line remains at low state and no communication happens (failed to transmit) 

 

I want to set the state of the pin to default high. and start transmission over tx line, Currently this is not possible without external pull up resistor. 

 

So can anyone tell me, if it is true that I always need an external pullup register to achieve communication as given in the above picture?

 

I am attaching my sample setting too for tx line

clock enable

PCC-> PCCn [PCC_PORTA_INDEX] | = 1 << PCC_PCCn_CGC_SHIFT;
// PORTD_0 set as FLEXIO
PORTD-> PCR [2] | = 0x00000400; / * Port D2: MUX = FLEXIO * / 

// Enable clock to the FXIO
(PCC-> PCCn [PCC_FlexIO_INDEX]) | = 0x41000000;

FLEXIO-> CTRL | = FLEXIO_CTRL_DBGE (1);
FLEXIO-> SHIFTSTAT = 0x0F;

// TRANSMITTER
// shifter configuration
FLEXIO-> SHIFTCTL [0] | = (FLEXIO_SHIFTCTL_TIMSEL (0) | FLEXIO_SHIFTCTL_TIMPOL (0) | FLEXIO_SHIFTCTL_PINSEL (0x03) | FLEXIO_SHIFTCTL_SMOD (0x02));
FLEXIO-> SHIFTCTL [0] | = FLEXIO_SHIFTCTL_PINCFG (0x01);
FLEXIO-> SHIFTCTL [0] | = FLEXIO_SHIFTCTL_PINPOL (0x01);
FLEXIO-> SHIFTCFG [0] | = (FLEXIO_SHIFTCFG_INSRC (0) | FLEXIO_SHIFTCFG_SSTOP (0x03) | FLEXIO_SHIFTCFG_SSTART (0x02));
// set baud rate
// FLEXIO-> TIMCMP [0] = 0x00000F04;
// timer configuration
FLEXIO-> TIMCFG [0] | = (FLEXIO_TIMCFG_TIMOUT (0) | FLEXIO_TIMCFG_TIMDEC (0) | FLEXIO_TIMCFG_TIMDIS (0x02) | FLEXIO_TIMCFG_TIMENA (0x02) | FLEXIO_TIMCFG_TSTOP (0x02) | FLEXIO_TIMCFG_TSTART (0x01));

 

Outcomes