Microchip 328PB xPlained mini - Serial?

Hi there…
I just fired up an xPlained mini board for a specific project.
Burned the bootloader, everything works fine using the IDE to program… it’s quite a simple project, BUT… the SERIAL device isn’t working as expected…

No compile or upload errors, .begin(115200) and .print() all compile, but the output is junk characters…??

Yes - I know about and checked my serial console and PuTTY settings. I tried a couple of other bitrates either side of my 115200 goal…

Just an odd one. I suspect the onboard USB interface chip is not quite doing what I expected.

The code runs fine, just no serial comms - yet the bootloader could send and program without any problems.

Thoughts?

is it possible the crystal frequency setting is incorrect?

That's probably it.

In the xPlained board the 328PB UART runs through the auxiliary 32U4 that handles all communications, programming etc. This makes the xPlained board fundamentally different from e.g. a Nano or an UNO. Check the schematics here: https://ww1.microchip.com/downloads/en/DeviceDoc/ATmega328PB_Xplained_Mini_Schematics.pdf

Furthermore, if you consult the user guide for the xPlained board, you'll find on page 10 that DTR needs to be set in order for the UART to work. AFAIK the IDE should do this (as this is part of the Serial Monitor auto-reset procedure), but perhaps I'm mistaken.

In any case, I'd just start by sniffing the 328PB's TX/RX directly through the respective pins on the extension header (13=RX, 14=TX; see user guide page 21). If that doesn't give proper UART communications with your host machine, start checking potential clocking problems as @horace suggests.

Both great comments...
I did glance over the user guide, but not in specific detail.
I also did think about the clock frequency...

I need to dig a bit deeper on both.
Thanks for the ideas !

The xplained minis don’t run at 115200; the max standard bit rate is 57600. (A limitation of the mEDBG chip)

Thanks… that looks promising.
Luckily my project doesn’t really need serial, other than a few debug prints - but I’ll have a look at that.

I like the very low profile of the board… it fits nice and tight up against the lid of my project box…
The project is running perfectly, a 4-channel sequencer for 10A mains outlets, with self varying step rates based on power consumption..

For my catering wife to run four 2000W hotplates (8000W) or food warmers from a single 10A outlet (2400W) !

  • thinking thermal mass and inertia, it works remarkably well :sunglasses:

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.