Go Down

Topic: Standalone USB communications (Read 4933 times) previous topic - next topic

dc42


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.
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.

CrossRoads

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.
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

jtw11

#17
Oct 16, 2012, 04:55 pm Last Edit: Oct 16, 2012, 04:57 pm by jtw11 Reason: 1
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?

CrossRoads

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.
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

jtw11

#19
Oct 23, 2012, 10:56 pm Last Edit: Oct 23, 2012, 10:57 pm by jtw11 Reason: 1
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.


cyclegadget


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

Only issue I have spotted.
Good links: Eagle tutorial= http://www.youtube.com/playlist?list=PLDE1858BD83D19C70
General Arduion tutorials = http://tronixstuff.wordpress.com
http://www.gammon.com.au/forum/bbshowpost.php?bbtopic_id=123

CrossRoads

100nF is enough for Aref.
Make sure VCC/AVCC have 100nF also.
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

jtw11


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?

CrossRoads

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.
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

jtw11

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?

CrossRoads

Yes, Serial comms will still work fine without the bootloader.
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

jtw11


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?

CrossRoads

Probably just need to install the AVR ISP drivers.
Here's the file path:
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

jtw11

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?

CrossRoads

Don't you need to do Control Panel: Device Manager:Install new hardware, then browse to the folder, something along those lines?
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

Go Up