KL17 FlexIO - Shift Neg Clock Edge - No Shift takes place

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

KL17 FlexIO - Shift Neg Clock Edge - No Shift takes place

790 Views
JHinkle
Senior Contributor I

The FlexIO is pretty straight forward -- that's why this is perplexing me.

FlexIO described her and in KL reference manual:  https://community.nxp.com/docs/DOC-105640

Here is the data and clock output from a FlexIO data and clock channel. -- I'm only showing the first data bit because I'm interested on what edge the data shift out.

Flex1.png

Here is a similar image from the reference post above.

Flex.png

In both cases, the data is shifting out on the rising (positive) clock edge.

I want my data to shift on the falling (negative) clock edge.

As noted in the 2nd image above, all one SHOULD have to do is to change the Shifter Control TIMPOL value from 0 (shift positive edge) to 1 (shift negative edge) ... as shown in second pic above.

When I set TIMPOL to shift on falling edge -- the complete shift operation STOPS!!  NO data comes out the shifter pin.

I return TIMPOL back to 0 and all shifting operations work -- "on rising clock edge"

Can someone please comment on what the issue may be?

Thanks.

Joe

0 Kudos
3 Replies

525 Views
JHinkle
Senior Contributor I

Xiangjun:

Any update on your findings?

0 Kudos

525 Views
JHinkle
Senior Contributor I

Xiangjun:

Thanks for looking into this.

Here is the core flexio code:  http://joehinkle.com/DownLoad/HinklePixelPWR.zip

I set up an IO channel (both shifter and clock pins exposed) with this call.  It produces the waveform with clocking on positive clock edge I posted earlier.

Shift channel = 0

Timer channel = 0

Shifter pin = 0

timer pin = 1

clock at 800khz

Config_FlexIO_Channel(0, 0, 0, 1, SPI_Timing_800khz_1_WithClock, SPI_OutPut_Clock_Active, kFLEXIO_PinActiveHigh);
I can skew the clock over so that the rising edge is in the middle of the data bit by changing my call to :
Config_FlexIO_Channel(0, 0, 0, 1, SPI_Timing_800khz_1_WithClock, SPI_OutPut_Clock_Active, kFLEXIO_PinActiveLow);
The issue I have with this is my idle clock level it HI - not LO.
Instead of making another argument to my Config_FlexIO_Channel  (adding an argument to control shift edge) I changed my code to:
Config_FlexIO_Channel(0, 0, 0, 1, SPI_Timing_800khz_1_WithClock, SPI_OutPut_Clock_Active, kFLEXIO_PinActiveHigh);
FLEXIO_SHIFTCTL0  |= FLEXIO_SHIFTCTL_TIMPOL_MASK;
When I add the register change to FLEXIO_SHIFTCTL0 after the call to Config_FlexIO_Channel - NO shifter operations occur -- the output from the shift pin is zero.
The basic flexio code is taken directly from the FRDM-82F SDK.
Any insight into this would be appreciated.
Thanks.
Joe

0 Kudos

525 Views
xiangjun_rong
NXP TechSupport
NXP TechSupport

Hi,

Can you post your code here so that we can review and debug  your code on our FRDM board?

BR

Xiangjun Rong

0 Kudos