Dangerous Prototypes

Dangerous Prototypes => Bus Pirate Support => Topic started by: sburlappp on October 05, 2009, 12:44:58 am

Title: UART Speed Problem?
Post by: sburlappp on October 05, 2009, 12:44:58 am
I just got my Bus Pirate v2go, and updated it to firmware 2.2, and tried to use UART mode to connect it to a TTL serial LCD backpack at 2400/8/n/1, but kept getting line noise on the display. By linking the BP to another TTL serial adapter, I've determined that the BP is running its UART at 300bps no matter what I tell it to use. Has anyone else seen this? Is there a firmware update to fix this?

Possibly important info:

Bus Pirate v2go
http://dangerousprototypes.com (http://dangerousprototypes.com)
Firmware v2.2
DEVID:0x0447 REVID:0x3003 (A3)
Title: Re: UART Speed Problem?
Post by: ian on October 05, 2009, 08:03:38 am
Thanks for doing that leg work. I'll see if I can fix it today. I also ran it by a logic analyzer, it's auto baud calculator kept registering 300baud but I thought it was a fluke. That explains a lot. Now that I know the problem it shouldn't be hard to fix.
Title: Re: UART Speed Problem?
Post by: ericwertz on October 05, 2009, 11:32:07 am
I remember when 300 baud was the sign that things were working properly.
Title: Re: UART Speed Problem?
Post by: ian on October 05, 2009, 08:01:34 pm
I made a little change and uploaded a v2.3 nightly to the v2go SVN firmware folder. Could you bootload that and see if it helps? The code looks fine, I suspect an input routine error or a stupid compiler trick. I'll run it by the LA later tonight or tomorrow.
Title: Re: UART Speed Problem?
Post by: ian on October 06, 2009, 02:48:29 pm
I'm getting close. The array that holds the UART speeds was out of scope of the UART setting code. I have no idea why there wasn't a warning or error, but that seems to be the case.
Title: Re: UART Speed Problem?
Post by: ian on October 06, 2009, 05:22:15 pm
Argh! That was a real head scratcher. Turns out the speed variable in the mode config struct was only 1bit wide, so only 300baud or 1200baud were selectable (often with some garbage bits). This effected other modes as well.

I updated it and tested all speeds, everything seems to work great now. The latest nightly builds include a fix for v2go, v1, and v3:
http://code.google.com/p/the-bus-pirate ... k/firmware (http://code.google.com/p/the-bus-pirate/source/browse/#svn/trunk/firmware)

Other platforms will get the fix in the 2.3 release, or just ask.

Thanks for helping solve this issue!

( ! ) Fatal error: Uncaught exception 'Elk_Exception' with message 'Please try again. If you come back to this error screen, report the error to an administrator.' in /var/www/dangerousprototypes/forum/sources/database/Db-mysql.class.php on line 696
( ! ) Elk_Exception: Please try again. If you come back to this error screen, report the error to an administrator. in /var/www/dangerousprototypes/forum/sources/database/Db-mysql.class.php on line 696
Call Stack
#TimeMemoryFunctionLocation
10.00922051752session_write_close ( )...(null):0
20.00952183328ElkArte\sources\subs\SessionHandler\DatabaseHandler->write( )...(null):0
30.00952184104Database_MySQL->query( ).../DatabaseHandler.php:119
40.05282322824Database_MySQL->error( ).../Db-mysql.class.php:273