Pages: 1 ... 5 6 [7] 8   Go Down
Author Topic: ATTiny85 port (work in progress)  (Read 13605 times)
0 Members and 1 Guest are viewing this topic.
0
Offline Offline
Newbie
*
Karma: 0
Posts: 45
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Is there a code repository for this project where updated versions of the modified files are available for download?

The files I Have, I got from:

 http://hlt.media.mit.edu/wiki/pmwiki.php?n=Main.ArduinoATtiny4585
« Last Edit: September 27, 2010, 11:24:15 pm by cintax » Logged

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

Does anyone has an explanation on why the Adruino (not ATTiny85)+softserial+RF doesn't work from my pervious question ? Thanks.
Logged

0
Offline Offline
Jr. Member
**
Karma: 0
Posts: 55
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi,

I'm trying to get a tiny45 and NSSerial working, i'm getting an error relating to timer0, i assume its because the tiny45 either doesnt have a timer0 or its called something else (it seems to be looking for TIMSK0).

Quote
C:\Program Files (x86)\arduino-0019\libraries\NewSoftSerial\NewSoftSerial.cpp: In static member function 'static void NewSoftSerial::enable_timer0(bool)':
C:\Program Files (x86)\arduino-0019\libraries\NewSoftSerial\NewSoftSerial.cpp:520: error: 'TIMSK0' was not declared in this scope
C:\Program Files (x86)\arduino-0019\libraries\NewSoftSerial\NewSoftSerial.cpp:526: error: 'TIMSK0' was not declared in this scope

I'm going to compare datasheets now and see what i can find.
Logged

0
Offline Offline
Jr. Member
**
Karma: 0
Posts: 55
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Turns out it was easier than i thought.

Because the ATtiny45 only has one timer the register is called TIMSK not TIMSK0. Therefore, if you edit the end of NewSoftSerial.cpp to look like this:

Quote
#if defined(__AVR_ATtiny45__)
    sbi(TIMSK, TOIE0);
#else
    sbi(TIMSK0, TOIE0);
#endif
  else
#if defined(__AVR_ATtiny45__)
    cbi(TIMSK, TOIE0);
#else
    cbi(TIMSK0, TOIE0);
#endif

and recompile it will work. I think you'll probably have to have the 45/85 running at atleast 8MHz though.
Logged

nr Bundaberg, Australia
Offline Offline
Tesla Member
***
Karma: 129
Posts: 8530
Scattered showers my arse -- Noah, 2348BC.
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

@Chinese Jack
Quote
the problems disappear if I user either of following solutions:
1. Removing RF models, so the Pin2 is directly connect with Pin3
2. use standard hardware serial Pins (Pin 0 and Pin 1)

Can you verify that SS is actually talking at the correct bit rate?
Logged

Rob Gray aka the GRAYnomad www.robgray.com

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

I am trying to changes the fuses to run at 8MHz.  I am using an Arduino as an ISP (http://hlt.media.mit.edu/wiki/pmwiki.php?n=Main.ArduinoATtiny4585).  Here is my boards.txt
Code:
attiny45.name=ATtiny45
attiny45.upload.using=arduino:arduinoisp
attiny45.upload.maximum_size=4096
attiny45.build.mcu=attiny45
attiny45.build.f_cpu=1000000L
attiny45.build.core=attiny45_85

attiny85s.name=ATtiny85
attiny85s.upload.using=arduino:arduinoisp
attiny85s.upload.maximum_size=8192
attiny85s.build.mcu=attiny85
attiny85s.build.f_cpu=1000000L
attiny85s.build.core=attiny45_85

attiny85.name=ATtiny85-8MHz
attiny85.upload.using=arduino:arduinoisp
attiny85.upload.maximum_size=8192
attiny85.bootloader.low_fuses=0xE2
attiny85.bootloader.high_fuses=0xDF
attiny85.bootloader.path= attiny85
attiny85.bootloader.file=fake.hex
attiny85.bootloader.unlock_bits=0x3F
attiny85.bootloader.lock_bits=0x0F
attiny85.build.mcu=attiny85
attiny85.build.f_cpu=8000000L
attiny85.build.core=attiny45_85
When I try to burn the bootloader to set the fuses I get the following errors
Code:
avrdude: please define PAGEL and BS2 signals in the configuration file for part ATtiny85
avrdude: please define PAGEL and BS2 signals in the configuration file for part ATtiny85
avr_read(): error reading address 0x0000
    read operation not supported for memory "lock"
avrdude: failed to read all of lock memory, rc=-2

John Abshier
Logged

Global Moderator
Dallas
Online Online
Shannon Member
*****
Karma: 208
Posts: 12932
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

@Andy Brown:

Quote
Firstly, the default port of the core code continues to use timer 0 for millis() and micros() timing. The ATtiny has only two timers and they are not equally capable. Timer 0 can do full PWM in the same way as we're used to with the ATmega series. Timer 1 cannot and is the less useful of the two.
In what way is PWM limited when performed from Timer 1?
Logged

Global Moderator
Dallas
Online Online
Shannon Member
*****
Karma: 208
Posts: 12932
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

@John Abshier:

Quote
When I try to burn the bootloader to set the fuses I get the following errors
Code:
avr_read(): error reading address 0x0000
    read operation not supported for memory "lock"
avrdude: failed to read all of lock memory, rc=-2

I've run into the same problem.  Did you figure out how to get it to work?
Logged

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

I didn't get it to work.  I borrowed a friends programmer and burnt the fuses with that.

John Abshier
Logged

Global Moderator
Dallas
Online Online
Shannon Member
*****
Karma: 208
Posts: 12932
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset


As luck would have it, very early this morning I figured out why the "read operation not supported for memory "lock"" error occurs.  There is a section missing from the avrdude.conf file that ships with Arduino.

Code:
#------------------------------------------------------------
# ATtiny85
#------------------------------------------------------------

part
     id            = "t85";
     desc          = "ATtiny85";

[lots of stuff here not included in this post]

     memory "lock"
         size            = 1;
         write           = "1 0 1 0  1 1 0 0  1 1 1 x  x x x x",
                           "x x x x  x x x x  1 1 i i  i i i i";
[glow]         read            = "0 1 0 1  1 0 0 0  0 0 0 0  0 0 0 0",
                           "0 0 0 0  0 0 0 0  o o o o  o o o o";[/glow]
        min_write_delay = 9000;
        max_write_delay = 9000;
       ;

I copied the section for the ATtiny84.  I have no idea if it is accurate but it seems to work.  I don't have time to verify the change against the latest version of AVRDUDE.
« Last Edit: October 25, 2010, 01:46:22 pm by bcook » Logged

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

I have been looking at this post and i whent to this web page:
http://hlt.media.mit.edu/wiki/pmwiki.php?n=Main.ArduinoATtiny4585
I followed the instructons to the "T" and when i program the chip it gives me this error  smiley-sad...
Code:
java.lang.NullPointerException
      at processing.app.debug.AvrdudeUploader.getProgrammerCommands(AvrdudeUploader.java:97)
      at processing.app.debug.AvrdudeUploader.uploadUsingPreferences(AvrdudeUploader.java:58)
      at processing.app.Sketch.upload(Sketch.java:1498)
      at processing.app.Sketch.exportApplet(Sketch.java:1465)
      at processing.app.Sketch.exportApplet(Sketch.java:1420)
      at processing.app.Editor$46.run(Editor.java:2219)
      at java.lang.Thread.run(Thread.java:619)
What is this all about?? :-[
Any ideas???
« Last Edit: November 03, 2010, 11:34:08 pm by rj44319 » Logged

Global Moderator
Dallas
Online Online
Shannon Member
*****
Karma: 208
Posts: 12932
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset


Which IDE version are you using?

Post your boards.txt file.  Please use code tags.
Logged

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

Arduino v18 IDE
this is the board file in hardware sketch file
Code:
attiny45.name=ATtiny45
attiny45.upload.using=arduino:arduinoisp
attiny45.upload.maximum_size=4096
attiny45.build.mcu=attiny45
attiny45.build.f_cpu=800000L
attiny45.build.core=attiny45_85

attiny85.name=ATtiny85
attiny85.upload.using=arduino:arduinoisp
attiny85.upload.maximum_size=8192
attiny85.build.mcu=attiny85
attiny85.build.f_cpu=800000L
attiny85.build.core=attiny45_85

I am using the attiny 85v -10PU-ND just for refrence..
I am using the Arduino Duemilanove (w/ 328) for the ISP
I have a ISP (usb tiny ISP) and if i could figure out how to use that with this I think id be better off.)
« Last Edit: November 03, 2010, 11:39:07 pm by rj44319 » Logged

Global Moderator
Dallas
Online Online
Shannon Member
*****
Karma: 208
Posts: 12932
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset


Two suggestions...

1. I'm not certain if version 0018 supports Tiny processors.  I know version 0019 does.  If it won't cause problems for you, I suggest installing 0019.

2. Try including the bootloader options in boards.txt...

attiny85.bootloader.low_fuses=0x62
attiny85.bootloader.high_fuses=0xD7
attiny85.bootloader.extended_fuses=0xFF
# attiny85.bootloader.path=empty
# attiny85.bootloader.file=empty85at1.hex
attiny85.bootloader.unlock_bits=0xFF
attiny85.bootloader.lock_bits=0xFF
Logged

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

By not changing anything i am getting to this point...
Code:
Binary sketch size: 666 bytes (of a 8192 byte maximum)
avrdude: please define PAGEL and BS2 signals in the configuration file for part ATtiny85
avrdude: stk500_program_enable(): protocol error, expect=0x14, resp=0x50
avrdude: initialization failed, rc=-1
         Double check connections and try again, or use -F to override
         this check.

avrdude: stk500_disable(): protocol error, expect=0x14, resp=0x51

I think this is that reset issue with having to cut that trace to allow it to upload.....
i would like to modify the download setting to the USBtinyISP, any idea how?
Logged

Pages: 1 ... 5 6 [7] 8   Go Up
Jump to: