Using FlexIO on FRDMKL82Z as LCD display interface

cancel
Showing results for 
Search instead for 
Did you mean: 

Using FlexIO on FRDMKL82Z as LCD display interface

623 Views
eduardabelló
Contributor II

Hello everyone, I'm working on en embedded project were we would like to use the FlexIO to Drive a 8080 16 Bit Interface LCD Module, I've been able to set the configuration parameters on the FlexIO following this document and adapting it to 16 bit configuration instead of 8 bits:

https://cache.nxp.com/docs/en/application-note/AN5313.pdf 

Now I would like to start testing it but I really don't know how to manage the FlexIO and I haven't been able to find any example using this kind of configuration, I would be very grateful if anyone has any example code or something to use as walkthrough.

Thank you very much,

Eduard 

Labels (1)
1 Reply

264 Views
martir
Contributor III

UPDATE: we finally managed to work the FlexIO. We haven't find out exactly what was we were doing wrong. I believe it's that we weren't filling the SHIFTBUF7 so the status flag wasn't triggering.

Hi there, we have been investigating and we can't use 16 flexio consecutive pins for other reasons we'll use 8 bits interface.

For now, we have been trying to configure a simple 1-beat writing but with no result.

We configure the timer as the Reference Manual (https://www.nxp.com/docs/en/reference-manual/KL82P121M72SF0RM.pdf ) specifies (page 1537), with a little modification for 8 bits interface.  Configured like this:

 flexio_config_t fxioUserConfig;
 FLEXIO_GetDefaultConfig(&fxioUserConfig);
 fxioUserConfig.enableInDebug = false;
 FLEXIO_Init(FLEXIO0, &fxioUserConfig);
 FLEXIO0->SHIFTCFG[0] = 0x00070100;
 FLEXIO0->SHIFTCTL[0] = 0x00030002;
 FLEXIO0->TIMCMP[0] = 0x00000101;
 FLEXIO0->TIMCFG[0] = 0x00002200;
 FLEXIO0->TIMCTL[0] = 0x01C31081;

(the TIMOD is 8 bit counter mode and the SMOD is transmit mode)

And we modify the SHIFTBUF like this:

FLEXIO0->SHIFTBUF[0] = 0xC0CAC01A;

But we see no activity on the flexio pin (in this example is the 0, and correctly configured in pin_mux.c).

We don't understand the behaviour of timer flag and the Status Shifter Flag (SSF).

The SSF raises to 1 when the flexio is configured, as it is explained in the reference manual, but then when we write new data or we use the function FLEXIO_CleartStatusShifetFlag, it does not clear the flag when it should (?). We're using Freertos, can anything to do with this?

We have tried the flexio_pwm example and it worked well. We're kinda lost now and lacking ideas. Any help would be very apreciated. Thanks Smiley Happy

Martí.