9 years, 12 months ago.

KL25Z serial ports, some not working?

I'm finding some serial ports not working.

Not working: PTD5,PTD4 (UART 2) PTA1,PTA2 (UART 0)

Working PTD7,PTD6 (UART 0) PTC3,PTC4 (UART 1)

Are some of the pin maps not supported?

Bit of a problem when using the 32pin QFN MCU as not many ports available to choose from.

Any suggestions?

1 Answer

9 years, 12 months ago.

What kind of test are you using that they don't work? PTA1 and PTA2 do work 100% sure, although it might give sometimes a bit strange results: They are USBTX and USBRX. Since they work, also PTA1 and PTA2 work, but considering they are also connected to the interface chip on the board they might not function as expected. But I assume you are using a custom PCB, then that shouldn't be an issue.

Isn't USB_DP and USB_DM for USB port?

PTA1 and PTA2 was working on my custom board (I know this as I have another board working as I write this), but not now, just double checked. I went back to the standard FRDM board with latest build Mbed.h and decided to see what other ports I could use, PTD4 and PTD5 are available on my custom board so tried these on the FRDM board, stripped my code down just to display something on the Oled from the Xbee, not working.

I tried the last port available on the 32pin QFN chip, PTC3 and PTC4, this works on the FRDM board and my custom board so I can use this, but something is adrift here.

One observation, I am using serial port PTD6 and PTD7 for the Oled display and this does work but noticed the DIN led on my Xbee board (using PTD4 and PTD5) was flashing when there was activity to the Oled display, very strange.

One function shows the problem, if you have interrupt call back 'xbee1.attach(&RXupdate);' the program locks at this point. If using the other working ports it runs okay.

It appears the 'serial attach' bit is causing a problem, works on some ports but not others.

I think I may have worked this out, not all ports have interrupt available so I'm thinking I may be correct in saying I need to chose a serial port that does have interrupt function as well to attach an interrupt call back.

Is there a complete pin assignment listing available?

posted by Paul Staron 05 May 2014

USB_DP is I think (looking at the name) for the KL25's own USB port. PTA1 and PTA2 are wired to the interface chip on the standard board. So if they wouldn't work, the USBTX and USBRX serial connection wouldn't operate.

All ports should have interrupt available, there should be no difference there. Here is the full list: http://mbed.org/users/mbed_official/code/mbed-src/file/d57c40a064c8/targets/hal/TARGET_Freescale/TARGET_KLXX/TARGET_KL25Z/PeripheralPins.c

An easy test would be on the standard KL25Z board to simply short two RX and TX pins and connect them in code to USBTX and USBRX. But you aren't using a single peripheral at two locations? Or something else also on those pins? Because it would be weird if PTA1 and PTA2 don't work (I assume that the different pin count doesnt change pin registers), since then every program using printf debugging wouldn't operate.

posted by Erik - 05 May 2014