NXP FlexIO is one of the greatest peripherals I have seen for digital I/O. Its great flexibility allows you to do great things like parallel camera interface, synchronous serial port for anything needed to gather data at high speed, especially streaming devices such as MEMS microphones. NXP offers plenty of examples but the documentation is not easy to swallow. I spent quite some time figuring out how to acquire data from the MEMS mic. It was not until months later that I realized the bug I had that prevented K82 from clearly acquiring a PDM signal, but that will be a topic for another short story.
Here I will describe how I handled breaking the K82 IC by just using the FlexIO peripheral and how I repaired the board by replacing it.
What started it allThe FlexIO is a highly configurable peripheral. In short, you have shift registers and timers that can do advance operations on I/O with minimum CPU intervention. Sometimes the CPU only waits for results in a DMA buffer while FlexIO handles how data is received or sent to I/O.
One of the cool things is that you can tighten more than one I/O to a shift register or timer operation. It is up to the compiler to generate machine code that closes those circuits.
But that can be dangerous if you miss something like I did. I was trying to output a bit pattern that repeats indefinitely, but I also needed to interrupt the sequence to send another bit sequence from a buffer in memory using DMA. The problem was the switch-over; even after I load the FlexIO DMA buffer with new pattern, I could not see it in the scope for actually two DMA "periods". That is, I was loading the shift register with 32 bit of data at a time, so I thought that after receiving the first DMA interrupt and change buffers, I was going to see the new sequence on I/O immediately. I was wrong. Anyway, that leads me to the unforgivable "test run" day!
The trial and error approachAfter being a little frustrated trying to make the DMA interrupt do the magic, I got the advice to use a second shift register that will hold the real data, so when needed, it was supposed to be a matter of enabling the corresponding shift register output.
After doing a few unsuccessful tests, I realized something on the IC was not OK. First, the I/O driven level goes down to 2.3V when it should be around 3.3V. Second, the K82F IC and power supply got really really hot.
Nonetheless, I found out the IC was still operating, my code was running almost normally. Though I was afraid to really break it if operated for long period of time, since it was so hot that I put a Raspberry Pi heatsink on it to continue working for some time while getting a new board.
The possible causeAfter consulting with NXP expert, it might be possible that.
"If the I/O driver in the chip is stressed ... it is possible to break it and cause an internal latch up. Since the FlexIO has control of the I/O it could have caused the stress by butting a high connection to GND or vice versa."
I don't have the actual code that made the damage, but to me it was clear that it was the cause, since I didn't change my hardware at all. Actually, I have the same working hardware operating today.
The repair and conclusionThe picture shows the setup I followed to remove the IC using a hot air gun.
The FRDM-K82F has a lot of little 0402 components that might easily fly away if you don't follow some precautions. This was the way I found to do it - using a 3M cooper electrical tape as shown.
My two cents would be: please be careful the next time you want to try fancy stuff with FlexIO. It is so powerful that you might end up blowing the latches without even connecting something to the board.
At the end, I purchased another FRDM-K82F and did the repair when I was confident of not losing time if something went wrong. Now I have two FRDM-K82F in my stock for happy FlexIOing.
Comments