Offline
Newbie
Karma: 0
Posts: 25
|
 |
« on: January 27, 2013, 05:30:17 am » |
Hi all, Ok so I've been searching for days now but either I cannot get it, or I cannot find a clear tutorial on WHAT (not how) to do. Ok so lets say I bought an ATmega328P (SMD version) and created my own PCB and it's time to burn the code that I have written. Code that works well on an Arduino Uno. Its just that I decided to build my own PCB. 1. Am I right to say that I first need to burn the bootloader, and than followed by my code? 2. I have an FT232RL ( https://www.sparkfun.com/products/718) and also a USBtinyISP ( http://www.ladyada.net/make/usbtinyisp/). I found tutorials on how to connect these so this is not the issue, but I need to understand better, Which one do I need? What do I program what with? For example, as I see this at the moment, I need to use the FT232RL to burn the bootloader once for the very first time and than I need to continue using the USBtinyISP to burn my code but this is just vague... I'm not sure. Thanks reading and appreciate any thoughts even if you don't know how to answer all questions. Thanks a lot Clinton
|
|
|
|
|
Logged
|
|
|
|
|
Offline
Newbie
Karma: 0
Posts: 25
|
 |
« Reply #1 on: January 27, 2013, 05:55:12 am » |
Oh... guess this finally answers it. Don't you hate it that when you quit trying and you post in a forum, you immediately find you answer >.< http://www.ladyada.net/learn/breakoutplus/ftdifriend.htmlCheers all
|
|
|
|
|
Logged
|
|
|
|
|
Global Moderator
Melbourne, Australia
Offline
Shannon Member
Karma: 226
Posts: 14091
Lua rocks!
|
 |
« Reply #2 on: January 27, 2013, 05:44:34 pm » |
If you can burn a bootloader, you can burn your code instead. You don't need both, unless you happen to want to use the bootloader in future. I have a bit of a walk-through here: http://www.gammon.com.au/forum/?id=11637
|
|
|
|
|
Logged
|
|
|
|
|
United Kingdom
Offline
Faraday Member
Karma: 144
Posts: 4882
|
 |
« Reply #3 on: January 27, 2013, 05:51:46 pm » |
Ok so lets say I bought an ATmega328P (SMD version) and created my own PCB and it's time to burn the code that I have written. Code that works well on an Arduino Uno. Its just that I decided to build my own PCB. 1. Am I right to say that I first need to burn the bootloader, and than followed by my code? 2. I have an FT232RL ( https://www.sparkfun.com/products/718) and also a USBtinyISP ( http://www.ladyada.net/make/usbtinyisp/). I found tutorials on how to connect these so this is not the issue, but I need to understand better, Which one do I need? What do I program what with? Include a 6-pin ICSP header on your PCB, then you can program the atmega328p in-situ using the usbtinyisp. You don't need to FT232RL or a bootloader. You do need to be careful what else you connect to the MOSI, MISO and SCLK pins of the atmega328p in your design, to make sure that the usbtinyisp can take control of those pins during programming.
|
|
|
|
|
Logged
|
Formal verification of safety-critical software, software development, and electronic design and prototyping. http://www.eschertech.com
|
|
|
|
Offline
Newbie
Karma: 0
Posts: 25
|
 |
« Reply #4 on: January 28, 2013, 03:32:35 am » |
Hey thanks for your replies. Yes I know MOSI and MISO goes berserk when programming so I set them up as inputs with buttons to be safe. Can I use the USBtinyISP with Arduino IDE? Thanks for the tutorial too X
|
|
|
|
|
Logged
|
|
|
|
|
Global Moderator
Melbourne, Australia
Offline
Shannon Member
Karma: 226
Posts: 14091
Lua rocks!
|
 |
« Reply #5 on: January 28, 2013, 03:37:56 am » |
Can I use the USBtinyISP with Arduino IDE?
Yes, I am using that.
|
|
|
|
|
Logged
|
|
|
|
|
Offline
Newbie
Karma: 0
Posts: 25
|
 |
« Reply #6 on: January 28, 2013, 05:30:39 am » |
Awesome  Thanks a lot guys 
|
|
|
|
|
Logged
|
|
|
|
|
Offline
Full Member
Karma: 0
Posts: 207
|
 |
« Reply #7 on: January 28, 2013, 12:56:01 pm » |
Hey thanks for your replies. Yes I know MOSI and MISO goes berserk when programming so I set them up as inputs with buttons to be safe. Can I use the USBtinyISP with Arduino IDE? Thanks for the tutorial too X What is the function of the button and what do you mean Mosi miso goes berserk? Thanks
|
|
|
|
|
Logged
|
|
|
|
|
Global Moderator
Melbourne, Australia
Offline
Shannon Member
Karma: 226
Posts: 14091
Lua rocks!
|
 |
« Reply #8 on: January 28, 2013, 03:14:23 pm » |
I presume he means that he uses those pins as input buttons (for whatever their purpose is). You wouldn't press them during programming. ... goes berserk ... Has activity on them.
|
|
|
|
|
Logged
|
|
|
|
|
Offline
Newbie
Karma: 0
Posts: 25
|
 |
« Reply #9 on: January 28, 2013, 04:48:58 pm » |
Right... I was refering to a situation I had once where I had a relay connected to MOSI and during programming, the relay kept clicking like mad. Hence were I got the berserk adjective. The buttons are normal push to make buttons which do not have to be pressed during programming. It is understood that by doing so, I would be interfering with the programming but this is better than having a relay or some output connected to them and during programming you would be risking damaging or controlling something.
|
|
|
|
|
Logged
|
|
|
|
|
Offline
Full Member
Karma: 0
Posts: 207
|
 |
« Reply #10 on: January 28, 2013, 10:02:38 pm » |
So, is that means it is better not to connect any input/output device at the MOSI, MISO and SCK pins ? Are you programming using USBasp/usbtiny right ? If you are using ftdi programmer, then it will only involve Tx and Rx
Thanks
|
|
|
|
|
Logged
|
|
|
|
|
Global Moderator
Melbourne, Australia
Offline
Shannon Member
Karma: 226
Posts: 14091
Lua rocks!
|
 |
« Reply #11 on: January 28, 2013, 10:48:28 pm » |
True, but then you have to make sure you don't have anything connected to Tx/Rx for best results. So, is that means it is better not to connect any input/output device at the MOSI, MISO and SCK pins ? It depends on the device a bit. SPI devices are designed for this sort of thing, you just don't activate them through their slave select pin.
|
|
|
|
|
Logged
|
|
|
|
|
Offline
Full Member
Karma: 0
Posts: 207
|
 |
« Reply #12 on: January 28, 2013, 10:53:47 pm » |
I still dont get for the explanation on SPI pins
|
|
|
|
|
Logged
|
|
|
|
|
Global Moderator
Melbourne, Australia
Offline
Shannon Member
Karma: 226
Posts: 14091
Lua rocks!
|
 |
« Reply #13 on: January 28, 2013, 10:58:25 pm » |
|
|
|
|
|
Logged
|
|
|
|
|
Offline
Full Member
Karma: 0
Posts: 207
|
 |
« Reply #14 on: January 28, 2013, 10:59:34 pm » |
Thanks alot ! Great websites you have there !
|
|
|
|
|
Logged
|
|
|
|
|
|