Go Down

Topic: ATTiny85 port (work in progress) (Read 18821 times) previous topic - next topic

Cintax

#90
Sep 28, 2010, 06:23 am Last Edit: Sep 28, 2010, 06:24 am by cintax Reason: 1
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

Chinese Jack

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

harry

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.

harry

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.

Graynomad

@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?
Rob Gray aka the GRAYnomad www.robgray.com

John Abshier

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: [Select]
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: [Select]
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

Coding Badly

@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?

Coding Badly

@John Abshier:

Quote
When I try to burn the bootloader to set the fuses I get the following errors
Code: [Select]
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?

John Abshier

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

John Abshier

Coding Badly

#99
Oct 25, 2010, 08:45 pm Last Edit: Oct 25, 2010, 08:46 pm by bcook Reason: 1

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: [Select]
#------------------------------------------------------------
# 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.

rj44319

#100
Nov 04, 2010, 03:35 am Last Edit: Nov 04, 2010, 05:34 am by rj44319 Reason: 1
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  :(...
Code: [Select]

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

Coding Badly


Which IDE version are you using?

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

rj44319

#102
Nov 04, 2010, 05:33 am Last Edit: Nov 04, 2010, 05:39 am by rj44319 Reason: 1
Arduino v18 IDE
this is the board file in hardware sketch file
Code: [Select]

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

Coding Badly


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

rj44319

By not changing anything i am getting to this point...
Code: [Select]

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?

Go Up
 


Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

Arduino
via Egeo 16
Torino, 10131
Italy