Go Down

Topic: BBB is now "Diecimilia ready" (Read 2371 times) previous topic - next topic

brianbr

Sep 09, 2007, 06:53 am Last Edit: Sep 09, 2007, 06:54 pm by brianbr Reason: 1
 I have been working with PaulB on things Arduino with his Bare Bones Board. Paul was initially dismayed because the FTDI TTL-232 cable he uses only supports RTS/CTS, no DTR, and felt that 'autoreset' was out without a redesign or a hack on the IDE. I harbored a suspicion that we might be OK after all, that there might be a simple fix.

So few devices implement a complete set of signals that many drivers have RTS and DTR chained together, either hard coded or someting user configurable. I suspected that the FTDI cable and its driver having only RTS/CTS just might be that way and that it would respond by flagging RTS when commanded to flag DTR. So having nothing to loose but a $0.05 cap and a minute with the soldering iron, I took a 0.1 uF cap with long leads and ran it from pin 6, farthest right from the reset switch (the green wire on the FTDI cable) over to the reset switch and tack soldered it to the side.

I fired up Arduno-0009 and sure enough, I got a reset and a program load, but with the usual interminable wait for the timeout.

I took out my avrisp mkii and my burning jig and burnt a Diecimilia Bootloader and 'voila' I had a Bare Bones Board with autoreset and instant start. This simple modification will work for  Rev B and Rev C  Bare Bones Boards.

Its a real clean hack and doesn't look bad either. I will take pictures tomorrow.

I have developed an inexpensive (kit is $4, 3/$10) serial adapter called the P3 that can be used to program the BBB as well as me a 232/TTL interface that Paul and I will begin marketing next week, my goal tomorrow (oooops, later today) is to adapt that for auto-reset ...


ciao ... BBR

ladyada

Quote


So few devices implement a complete set of signals that I suspected that the FTDI cable and its driver having only RTS/CTS just might respond by flagging RTS when commanded to flag DTR. So I took a 0.1 uF cap with long leads and ran it from pin 6, farthest right from the reset switch (the green wire on the cable) over to the reset switch and tack soldered it to the side.

I fired up Arduno-0009 and sure enough, I got a reset and a program load, but with the usual interminable wait for the timeout.


cool! i added this to my clone before i sent it out for prototype manufacture, on the same suspicion but havent had time to check it out. i will try it out myself, too.

Quote

I have developed an inexpensive (kit is $4, 3/$10) serial adapter called the P3 that can be used to program the BBB as well as me a 232/TTL interface that Paul and I will begin marketing next week, my goal tomorrow (oooops, later today) is to adapt that for auto-reset ...


whats the TTL interface, is it a MAX232 based thing or a FTDI based thing?

 limor

ladyada

Quote
Quote


So few devices implement a complete set of signals that I suspected that the FTDI cable and its driver having only RTS/CTS just might respond by flagging RTS when commanded to flag DTR. So I took a 0.1 uF cap with long leads and ran it from pin 6, farthest right from the reset switch (the green wire on the cable) over to the reset switch and tack soldered it to the side.

I fired up Arduno-0009 and sure enough, I got a reset and a program load, but with the usual interminable wait for the timeout.


cool! i added this to my clone before i sent it out for prototype manufacture, on the same suspicion but havent had time to check it out. i will try it out myself, too.



hmm was not successful in the attempt. which driver are you using? im using the 'FTDI VCP" standard and it doesnt twiddle RTS, checked with my scope. doenst do the right thing with Arduino 009 Alpha either. it would be trivial to make the Arduino software twiddle RTS as well as (or instead of) DTR
maybe it could be a preference in the next version?

 limor

brianbr

#3
Sep 09, 2007, 10:15 pm Last Edit: Sep 09, 2007, 10:17 pm by brianbr Reason: 1
Quote

Quote

I have developed an inexpensive (kit is $4, 3/$10) serial adapter called the P3 that can be used to program the BBB as well as me a 232/TTL interface that Paul and I will begin marketing next week, my goal tomorrow (oooops, later today) is to adapt that for auto-reset ...


whats the TTL interface, is it a MAX232 based thing or a FTDI based thing?

 limor


No its some resistors and a diode feeding a two gates of a hex inverter, which is why an hour ago I made it work with auto reset with just the addition of 2 10k resistors and a cap and one of the heretofore unused gates on the 74HC04.

Max23x is an 'expensive' proposition, if you use  the 232 you are paying in real estate with 5 electrolyics, if you use the 233, you paying in cash with an expensive chip.  I took the front end used by the PICAXE to protect the TTL (3 resistors and a diode) and the inversion of the 7404 family. For autoreset, I added 2 resistors to protect the TTL front  and  the cap for the flagging and used another gate to invert and I have a solid reliable 3 and 5 volt interface that I can sell in kit form with a PCB for $4-5 each and still make a reasonable profit to pay for more R&D for even more toys ...

cheers ... BBR



ladyada

Quote
Quote

Quote

I have developed an inexpensive (kit is $4, 3/$10) serial adapter called the P3 that can be used to program the BBB as well as me a 232/TTL interface that Paul and I will begin marketing next week, my goal tomorrow (oooops, later today) is to adapt that for auto-reset ...


whats the TTL interface, is it a MAX232 based thing or a FTDI based thing?

 limor


No its some resistors and a diode feeding a two gates of a hex inverter, which is why an hour ago I made it work with auto reset with just the addition of 2 10k resistors and a cap and one of the heretofore unused gates on the 74HC04.

Max23x is an 'expensive' proposition, if you use  the 232 you are paying in real estate with 5 electrolyics, if you use the 233, you paying in cash with an expensive chip.  I took the front end used by the PICAXE to protect the TTL (3 resistors and a diode) and the inversion of the 7404 family. For autoreset, I added 2 resistors to protect the TTL front  and  the cap for the flagging and used another gate to invert and I have a solid reliable 3 and 5 volt interface that I can sell in kit form with a PCB for $4-5 each and still make a reasonable profit to pay for more R&D for even more toys ...

cheers ... BBR




huh, i remember some kids doing stuff like that when i was in school, just using zeners, but never did it myself. from what i recall it did work fine for short cable distances.

you dont actually need 1uf electrolytics for the max232, you can just use 0.1uF ceramics which are 5cents each but they're still bulky, its true.

brianbr

Here's photos of the mod for the FTDI cable for the BBB. Th first shows the 6 pin connector and the cap soldered to pin 6, RTS#



The second shows how I tack soldered the other end of  the cap to the reset switch



Its pretty straight forward ...

  cheers ... BBR

ladyada

hi i understand what you did, what im trying to say is that my cable (TTL-232R-5) that i bought from mouser doesn't do what your does. it may be a version thing, it may be a marginal thing. all im saying is that if it doesnt work for me, theres a chance it doesnt work for a bunch of cables and that can make for frustrated customers.
you may want to verify it with a couple different cables to make sure!

brianbr

Quote
hi i understand what you did, what im trying to say is that my cable (TTL-232R-5) that i bought from mouser doesn't do what your does. it may be a version thing, it may be a marginal thing. all im saying is that if it doesnt work for me, theres a chance it doesnt work for a bunch of cables and that can make for frustrated customers.
you may want to verify it with a couple different cables to make sure!


That is  the cable I am running, but I run on a MacBookPro under OSX 10.4.10 ... I have a java problem with Arduino 0009 on my Windows partition I recently thoughtlessly let that upgarde to Java 1.6 . I have to take it over  to my actaul Windows box whihc still has Java 5 (I hope) and see if I can get it to run there .... I will bet that is what it is! Redmond cannot do anything right especially Java!

cheers ... BBR

ladyada

Quote
Quote
hi i understand what you did, what im trying to say is that my cable (TTL-232R-5) that i bought from mouser doesn't do what your does. it may be a version thing, it may be a marginal thing. all im saying is that if it doesnt work for me, theres a chance it doesnt work for a bunch of cables and that can make for frustrated customers.
you may want to verify it with a couple different cables to make sure!


That is  the cable I am running, but I run on a MacBookPro under OSX 10.4.10 ... I have a java problem with Arduino 0009 on my Windows partition I recently thoughtlessly let that upgarde to Java 1.6 . I have to take it over  to my actaul Windows box whihc still has Java 5 (I hope) and see if I can get it to run there .... I will bet that is what it is! Redmond cannot do anything right especially Java!

cheers ... BBR


yup. its probably a driver thing or a java rxtx thing. good luck!

mellis

Hmm, on the Mac, the FTDI drivers may assert (lower) both RTS and DTR when you open the serial port.  On Windows, I modified avrdude to explicitly twiddle DTR, but RTS is probably never touched.  In retrospect, I'm not sure that I actually need to touch DTR in the Arduino code itself, even though I do (in flushSerialBuffer() in Uploader.java).  

ladyada

Quote
Hmm, on the Mac, the FTDI drivers may assert (lower) both RTS and DTR when you open the serial port.  On Windows, I modified avrdude to explicitly twiddle DTR, but RTS is probably never touched.  In retrospect, I'm not sure that I actually need to touch DTR in the Arduino code itself, even though I do (in flushSerialBuffer() in Uploader.java).  



david, do you think it would be possible to make it an option in preferences.txt whether to twiddle RTS or DTR? by default it would be DTR but for us freaks, we could change it to RTS ;)

paulb

On windows machines try this:

Device Manager - USB Serial Port - Port Settings - Advanced button - Set RTS On Close

This is research from David Fowler at uchobby.com


Paul Badger

mellis

It should be possible, though it might be a pain.  I'm not sure if RXTX has methods for setting RTS (that may have been why we went with DTR instead, I don't remember).  Otherwise, we can probably just build it into avrdude on Windows.  Again, on Mac and Linux, you might not need to do anything, as some of the lines get set when the port is opened.  Mostly, it just requires lots of testing, which I don't really have any hardware for.  

Patches welcome.  :)

ladyada

Quote
On windows machines try this:

Device Manager - USB Serial Port - Port Settings - Advanced button - Set RTS On Close

This is research from David Fowler at uchobby.com


Paul Badger


aha! yes now that works fine. i was looking at the FTDI mprog thingy but it was not helpful...

Oliver Keller

limor:
you can tell avrdude directly to toogle a line before uploading. I expllained it here http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1187984620/12#12 and used it in a makfile wich is linked.

you simply add a section like this to $ARUINO_DIR/tools/avr/etc/avrdude.conf:
Code: [Select]

programmer
 id    = "arduino";
 desc  = "Arduino Serial Bootloader";
 type  =  stk500;
 reset = 7;
;


In the avrdude.conf is a SUB-D RS-232 connector pin mapping which shows RTS is pin 7 (hence reset = 7).
Well, after seeing this again, I may have done something wrong, as I initially wanted to toogle DTR (which is pin 4!) but it worked with the setting above!
I've to look at the board again - I probably soldered the wire to one FTDI pin aside or something ;) ...
But it should work in general, as it toggles a reset on my trusty Arduino Extreme/USB boards.

Or maybe the reset does come allways from the general serial port opening? I'm too lazy now to pull my scope from the shelf...
Mellis, what did you find out with avrdude and reset?

p.s. to use this new avrdude option, preferences.txt (or the makefile :) must read upload.programmer=arduino of course

Go Up