Pages: 1 [2] 3 4 ... 8   Go Down
Author Topic: ATTiny85 port (work in progress)  (Read 12627 times)
0 Members and 1 Guest are viewing this topic.
Amsterdam
Offline Offline
Full Member
***
Karma: 1
Posts: 138
he's looking at you, kiddy...
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Ok. that makes sense. i think i can do without special cases and make the whole cores files attiny85 only. I get the feeling that the #if defined is only needed to make one cores dir for a few very similar AVR's. maybe later someone can add the special cases for a attiny84.

I was incorporating the latest developements into the first post but i'm a little ambivalent about it. of course it is nice to have the latest version available, but it could happen that someones comment becomes obsolete. that is confusing at the least...

i will not do that again.

Logged

--
"We're all in this together..."

Amsterdam
Offline Offline
Full Member
***
Karma: 1
Posts: 138
he's looking at you, kiddy...
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

This is fun! i now have the following files open on my mac:

attiny85.pdf
atmega8a.pdf
atmega168.pdf

arduino with a bare minimum sketch (so only setup() and loop() are there)

and bbedit for the editing of my source files.

I hit run in arduino and look at the lines of errors i get.

Code:
../Attiny85/cores/arduino/wiring_analog.c: In function 'analogWrite':

../Attiny85/cores/arduino/wiring_analog.c:86: error: 'TIMER1A' undeclared (first use in this function)

../Attiny85/cores/arduino/wiring_analog.c:86: error: (Each undeclared identifier is reported only once

../Attiny85/cores/arduino/wiring_analog.c:86: error: for each function it appears in.)

../Attiny85/cores/arduino/wiring_analog.c:88: error: 'TCCR1A' undeclared (first use in this function)

../Attiny85/cores/arduino/wiring_analog.c:91: error: 'TIMER1B' undeclared (first use in this function)

in this order i lookup all the acronyms like TIMER1Ain the atmega168 pdf and find out what they do. then i lookup the same function in the attiny85.pdf and change the according cores file.

a lot of work, but is not to difficult.
Logged

--
"We're all in this together..."

SE USA
Offline Offline
Faraday Member
**
Karma: 41
Posts: 3783
@ssh0le
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

heh, god bless the search box
Logged


Amsterdam
Offline Offline
Full Member
***
Karma: 1
Posts: 138
he's looking at you, kiddy...
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

and the find of bbedit is fabulous!
pfew. i'm half way through the files. have to call it a night now. maybe tomorrow more.

i had to guess with the timers because obviously the attiny has less of them. well we will find out later.
Logged

--
"We're all in this together..."

SE USA
Offline Offline
Faraday Member
**
Karma: 41
Posts: 3783
@ssh0le
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

well I know I appreciate the work people put into porting the arduino functionality to these tiny chips

and even though I dont have a application where a 85 would fit in, I know it probably wont be long before I do

Thanks for your efforts, and keep up the good work
Logged


Nottingham, UK
Offline Offline
Jr. Member
**
Karma: 0
Posts: 90
Wait! Don't touch that wire...
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

And of course, there's always the other extreme -- I'm currently working on a 1284 port, now I have my hands on a few 1284P DIPs.

Of course, the 644 port helps, but there are other differences apart from FLASH size and RAM.
Logged

Amsterdam
Offline Offline
Full Member
***
Karma: 1
Posts: 138
he's looking at you, kiddy...
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

well. i got a compile without errors now, but i had to disable some functions in tone.cpp and others because i lack the time to do it propperly. it means digging in the amount of timers and their functions. the tiny has less timers so it could get crowded.

next thing is actually uploading the sketch to the little beast and see if it works. unfortunate all my breadboards are at my workplace tonight.  >smiley-sad Ohh well maybe I start reading into the workings of the timers and how they are used in the arduino...

I would not dare upload the unfinished cores before i have proof of its functionality. so please be patient.
Logged

--
"We're all in this together..."

Amsterdam
Offline Offline
Full Member
***
Karma: 1
Posts: 138
he's looking at you, kiddy...
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

 smiley smiley smiley

of course i let myself not ne hampered by missing hardware. that is what a junk box is for.

i needed to change a  thing to the boards.txt file:

Quote
attiny85.upload.using=avrispmk2

was wrong. it should be
Quote
attiny85.upload.using=avrispmkii

and after successfully uploading the blink sketch the led blinked 8 times to slow. this with a virgin attiny85. that is set from the fatory @ 1Mhz so i had to flash the fuses with
Code:
avrdude -c avrispmkII -P usb -p attiny85 -U hfuse:w:0xDF:m -U lfuse:w:0xE2:m

then it works.

so the main production stream is smooth now. next step will be trying several procedures like pwm and analog in...
Logged

--
"We're all in this together..."

Amsterdam
Offline Offline
Full Member
***
Karma: 1
Posts: 138
he's looking at you, kiddy...
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Ok. so with pwm i get some errors in the

Arduino-0018.app/Contents/Resources/Java/libraries/Servo/Servo.cpp

file.

It can't find  TCCR1A declared. Hmm. that was something i did'nt have time to look into. is there someone with timer knowledge around to help me out?
Logged

--
"We're all in this together..."

0
Offline Offline
Newbie
*
Karma: 0
Posts: 25
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Nice! I am keeping my eye on this.
Logged

0
Offline Offline
God Member
*****
Karma: 39
Posts: 988
Get Bitlash: http://bitlash.net
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I have a Tiny85 version of Bitlash here that's not ready for release, but I'm happy to share the arduino hardware interface code, including serial tx/rx, pwm on one timer, and analog input handling:

http://bitlash.net/wiki/_media/bitlash-hardware-attiny85.c

Caveat: this is collated from several bits of work-in-progress and I can't testify it even compiles.  But it may help with this excellent project.

Good luck.  Happy to answer questions.

-br
http://bitlash.net
http://entropymouse.com
Logged

0
Offline Offline
Full Member
***
Karma: 6
Posts: 200
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Why would this work on the tiny85 and not the 45? I don't want the bootloader or anything, so 4k should be fine.... Or am I missing something?
Logged

Amsterdam
Offline Offline
Full Member
***
Karma: 1
Posts: 138
he's looking at you, kiddy...
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

did someone say it doesnt work on a attiny45?
Logged

--
"We're all in this together..."

Bremen
Offline Offline
Jr. Member
**
Karma: 0
Posts: 61
Arduino!
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

What's the smallest ATtiny that works? Even the ATtiny13(A)?
Logged

Amsterdam
Offline Offline
Full Member
***
Karma: 1
Posts: 138
he's looking at you, kiddy...
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

the 13a has the same footprint as a tiny85. specs are different. less ram, eeprom or flash. it should be doable, but after finding the tiny85 more worthwile i abandoned the 13a. i choose the tiny because of its physical size. the soic-8 is just 7.7 x 5.5 x 1.5 mm and with a internal rc clock you only need one external resistor to make it run.
Logged

--
"We're all in this together..."

Pages: 1 [2] 3 4 ... 8   Go Up
Jump to: