Pages: 1 [2]   Go Down
Author Topic: My little homebrew Arduino  (Read 2794 times)
0 Members and 1 Guest are viewing this topic.
Peoples Republic of Cantabrigia
Offline Offline
God Member
*****
Karma: 6
Posts: 722
Arduino happiness
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

ZIF sockets are great, but they sure can be pricey, especially if you're looking at non-DIP form factors. 'Bespoke', I guess!
Logged

Offline Offline
Full Member
***
Karma: 0
Posts: 204
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset


Also - if you plan on doing any kind of re-programming of the ATMega (bootloaded or otherwise) on a constant basis (perhaps to build your own standalone boards or something), you don't want to plug and unplug the ICs from the Arduino board. Instead, use a ZIF socket; in fact, there are shields available designed just for this purpose. If this is something you do often (say, for adding an Arduino HEX dump to pre-bootloaded ATMegas for small-scale production or something), you might just want to construct a dedicated Arduino and ZIF socket shield for this purpose.

That's what I was planning on doing when I ran into this project. I even picked up an Arduino protoshield and a few ZIF's for the project. I then learned that you can't upload sketches to a bare 328 without removing the chip in the Arduino.  I've been looking at a way of making a shield that will allow burning the bootloader and uploading a sketch without a bunch of fiddling.

I should probably just get a dedicated programmer or cable.

I know this is probably nonsensical:



But it's something I was sort of, a little bit, thinking about. Maybe 28 pins from the protoshield running down to the chip socket from one of the ZIFs for normal Arduino operation and burning bootloaders to a bare chip which would be mounted in the 2n'd ZIF.  Then for uploading sketches you could just remove the "normal" chip and load directly to the other (Abnormal?) one.

I know that the wiring is different when burning the bootloader vs uploading sketches so that could make it un workable.

Any input on this or is it the dumbest post ever  smiley-razz

I thought about mounting a ZIF on the board in place of the holder but you'd still be stuck pulling the shield, pulling the chip/ reverse, etc everytime you wanted to burn a chip.
Logged

UK
Offline Offline
Faraday Member
**
Karma: 99
Posts: 4153
Where is your SSCCE?!?!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

I added a DB9 socket and MAX232 chip to my programming shield so I can program the chip through a standard RS-232 connector.
Logged

Get 10% off all 4D Systems TFT screens this month: use discount code MAJENKO10

Offline Offline
Full Member
***
Karma: 0
Posts: 204
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I added a DB9 socket and MAX232 chip to my programming shield so I can program the chip through a standard RS-232 connector.

Pretty old school aint' it? Sounds pretty cool though  smiley-cool
Logged

UK
Offline Offline
Faraday Member
**
Karma: 99
Posts: 4153
Where is your SSCCE?!?!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

I added a DB9 socket and MAX232 chip to my programming shield so I can program the chip through a standard RS-232 connector.

Pretty old school aint' it? Sounds pretty cool though  smiley-cool

Nah - I have USB RS-232 cables coming out of my ears (it's quite painful actually).

I could have added an FT-232 or a MCP2222, but I didn't have any of the former, and I didn't want to waste a crystal on the latter.  So I added one of my many many many MAX232 chips (actually an ADM232 this one)
Logged

Get 10% off all 4D Systems TFT screens this month: use discount code MAJENKO10

Offline Offline
Full Member
***
Karma: 0
Posts: 204
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Are there any DIP style chips for usb/micro usb? Or is that just another can-O-worms? I'm just amazed at using discreet (I guess that's the word) components for this stuff!
Logged

UK
Offline Offline
Faraday Member
**
Karma: 99
Posts: 4153
Where is your SSCCE?!?!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

DIP is so old school smiley-razz

Any decent proto shield (see my eBay shop) has space for SOIC and TSSOP chips.

I find I am working with SOIC more than DIP these days,
Logged

Get 10% off all 4D Systems TFT screens this month: use discount code MAJENKO10

Leeds, UK
Offline Offline
Edison Member
*
Karma: 80
Posts: 1726
Once the magic blue smoke is released, it won't go back in!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

If you have a PIC programmer, I have an hex file which allows a PIC18F14K50 to be a USB-Serial port including a DTR pin for arduino auto reset - I've been using it for a standalone arduino project and it works well. Its all through hole and only requires a USB socket, 12MHz crystal and a couple of capacitors. (If you don't, I'm sure there must be an Arduino pic programmer project somewhere)
Logged

~Tom~

Phoenix, Arizona USA
Offline Offline
Faraday Member
**
Karma: 40
Posts: 5581
Where's the beer?
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

That's what I was planning on doing when I ran into this project. I even picked up an Arduino protoshield and a few ZIF's for the project. I then learned that you can't upload sketches to a bare 328 without removing the chip in the Arduino.  I've been looking at a way of making a shield that will allow burning the bootloader and uploading a sketch without a bunch of fiddling.

I should probably just get a dedicated programmer or cable.

What I believe you do (and what I believe the various ZIF socket shields do) is "transfer" the ATMega (pre-bootloaded) to the ZIF, and remove it from Arduino board. The shield or ZIF board (or what have you) basically has the ZIF socket, plus the crystal/resonator on-board, plus a few other parts - all the other pins and such are brought up via the headers (IIRC when I was researching this, only the clock/xtal pins aren't brought up through the headers, so you have to add that).

Of course, this necessitates always using pre-bootloaded ATMega chips; if your goal is to add the bootloader to completely bare ATMegas, then that solution won't work (though I wonder if you couldn't somehow bring the ICSP pins up in some manner, and use the ArduinoISP sketch or something, maybe with some kind of switches to allow you to select bootloaded or not?).

Maybe your scheme with double ZIF sockets is something along those lines? One socket for a bootloaded chip, the other for non-bootloaded?

Ultimately in the end, if all you are doing is dumping a hex file, you don't even need the bootloader (unless you have some reason or need to allow the end-user to change the code)...
Logged

I will not respond to Arduino help PM's from random forum users; if you have such a question, start a new topic thread.

0
Offline Offline
Edison Member
*
Karma: 8
Posts: 1411
Arduino rocks
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
DIP is so old school
For some reason, 90% of the kit buyers prefer through hole to SMDs.
Logged

Offline Offline
Full Member
***
Karma: 0
Posts: 204
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

When I started fooling with Arduino's I had a few little projects in mind and figured I'd need an UNO per project so I was excited to learn that I could roll my own! It makes things cheaper and it also makes stuff seem more "my own" but I'm probably getting in the deep end sooner than I should... I think I've burned up my Google on this project alone  smiley-razz

I would really just like a simple, quick and dirty way of programming my own chips.  cr0sh suggested not using a bootloader which may be a good option once something is nailed down but I'd prefer to stick with what I have figured out for now. Maybe down the road I'll look into it.

If you look at the tutorial here:

http://arduino.cc/en/Tutorial/ArduinoToBreadboard

It shows how the chip is wired up to both burn the bootloader and upload sketches. If you check out the wiring you'll notice that the only difference (Other than deleting the connections from pins 17,18 and 19 on the bare chip to pins 11, 12and 13 on the Arduino and connecting the RX and TX pins of each) between setups is switching the reset pin on the bare chip between the reset pin and pin 13 on the Arduino.

I'm not sure if it would work but it may be possible to make a shield with a switch that changed the reset wiring and leave the rest in place. It could seriously gork something out though...

Maybe you could have a shield like the pic I posted with one ZIF holding a bootloaded chip that is really just the normal chip relocated with all the wiring in place. With no chip in the 2nd ZIF it would be business as usual. Just use the pins on the shield and treat it as a normal Arduino. You could also bring the LED's up top which would be nice.

The 2n'd ZIF would have all the connections shown in the tutorial except for a switch that toggled between one reset position and the other.

The sequence would be something like this:

Insert new chip into empty ZIF(#2), toggle reset switch, burn bootloader using Arduino as ISP, repeat for other chips until you have a great big pile or your fingers are sore, you gotta potty, etc...

then:

Remove the original chip (The one that's been used as ISP), toggle reset switch, place bootloaded chip in 2n'd ZIF, upload "BLINK" to chip, repeat until you have enough for a christmas tree.

then:

Replace chip in ZIF #1 with a bootloaded unit. Build ultrasonic cat chaser/blind opener/ wall climbing robot, etc.  smiley-razz

Would this work or would having the extra wiring to the chip cause some problems?

Just something I was thinking about...  I may try it unless someone thinks it just can't work.

I would like to check out some SMD stuff. I'd like a new soldering station and one of those hot air rework/soldering iron deals would be nice.
« Last Edit: July 13, 2012, 05:42:07 pm by hoff70 » Logged

Peoples Republic of Cantabrigia
Offline Offline
God Member
*****
Karma: 6
Posts: 722
Arduino happiness
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

I suggest dropping the boot loader also. Instead go for the ISP header and use a standard 2x3 matrix to allow you to burn the boot loader once followed by uploading programs directly.

You still have to burn a boot loader once in order to set all the right fuses, allow the MCU to use an external oscillator, etc.  but uploading via ISP is really easy now because arduino 1+ gives you the option right in the file menu. I only use that option since switching to the 1.01 IDE.

I'd also counsel you to buy a isp programmer like the atmel avr mk II ISP just in case you ever want to burn 'bigger' chips like the 1280, 1284p, or the 2560.
Logged

Offline Offline
Full Member
***
Karma: 0
Posts: 204
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I suggest dropping the boot loader also. Instead go for the ISP header and use a standard 2x3 matrix to allow you to burn the boot loader once followed by uploading programs directly.

You still have to burn a boot loader once in order to set all the right fuses, allow the MCU to use an external oscillator, etc.  but uploading via ISP is really easy now because arduino 1+ gives you the option right in the file menu. I only use that option since switching to the 1.01 IDE.

 

Could you elaborate?  I'm using 1.0 because it works well for me. I' a little spooked about flubbing things up by upgrading  smiley-roll-blue
Logged

Peoples Republic of Cantabrigia
Offline Offline
God Member
*****
Karma: 6
Posts: 722
Arduino happiness
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Arduino 1.01 or 1.0 are pretty similar. One big upgrade from alpha version 0001-0023 to 1.0 and up was that the IDE now allows you to upload sketches two ways - either via Serial or directly via the ICSP header. The standard way is still via serial, but you can select the use of a ICSP programmer right in the file menu. In past revisions of the Arduino IDE, one had change a somewhat obscure text file to switch to the programmer of your choice - but only while the Arduino IDE was not running. So if you wanted to switch back and forth between the approaches, the whole thing got tedious. Thankfully, that issue has been fixed.

The standard ICSP or ISP header is a 2x3 matrix of relevant SPI / reset / etc. pins that allow a bootloader to be burned onto the Atmel chip. On the current Uno, there are two of them, one for the USB chip (not populated) and another to the right / above the MCU.  During the bootloader burning process, a number of 'fuses' and other parameters are set that you will need to for the chip to work as expected. For example, the speed of the chip is a function of the oscillator and the various settings inside the chip. One time I didn't burn a bootloader before uploading a sketch via the ISP header and the chip ran at a much lower than expected speed. Once I had uploaded a bootloader once and then uploaded the same  sketch (even while erasing the bootloader in the process), all was fine.

I made the jump from the 022 BT version of the IDE to the 1.01 revision once the great Maniacbug finished updating support for the 1284P in the current version of the IDE (thanks Maniacbug!).
Logged

Pages: 1 [2]   Go Up
Jump to: