Strange microcontroller UART Issue

88 views
Skip to first unread message

Robert Powers

unread,
Jul 7, 2016, 7:06:01 AM7/7/16
to connected-commu...@googlegroups.com
Hi Everyone,

Sorry I haven't been around as much, but I'm (as always) hoping to re-mediate that.

Remotely, however, I've got a curious situation and hope that someone might have that second pair of eyes that seem so crucial sometimes.

I've been working to get some UART <--> Dual Band Wifi modules going for some projects. They are the Redpine RS9113 series if anyone is curious.

What's weird is that I can talk just fine to these guys with a PC going PC <--USB/Serial--> Wifi module, but I can't get a microcontroller to talk to them. Except they sort of work using a software UART instead of the micro's hardware UART.

Microcontroller hardware UARTs I've tried:
AVR8 - ATMega328P, ATMega32u4, ATMega2564RFR2; 
STM32 - STM32F103RB

---
In summary - what works:
PC <--USB/UART-->Microcontroller
Microcontroller <--UART--> Microcontroller 
PC <--USB/UART--> RS9113-NBZ-D1W
Microcontroller (some, only tested 328P & STM32) <--Software UART--> RS9113-NBZ-D1W

What doesn't work:
Microcontroller <--Hardware UART--> RS9113-NBZ-D1W
---

All UART settings have been at 115200 8N1. This can be altered with some other fiddling around, but I would prefer things to stay at that speed or above.

For some legacy code reasons I'm trying to keep everything tied to the Arduino libraries/environment, but if it gets intractable I can also move away from that with some effort.

Code being used on all the micros is pretty much the Arduino example sketch for multiple serial - just pass everything to the other serial so I can see it on the computer for testing.

Any thoughts? Or is there some information I'm leaving out? I have contacted the manufacturer and asked if they might have some opinion on the matter as well.

Thanks everyone and I'm looking forward to the next time we can catch up in person.

Cheers,
Bob

Angus Gratton

unread,
Jul 7, 2016, 5:20:32 PM7/7/16
to connected-commu...@googlegroups.com
Hi Bob,

Interesting problem! Maybe the modules are very fussy about timing / baud rate error?

What's model of the USB/UART interface that works? Have you tried any other interfaces?

Angus
> --
> You received this message because you are subscribed to the Google Groups "Connected Community HackerSpace" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to connected-community-h...@googlegroups.com.
> To post to this group, send an email to connected-commu...@googlegroups.com.
> To view this discussion on the web, visit https://groups.google.com/d/msgid/connected-community-hackerspace/CA%2BKRtjjgc1TKzji_vjd_cukU1HuZBwsGWOaq7%3D1ZuOOxMU2iAA%40mail.gmail.com.
> For more options, visit https://groups.google.com/d/optout.

Robert Powers

unread,
Jul 7, 2016, 7:23:23 PM7/7/16
to connected-commu...@googlegroups.com
Hi Angus,

Timing was my first thought too. I have quickly tried changing the baud to slower speeds, but it's a little tough because there's some handshaking for setting the modules to do that. And, well, that also doesn't give me much so I'm not clear if that's doing anything or not.

I've been working with an FTDI231x based USB/Serial board I've designed when talking directly to the Redpine modules. Haven't tried anything else, but maybe I'll just throw a FT232 and listen because it's only supposed to be a 3v3 device (the 5V micros don't seem to have caused any damage, so I'm pretty sure that's safe).

Thanks,
Bob

tubular

unread,
Jul 7, 2016, 8:31:59 PM7/7/16
to Connected Community HackerSpace
Does the hardware uart have a 2 stop bit option?  

Do you have a logic analyser?   There's a bitscope at cchs that might help see whats going on 

My other thought is to scope the serial _transmitted_ by the redpine module (while hooked up to PC->USB/Serial->redpine) to get an idea of its natural baud rate and inter character timing.   What it sends out is probably what its expecting coming in.   Maybe it doesn't do a good fractional baud rate


Luke Weston

unread,
Jul 7, 2016, 9:21:02 PM7/7/16
to connected-commu...@googlegroups.com
Maybe just try chucking a Schmitt trigger or a 4050 in there to buffer
the serial signal and make the signal integrity as conservative as
possible, just to see if it makes any difference.
And just try it from a microcontroller with logic level translation
(or native 3.3V) just for the hell of it to be certain, even if it
claims overvoltage tolerance.
> --
> You received this message because you are subscribed to the Google Groups
> "Connected Community HackerSpace" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to connected-community-h...@googlegroups.com.
> To post to this group, send email to
> connected-commu...@googlegroups.com.
> To view this discussion on the web, visit
> https://groups.google.com/d/msgid/connected-community-hackerspace/e087081d-e717-4682-8db8-fa76aaa1bddf%40googlegroups.com.
>
> For more options, visit https://groups.google.com/d/optout.



--
This email is intended only for the personal and confidential use of
the human(s) named above. If intercepted by an extraterrestrial
civilization, all opinions expressed in this email are my own and do
not necessarily reflect the opinion of mankind as a whole.

Robert Powers

unread,
Jul 7, 2016, 9:38:00 PM7/7/16
to connected-commu...@googlegroups.com
Hurmmm. I'm trying a few more things and then I'm on to the logic analyser/scope for this one.

Yes, there is a 2-bit stop option, but all the documentation and previous interaction shows that 8N1 is the correct mode for the module and I think it's fixed.

Those are good options Luke. I'll have a look at them as well.

Thanks,
Bob

Stuart Young

unread,
Jul 7, 2016, 10:12:46 PM7/7/16
to CCHS

Something else that might cause issues is loading (or lack thereof) from internal/external pullup/pulldown resistors.

If you have a 74AC04 lying about, you could run 2 inverters together (to make a buffer) and put them in your signal line to test (run it off 3.3v, the 74AC series can go down to 2v). That should give you really decent output edges that you might not get out of the micro itself using just the internal pullups.

Otherwise try a pullup to 3.3v on the data lines using something like 10k, 4.7k or even 2.2k.

Robert Powers

unread,
Jul 7, 2016, 10:25:51 PM7/7/16
to connected-commu...@googlegroups.com
Looks like it's a subtle timing issue on the default 115200 rate. I've now got it talking with the 3v3 ATMega2564 after fiddling around with the baud rates & getting some baud rate detection handshaking with the module working. Probably just some unfamiliarity with the STM32 is keeping me from getting that working in a similar manner, but that's still unsolved for me.

Thanks everyone for the great suggestions. I'll try to write some more if I can get right to the bottom of it. You guys are all champions.

Cheers,
Bob

Reply all
Reply to author
Forward
0 new messages