Go Down

Topic: Attiny2313 Programming (Read 965 times) previous topic - next topic

tsaG

Hi!

I want to programm an Attiny2313 over ISP (I do have an mySmartUSB). What do I need? My plan is to write the code, choose the Board, export the hex file and burn it using atmel studio (or similar).

I already tried this: http://hlt.media.mit.edu/?p=1695
But after I placed those files in my Arduino/hardware folder and want to start the Arduino IDE it crashes and says "Menu has no enabled Items".

How do I do it correctly? Where do I get the library (?) from?

Erni

You can program the attiny2313 using the Arduino IDE.

No need to use Atmel Studio, unless you really wnat to.

Get the tiny core here:

https://code.google.com/p/arduino-tiny/

And a little guide to get started:

http://www.ernstc.dk/arduino/2313.htm

tsaG

#2
Mar 29, 2013, 04:52 pm Last Edit: Mar 29, 2013, 05:01 pm by tsaG Reason: 1
Okay, I imported the library and everything compiled so far.

I uploaded it using Atmel Studio (since I dont want to use the Bootloader on the small Attiny :D). As I plugged it in, its way to fast! I chose 8mhz in the menu but the 1mhz version doesnt work neither.

Then, when I tried another output, works finde but still the "speed problem". Now I added another Output to it so it switched between 11 and 12. Doesnt work!

It just switches the first in line! So my guess is that this thing is setting the output and then (somehow) restarting, setting the output..... and so on.

Any suggestions?

I flashed the Attiny of this Relayboard.
http://www.produktinfo.conrad.com/datenblaetter/175000-199999/197720-an-01-ml-8FACH_RELAISKARTE_24V_7A_de_en_fr_nl.pdf
http://www.conrad.de/ce/de/product/197720/Conrad-8fach-Relaiskarte-24-VDC-7-A-Baustein-8-Relaisausgaenge
Quite simple. an 7805 for power supply. An Toshiba Darlington Array and a MAx232 chip for Serial Output (not needed).

The Attiny is powered on pin 20 (VCC) and 10 GND. 8Mhz Oscillators on Pin 4 and 5.

The fuses are set as the following (didnt change it and left the default settings):

I also activated the internal clock divider once but there is no difference

BTW: I get some warnings while compiling, are those warnings normal? Mainly delay.h


Code: [Select]










/Applications/Arduino.app/Contents/Resources/Java/hardware/tools/avr/bin/avr-g++ -c -g -Os -Wall -fno-exceptions -ffunction-sections -fdata-sections -mmcu=attiny2313 -DF_CPU=1000000L -MMD -DUSB_VID=null -DUSB_PID=null -DARDUINO=104 -I/Users/patrick/Documents/Arduino/hardware/tiny/cores/tiny /var/folders/yh/7z4yt3513s508pr0kwzw7zb40000gn/T/build6049173189546008161.tmp/Blink.cpp -o /var/folders/yh/7z4yt3513s508pr0kwzw7zb40000gn/T/build6049173189546008161.tmp/Blink.cpp.o
/Applications/Arduino.app/Contents/Resources/Java/hardware/tools/avr/bin/avr-gcc -c -g -Os -Wall -ffunction-sections -fdata-sections -mmcu=attiny2313 -DF_CPU=1000000L -MMD -DUSB_VID=null -DUSB_PID=null -DARDUINO=104 -I/Users/patrick/Documents/Arduino/hardware/tiny/cores/tiny /Users/patrick/Documents/Arduino/hardware/tiny/cores/tiny/pins_arduino.c -o /var/folders/yh/7z4yt3513s508pr0kwzw7zb40000gn/T/build6049173189546008161.tmp/pins_arduino.c.o
In file included from /Users/patrick/Documents/Arduino/hardware/tiny/cores/tiny/wiring_private.h:32,
                from /Users/patrick/Documents/Arduino/hardware/tiny/cores/tiny/pins_arduino.c:38:
/Applications/Arduino.app/Contents/Resources/Java/hardware/tools/avr/bin/../lib/gcc/avr/4.3.2/../../../../avr/include/avr/delay.h:36:2: warning: #warning "This file has been moved to <util/delay.h>."
/Users/patrick/Documents/Arduino/hardware/tiny/cores/tiny/pins_arduino.c:70: warning: initialization makes integer from pointer without a cast
/Users/patrick/Documents/Arduino/hardware/tiny/cores/tiny/pins_arduino.c:71: warning: initialization makes integer from pointer without a cast
/Users/patrick/Documents/Arduino/hardware/tiny/cores/tiny/pins_arduino.c:73: warning: initialization makes integer from pointer without a cast
/Users/patrick/Documents/Arduino/hardware/tiny/cores/tiny/pins_arduino.c:79: warning: initialization makes integer from pointer without a cast
/Users/patrick/Documents/Arduino/hardware/tiny/cores/tiny/pins_arduino.c:80: warning: initialization makes integer from pointer without a cast
/Users/patrick/Documents/Arduino/hardware/tiny/cores/tiny/pins_arduino.c:82: warning: initialization makes integer from pointer without a cast
/Users/patrick/Documents/Arduino/hardware/tiny/cores/tiny/pins_arduino.c:88: warning: initialization makes integer from pointer without a cast
/Users/patrick/Documents/Arduino/hardware/tiny/cores/tiny/pins_arduino.c:89: warning: initialization makes integer from pointer without a cast
/Users/patrick/Documents/Arduino/hardware/tiny/cores/tiny/pins_arduino.c:91: warning: initialization makes integer from pointer without a cast

/Applications/Arduino.app/Contents/Resources/Java/hardware/tools/avr/bin/../lib/gcc/avr/4.3.2/../../../../avr/include/avr/delay.h:36:2: warning: #warning "This file has been moved to <util/delay.h>."

/Applications/Arduino.app/Contents/Resources/Java/hardware/tools/avr/bin/../lib/gcc/avr/4.3.2/../../../../avr/include/avr/delay.h:36:2: warning: #warning "This file has been moved to <util/delay.h>."

/Applications/Arduino.app/Contents/Resources/Java/hardware/tools/avr/bin/../lib/gcc/avr/4.3.2/../../../../avr/include/avr/delay.h:36:2: warning: #warning "This file has been moved to <util/delay.h>."

/Applications/Arduino.app/Contents/Resources/Java/hardware/tools/avr/bin/../lib/gcc/avr/4.3.2/../../../../avr/include/avr/delay.h:36:2: warning: #warning "This file has been moved to <util/delay.h>."
/Users/patrick/Documents/Arduino/hardware/tiny/cores/tiny/wiring_digital.c: In function 'pinMode':
/Users/patrick/Documents/Arduino/hardware/tiny/cores/tiny/wiring_digital.c:43: warning: cast to pointer from integer of different size
/Users/patrick/Documents/Arduino/hardware/tiny/cores/tiny/wiring_digital.c: In function 'digitalWrite':
/Users/patrick/Documents/Arduino/hardware/tiny/cores/tiny/wiring_digital.c:120: warning: cast to pointer from integer of different size
/Users/patrick/Documents/Arduino/hardware/tiny/cores/tiny/wiring_digital.c: In function 'digitalRead':
/Users/patrick/Documents/Arduino/hardware/tiny/cores/tiny/wiring_digital.c:146: warning: cast to pointer from integer of different size

/Applications/Arduino.app/Contents/Resources/Java/hardware/tools/avr/bin/../lib/gcc/avr/4.3.2/../../../../avr/include/avr/delay.h:36:2: warning: #warning "This file has been moved to <util/delay.h>."
/Users/patrick/Documents/Arduino/hardware/tiny/cores/tiny/wiring_pulse.c: In function 'pulseIn':
/Users/patrick/Documents/Arduino/hardware/tiny/cores/tiny/wiring_pulse.c:48: warning: cast to pointer from integer of different size
/Users/patrick/Documents/Arduino/hardware/tiny/cores/tiny/wiring_pulse.c:53: warning: cast to pointer from integer of different size
/Users/patrick/Documents/Arduino/hardware/tiny/cores/tiny/wiring_pulse.c:58: warning: cast to pointer from integer of different size


tsaG

I changed the delay path so now its fixed. but not the other errors like (for example):

Code: [Select]
/Users/patrick/Documents/Arduino/hardware/tiny/cores/tiny/Print.cpp: In member function 'void Print::print(const String&)':
/Users/patrick/Documents/Arduino/hardware/tiny/cores/tiny/Print.cpp:48: warning: comparison between signed and unsigned integer expressions

/Users/patrick/Documents/Arduino/hardware/tiny/cores/tiny/wiring_pulse.c: In function 'pulseIn':
/Users/patrick/Documents/Arduino/hardware/tiny/cores/tiny/wiring_pulse.c:48: warning: cast to pointer from integer of different size

/Users/patrick/Documents/Arduino/hardware/tiny/cores/tiny/wiring_digital.c: In function 'pinMode':
/Users/patrick/Documents/Arduino/hardware/tiny/cores/tiny/wiring_digital.c:43: warning: cast to pointer from integer of different size
/Users/patrick/Documents/Arduino/hardware/tiny/cores/tiny/wiring_digital.c: In function 'digitalWrite':
/Users/patrick/Documents/Arduino/hardware/tiny/cores/tiny/wiring_digital.c:120: warning: cast to pointer from integer of different size
/Users/patrick/Documents/Arduino/hardware/tiny/cores/tiny/wiring_digital.c: In function 'digitalRead':
/Users/patrick/Documents/Arduino/hardware/tiny/cores/tiny/wiring_digital.c:146: warning: cast to pointer from integer of different size

/Users/patrick/Documents/Arduino/hardware/tiny/cores/tiny/pins_arduino.c:70: warning: initialization makes integer from pointer without a cast


The sketch some works some kid when i just que the digitalpin1.on.. digitalpin1.off..digitalpin2.on ...  Without the delay. So I tried the "Blink without delay" example but this doesnt work at all. Looks like as if none of the libraries are working (?)

Go Up