32-Bit Parallel Receive on Rising Edge Pin (FRDM-MCXN947)

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

32-Bit Parallel Receive on Rising Edge Pin (FRDM-MCXN947)

199 Views
Flexin_On_The_IO
Contributor I

I am currently trying to configure a 32-bit parallel Shifter to receive data from an external device with one of the pins (FLEX_D4/DATA_VALID) being used as a signal to Shift in the data. 

The progress I have made has allowed me to read in the 32-bit data when DATA_VALID has triggered and move the data into an eDMA Ping-Pong buffer. I am currently testing through Printf statements of reading the buffer data to a console and if the Shifter has any errors (usually indicating Overrun according to the datasheet) they will print to the console as well. 

I believe my main issue is with the TimerConfig as it is triggering the Shifter to read too many times on one rising edge of DATA_VALID but I have not found a configuration that allows me to read only once while actually moving the correct data. 

Console Output: 

Reading Buffer A: 0x3fffefff
Shifter Error Code: 0x8
Shifter Status: 0x0
SHIFTSDEN: 0x8
DMA CSR: 0x0
DMA Error: 0x0
TCD BITER: 0x2 CSR: 0x12
CH_MUX: 0x40


Reading Buffer B: 0x3fffefff
Shifter Error Code: 0x8
Shifter Status: 0x0
SHIFTSDEN: 0x8
DMA CSR: 0x0
DMA Error: 0x0
TCD BITER: 0x2 CSR: 0x12


My FLEX_IO setup is attached. Thank you.

 

3 Replies

184 Views
Flexin_On_The_IO
Contributor I

Update: I was able to deduce that "kFLEXIO_TimerDisableOnTriggerFallingEdge" was keeping my CPU in the callback.

I believe I want to disable after a Timer Compare but with this option SHIFTBUF only reports a value of 0x0 but with no SHIFTERR flag. 

0 Kudos
Reply

117 Views
carlos_o
NXP TechSupport
NXP TechSupport

Hi  @Flexin_On_The_IO 

Thank you for your post!

Could you please share the current behavior you see in your register? 

Which test data are you trying to receive and what you currently get? 

Could you please share which MCXN are you using? 

Is it a custom board? if not, please specify the board you are using

 

0 Kudos
Reply

112 Views
Flexin_On_The_IO
Contributor I

Hi @carlos_o thank you for the reply!

I was able to get the Timer reading on DATA_VALID edge like I wanted but did not update the thread. My current code is attached.

The problem I am facing now is getting the FlexIO to keep up with other devices. In my current setup I am basically sampling DATA_VALID and at higher speeds, the Shifter can get Overrun. My thinking is that my design requires a shared clock between the MCX & host device that would be sending the 32-bit data. I can use a pin within the 32-bit data bus to be this signal so I do not need to breakup the FlexIO pins. Any input on this idea would be welcome!

To answer your previous questions:

1. The registers are populating as intended at lower speeds. On every DATA_VALID falling edge, the SHIFTBUF stores data from the 32 Pins and the EDMA transfers to my Ping-Pong buffer via a Scatter-Gather method.

2. I am simulating input through an Analog Discovery 2, since that only has 16 data pins I am just writing the upper values of the 32-bits, simulating a clock on the DATA_VALID pin, and tying the unused pins down. Test data is matching correctly at low speeds.

3. I am using the FRDM-MCXN947

0 Kudos
Reply
%3CLINGO-SUB%20id%3D%22lingo-sub-2387811%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E32-Bit%20Parallel%20Receive%20on%20Rising%20Edge%20Pin%20(FRDM-MCXN947)%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2387811%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EI%20am%20currently%20trying%20to%20configure%20a%2032-bit%20parallel%20Shifter%20to%20receive%20data%20from%20an%20external%20device%20with%20one%20of%20the%20pins%20(FLEX_D4%2FDATA_VALID)%20being%20used%20as%20a%20signal%20to%20Shift%20in%20the%20data.%26nbsp%3B%3CBR%20%2F%3E%3CBR%20%2F%3EThe%20progress%20I%20have%20made%20has%20allowed%20me%20to%20read%20in%20the%2032-bit%20data%20when%20DATA_VALID%20has%20triggered%20and%20move%20the%20data%20into%20an%20eDMA%20Ping-Pong%20buffer.%20I%20am%20currently%20testing%20through%20Printf%20statements%20of%20reading%20the%20buffer%20data%20to%20a%20console%20and%20if%20the%20Shifter%20has%20any%20errors%20(usually%20indicating%20Overrun%20according%20to%20the%20datasheet)%20they%20will%20print%20to%20the%20console%20as%20well.%26nbsp%3B%3CBR%20%2F%3E%3CBR%20%2F%3EI%20believe%20my%20main%20issue%20is%20with%20the%20TimerConfig%20as%20it%20is%20triggering%20the%20Shifter%20to%20read%20too%20many%20times%20on%20one%20rising%20edge%20of%20DATA_VALID%20but%20I%20have%20not%20found%20a%20configuration%20that%20allows%20me%20to%20read%20only%20once%20while%20actually%20moving%20the%20correct%20data.%26nbsp%3B%3CBR%20%2F%3E%3CBR%20%2F%3E%3C%2FP%3E%3CP%3EConsole%20Output%3A%26nbsp%3B%3C%2FP%3E%3CP%3EReading%20Buffer%20A%3A%200x3fffefff%3CBR%20%2F%3EShifter%20Error%20Code%3A%200x8%3CBR%20%2F%3EShifter%20Status%3A%200x0%3CBR%20%2F%3ESHIFTSDEN%3A%200x8%3CBR%20%2F%3EDMA%20CSR%3A%200x0%3CBR%20%2F%3EDMA%20Error%3A%200x0%3CBR%20%2F%3ETCD%20BITER%3A%200x2%20CSR%3A%200x12%3CBR%20%2F%3ECH_MUX%3A%200x40%3C%2FP%3E%3CP%3E%3CBR%20%2F%3EReading%20Buffer%20B%3A%200x3fffefff%3CBR%20%2F%3EShifter%20Error%20Code%3A%200x8%3CBR%20%2F%3EShifter%20Status%3A%200x0%3CBR%20%2F%3ESHIFTSDEN%3A%200x8%3CBR%20%2F%3EDMA%20CSR%3A%200x0%3CBR%20%2F%3EDMA%20Error%3A%200x0%3CBR%20%2F%3ETCD%20BITER%3A%200x2%20CSR%3A%200x12%3C%2FP%3E%3CP%3E%3CBR%20%2F%3EMy%20FLEX_IO%20setup%20is%20attached.%26nbsp%3BThank%20you.%3C%2FP%3E%3CBR%20%2F%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-2387811%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CLINGO-LABEL%3EClock%7CTimers%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3ECommunication%20%26amp%3B%20Control(I3C%20%7C%20I2C%20%7C%20SPI%20%7C%20FlexCAN%20%7C%20Ethernet%20%7C%20FlexIO)%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EDevelopment%20Board%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EMCXN%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2387820%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%2032-Bit%20Parallel%20Receive%20on%20Rising%20Edge%20Pin%20(FRDM-MCXN947)%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2387820%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EUpdate%3A%20I%20was%20able%20to%20deduce%20that%20%22%3CSPAN%3EkFLEXIO_TimerDisableOnTriggerFallingEdge%3C%2FSPAN%3E%22%20was%20keeping%20my%20CPU%20in%20the%20callback.%3CBR%20%2F%3E%3CBR%20%2F%3EI%20believe%20I%20want%20to%20disable%20after%20a%20Timer%20Compare%20but%20with%20this%20option%20SHIFTBUF%20only%20reports%20a%20value%20of%200x0%20but%20with%20no%20SHIFTERR%20flag.%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2388551%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%2032-Bit%20Parallel%20Receive%20on%20Rising%20Edge%20Pin%20(FRDM-MCXN947)%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2388551%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHi%26nbsp%3B%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F264226%22%20target%3D%22_blank%22%3E%40Flexin_On_The_IO%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EThank%20you%20for%20your%20post!%3C%2FP%3E%0A%3CP%3ECould%20you%20please%20share%20the%20current%20behavior%20you%20see%20in%20your%20register%3F%26nbsp%3B%3CBR%20%2F%3E%3CBR%20%2F%3EWhich%20test%20data%20are%20you%20trying%20to%20receive%20and%20what%20you%20currently%20get%3F%26nbsp%3B%3C%2FP%3E%0A%3CP%3ECould%20you%20please%20share%20which%20MCXN%20are%20you%20using%3F%26nbsp%3B%3C%2FP%3E%0A%3CP%3EIs%20it%20a%20custom%20board%3F%20if%20not%2C%20please%20specify%20the%20board%20you%20are%20using%3C%2FP%3E%0A%3CBR%20%2F%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2388562%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%2032-Bit%20Parallel%20Receive%20on%20Rising%20Edge%20Pin%20(FRDM-MCXN947)%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2388562%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHi%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F241501%22%20target%3D%22_blank%22%3E%40carlos_o%3C%2FA%3E%26nbsp%3Bthank%20you%20for%20the%20reply!%3C%2FP%3E%3CP%3EI%20was%20able%20to%20get%20the%20Timer%20reading%20on%20DATA_VALID%20edge%20like%20I%20wanted%20but%20did%20not%20update%20the%20thread.%20My%20current%20code%20is%20attached.%3C%2FP%3E%3CP%3EThe%20problem%20I%20am%20facing%20now%20is%20getting%20the%20FlexIO%20to%20keep%20up%20with%20other%20devices.%20In%20my%20current%20setup%20I%20am%20basically%20sampling%20DATA_VALID%20and%20at%20higher%20speeds%2C%20the%20Shifter%20can%20get%20Overrun.%20My%20thinking%20is%20that%20my%20design%20requires%20a%20shared%20clock%20between%20the%20MCX%20%26amp%3B%20host%20device%20that%20would%20be%20sending%20the%2032-bit%20data.%20I%20can%20use%20a%20pin%20within%20the%2032-bit%20data%20bus%20to%20be%20this%20signal%20so%20I%20do%20not%20need%20to%20breakup%20the%20FlexIO%20pins.%20Any%20input%20on%20this%20idea%20would%20be%20welcome!%3CBR%20%2F%3E%3CBR%20%2F%3ETo%20answer%20your%20previous%20questions%3A%3C%2FP%3E%3CP%3E1.%20The%20registers%20are%20populating%20as%20intended%20at%20lower%20speeds.%20On%20every%20DATA_VALID%20falling%20edge%2C%20the%20SHIFTBUF%20stores%20data%20from%20the%2032%20Pins%20and%20the%20EDMA%20transfers%20to%20my%20Ping-Pong%20buffer%20via%20a%20Scatter-Gather%20method.%3C%2FP%3E%3CP%3E2.%20I%20am%20simulating%20input%20through%20an%20Analog%20Discovery%202%2C%20since%20that%20only%20has%2016%20data%20pins%20I%20am%20just%20writing%20the%20upper%20values%20of%20the%2032-bits%2C%20simulating%20a%20clock%20on%20the%20DATA_VALID%20pin%2C%20and%20tying%20the%20unused%20pins%20down.%20Test%20data%20is%20matching%20correctly%20at%20low%20speeds.%3C%2FP%3E%3CP%3E3.%20I%20am%20using%20the%20FRDM-MCXN947%3C%2FP%3E%3C%2FLINGO-BODY%3E