Go Down

Topic: Programming standalone chips ? (Read 973 times) previous topic - next topic

flak88

Hi im a newbie have some questions plz go easy.

Ive got this usb to serial adapter
http://www.sparkfun.com/products/8165

And a ATmega644 with the arduino boot loader preinstalled on it


A.How do i wire it up to download a sketch from the arduino Ide to the chip ?

B.What setting under tools->board do i choose ?

Thanks

wanderson

This thread, particularly the first message with a schematic, may help you; http://arduino.cc/forum/index.php/topic,80483.0.html

Pay attention to the part labeled FTDI in the shematic, that should correspond to the USB to Serial adapter you have, wire the correct pins as shown in the above schematic.  You will need to install a hardware core on your computer for this chip.  Instructions for that should have come with you ATMEGA644 with bootloader, if not you MIGHT be able to use the core described in the above thread, which contains instructions on how to install.

After installing the core, you will either find your chip listed, or if you have to use the above referenced core, you will need to modify the boards.txt file for your chip.

Personally, I would contact whomever sold you the 644 chip and see what they can provide as far as instructions and core files.
New true random number library available at: http://code.google.com/p/avr-hardware-random-number-generation/

Current version 1.0.1

CrossRoads

A. Wire up the 644 with crystal, 2 caps, 100nF caps on VCC/AVCC, power ground, 10K pullup on reset.

Connect USB/Serial pins to +5, Gnd, DTR to 100nF cap to chip's reset pin, Rx to Tx, Tx to Rx.

B. That's trickier.  Start with downloading maniacbug's Mighty 1284 core files.  Review the boards.txt file and see if it as 644 variant in it. If not, you'll have to do some code copying to create a 644 entry.
https://github.com/maniacbug/mighty-1284p
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.

flak88

Ok,I have another question related to the ardunio IDE.

Ill give you a run down ive got a standalone atmega 328 set up with this http://www.sparkfun.com/products/8165 usb to serial converter.When i set tools->board->uno it uploads fine and says i have 32,256 bytes maximum.When i set tools->board->ardunio mini w/atmega328 again works fine but this time it says i have 28,672 bytes max.when i choose any other option apart from those two with atmega328 in the description i get this error "avrdude: stk500_getsync(): not in sync: resp=0x00" .Firstly which one of the two should i use when programming the atmega 328 and second why do i get the error ?


Thanks again




kf2qd

Those 2 numbers come from the data file Boards.txt which is one of the Arduino installed files. It is based on which bootloader is loaded on a particulr board/chip combination. If you pick the wrong board you might create a program that is too big for your board.. Unless you are pushing that limit you really don't have to worry.

You are probably just fine using the Arduino Uno profile. I have a couple of those chips myself.

flak88

Ok thx.

How do i resolve the following:

Downloaded arduino 1.0.1 installed the sangunio libraries for the atmega 644 using the guide from http://sanguino.cc/ however when i compile even a bareminimum program from file->examples->basics i get the following error "BareMinimum.cpp:1:21: error: Arduino.h: No such file or directory". Any ideas ???

CrossRoads

I don't know, I use maniacbug's Mighty1284 cores instead.

https://github.com/maniacbug/mighty-1284p

Oops, I use 1284's, not 644's. Disregard, maybe.
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.

CrossRoads

Okay, should be able to duplicate one of the sections in boards.txt for a 644 or 644P entry, adding the needed signature byte info and memory size info.
Something like these >> ?
Code: [Select]

##############################################################

mighty_opt.name=Mighty 1284p 16MHz using Optiboot >> Mighty 644p 16MHz using Optiboot
mighty_opt.upload.protocol=arduino
mighty_opt.upload.maximum_size=130048 >> 63488?? with 2K bootloader
mighty_opt.upload.speed=115200
mighty_opt.bootloader.low_fuses=0xff
mighty_opt.bootloader.high_fuses=0xde
mighty_opt.bootloader.extended_fuses=0xfd
mighty_opt.bootloader.path=optiboot
mighty_opt.bootloader.file=optiboot_atmega1284p.hex
mighty_opt.bootloader.unlock_bits=0x3F
mighty_opt.bootloader.lock_bits=0x0F
mighty_opt.build.mcu=atmega1284p >> atmega644p
mighty_opt.build.f_cpu=16000000L
#mighty_opt.build.core=arduino:arduino
mighty_opt.build.core=standard
mighty_opt.build.variant=standard


and someplace you have to change signature bytes betwen the 2 parts:
ATmega644PA   0x1E 0x96  0x0A
ATmega1284P   0x1E  0x97 0x05
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.

flak88


Okay, should be able to duplicate one of the sections in boards.txt for a 644 or 644P entry, adding the needed signature byte info and memory size info.
Something like these >> ?
Code: [Select]

##############################################################

mighty_opt.name=Mighty 1284p 16MHz using Optiboot >> Mighty 644p 16MHz using Optiboot
mighty_opt.upload.protocol=arduino
mighty_opt.upload.maximum_size=130048 >> 63488?? with 2K bootloader
mighty_opt.upload.speed=115200
mighty_opt.bootloader.low_fuses=0xff
mighty_opt.bootloader.high_fuses=0xde
mighty_opt.bootloader.extended_fuses=0xfd
mighty_opt.bootloader.path=optiboot
mighty_opt.bootloader.file=optiboot_atmega1284p.hex
mighty_opt.bootloader.unlock_bits=0x3F
mighty_opt.bootloader.lock_bits=0x0F
mighty_opt.build.mcu=atmega1284p >> atmega644p
mighty_opt.build.f_cpu=16000000L
#mighty_opt.build.core=arduino:arduino
mighty_opt.build.core=standard
mighty_opt.build.variant=standard


and someplace you have to change signature bytes betwen the 2 parts:
ATmega644PA   0x1E 0x96  0x0A
ATmega1284P   0x1E  0x97 0x05


Thx CrossRoads works now!

Go Up