Pages: 1 [2] 3   Go Down
Author Topic: Standalone USB communications  (Read 4603 times)
0 Members and 1 Guest are viewing this topic.
United Kingdom
Offline Offline
Tesla Member
***
Karma: 227
Posts: 6637
Hofstadter's Law: It always takes longer than you expect, even when you take into account Hofstadter's Law.
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

1) Now, just taken a look on the RS site to go and collect some 1284s, however - there is a 1284P-PU model, and a 1284-PU model. In your picture it seems you're using a 1284P-PU, is there however a difference that will matter in this application?

The P version has lower power consumption. The P and non-P versions also generally have different device IDs, which matters when programming them (you need to configure an entry in boards.txt with the matching device ID).

2) Also, back on the subject of fuses and .hex files - i've done a little reading, it seems that fuses are just bits of data stored on the chip, used to define certain configurations, internal vs external oscillator, clock scalars etc. Fuses seems to be a time from the black and white days when one time programmable chips were used, and these were indeed little strips inside the chip that must be burned out by applying current to them etc. Correct?

Mostly, however the "fuses" in the atmega chips are not really fuses, they are extra bits of nonvolatile memory and can mostly be reversed.

As for .hex files, is this the binary code file that the compiler writes and flashes to the chip?

Yes.

3) Reverting back to your post that I did not, but I believe now do understand - to set these fuses correctly, I must put the bootloader on the chip? Then when I flash a sketch using the programmer, the bootloader itself is overwritten - but the fuse settings remain the same, as a sketch has no influence upon the fuse settings?

That's one way of doing it. The other way is to run avrdude directly to program the fuses. See http://miscsolutions.wordpress.com/2011/08/09/prototyping-small-embedded-projects-with-arduino/ for more.
Logged

Formal verification of safety-critical software, software development, and electronic design and prototyping. See http://www.eschertech.com. Please do not ask for unpaid help via PM, use the forum.

Global Moderator
Boston area, metrowest
Offline Offline
Brattain Member
*****
Karma: 544
Posts: 27352
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

1.  1284P vs 1284 - pico power vs not. Different signature bytes to account for. Need to address while programming.  I think make an addition avrdude.conf, copy the 1284p section and change signature bytes.  Add a board type with "m1284" vs "m1284p"

2. Sort of. Are really a couple of EEPROM bytes that define the device configuration, vs one time PROM bits.
 .hex file - yes, the result of the compilation of your sketch. Does not change whether you have bootloader or not - as long as the fuses are set the same.

3.  You don't need to put the  bootloader on to set the fuses - but it does seem the easiest way to do it (to me) from within the IDE and is how I do it. Loading a skecth that overwrites the bootloader does not change the fuses as far as I can tell.

3.
Logged

Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

UK
Offline Offline
God Member
*****
Karma: 1
Posts: 530
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I requested 3x 1284P-PU DIP packages from the Atmel samples page, and just got an email to say they've been shipped - so bit of a result.

Please elaborate on your question 1 response, I'm not sure I'm with you. I've read through the following a couple of times. Given that I will be using the P model, it seems all I need to do is download the file, put the mighty folder in place... which I have done - so I now have Bobuino, Mighty 1284p, Original 1284p etc as board options. To burn the bootloader, do I simply select 'Mighty 1284p 16MHz' as the board, select AVR ISP MKII as the programmer and click Burn Bootloader whilst connected to the ISCP header. http://maniacbug.wordpress.com/2011/11/27/arduino-on-atmega1284p-4/

I haven't seen anything about signature bytes?
« Last Edit: October 16, 2012, 09:57:28 am by jtw11 » Logged

Global Moderator
Boston area, metrowest
Offline Offline
Brattain Member
*****
Karma: 544
Posts: 27352
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

If you look in your copy of avrdude.conf, and find the '1284 section (might be 'm1284p'), you will see the signature bytes.

The different board types represent the pinouts used. You can look in the '1284 variants folders for the 3 board types, each has a pins_arduino.h file. Browse that to see the pinout being used.  Notepad++ is a free download and very nice for looking at C/C++ files.

I don't know if the 1.0.1 supplied avrdude.conf includes the 1284 section, or if the mighty1284 files provide it. Am not at home to check.
Logged

Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

UK
Offline Offline
God Member
*****
Karma: 1
Posts: 530
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

So,

I've got the basic layout of a my standalone 1284P - seems to me this is the correct way to go about it, anybody care to confirm this or tear it apart? I would test it now, but my AVR ISP Mkii hasn't turned up in the post just yet.

« Last Edit: October 23, 2012, 03:57:50 pm by jtw11 » Logged

Greenville, IL
Offline Offline
Edison Member
*
Karma: 15
Posts: 1330
Warning Novice on board! 0 to 1 chance of errors!
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset


 You need a 100uf capacitor to GND on the AREF pin.

Only issue I have spotted.
Logged


Global Moderator
Boston area, metrowest
Offline Offline
Brattain Member
*****
Karma: 544
Posts: 27352
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

100nF is enough for Aref.
Make sure VCC/AVCC have 100nF also.
Logged

Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

UK
Offline Offline
God Member
*****
Karma: 1
Posts: 530
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Make sure VCC/AVCC have 100nF also.

Many thanks for the replies - just to confirm, the cap I've already put on the output of my voltage reg - C5 - is the cap for VCC/AVCC that should be 100nF?
Logged

Global Moderator
Boston area, metrowest
Offline Offline
Brattain Member
*****
Karma: 544
Posts: 27352
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Most 7805 regulators need like 10uF & 1uF caps, they are good for large current filtering.
In addition, you should have 100nF caps right at the VCC, AVCC, and Aref pins to filter out any high frequency noise on the power lines and to provide high-speed bursts of current to support the 16 MHz switching that goes on inside the chip.
Logged

Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

UK
Offline Offline
God Member
*****
Karma: 1
Posts: 530
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Okay, will get those values plugged in. Going back to what we were talking about early on in this thread, I've just realised - if I do not have USB connectivity, I've lost the ability to debug over serial.

I still do not plan to use a bootloader, but rather flash programs using my new AVR ISP Mk ii over ICSP. Serial comms will still work fine without the bootloader correct?
Logged

Global Moderator
Boston area, metrowest
Offline Offline
Brattain Member
*****
Karma: 544
Posts: 27352
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Yes, Serial comms will still work fine without the bootloader.
Logged

Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

UK
Offline Offline
God Member
*****
Karma: 1
Posts: 530
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Yes, Serial comms will still work fine without the bootloader.

Good good.

Now - I've wired up a 1284P on a breadboard just as I've shown in my Eagle schematic. I've connected up my AVR ISP Mk II to the relevant ICSP pins. I've got 'Mighty 1284P 16MHz using Optiboot' selected as my board. I have AVR ISR Mk II selected as the programmer.

When I click Burn Bootloader, I get the following error - avrdude: usbdev_open(): did not find any USB device "usb"

The ISP must be communicating with the chip, as if I go into Atmel Studio and click Device Programming, I can read the fuse states and signature etc.

My copy of avrconf has entries for the 1284P. Not that I know what they mean? Do I need to change the signature in there, for the signature I've read in Atmel Studio?
Logged

Global Moderator
Boston area, metrowest
Offline Offline
Brattain Member
*****
Karma: 544
Posts: 27352
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Probably just need to install the AVR ISP drivers.
Here's the file path:


* AVR_ISP_MKii_path.jpg (74.51 KB, 960x720 - viewed 14 times.)
Logged

Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

UK
Offline Offline
God Member
*****
Karma: 1
Posts: 530
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I've run all the .exe files, but they don't seem to be installers. I guess what I need to do is do something with the file "avrisp2" - but I don't know what to do with this type of file?
Logged

Global Moderator
Boston area, metrowest
Offline Offline
Brattain Member
*****
Karma: 544
Posts: 27352
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Don't you need to do Control Panel: Device Manager:Install new hardware, then browse to the folder, something along those lines?
Logged

Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

Pages: 1 [2] 3   Go Up
Jump to: