LumiNet (based on attiny84)

Thank you SuperCow, I'll be waiting for that.
But, nonetheless, this new 0018 core will just produce valid attiny84 .hex files.
How will i get them in the chip after that?

Will I have to get an AVR programmer (USBtinyISP looks good) and dish the Arduino-ISP (a waste), or am I missing something here?

:-/

Well i got it fast ready here is the updated attiny84 core file
Attiny84

The attiny84 does not have a uart/serial port, so making a bootloader is much harder, But i will try this.

I also tested with the arduinoISP for you, and i got it working.
So you dont need a bootloader, and you can upload with the arduino IDE

But there are some step's you need to do (copy/past from the readme)

If you dont have a ISP programmer you can use the arduino Examples ArduinoISP
Upload that sketch to a normal arduino, see http://arduino.cc/en/Tutorial/ArduinoISP
And Connect arduinopin 13 to CLK, 12 to MISO, 11 to MOSI and 10 to RESET
Also hook up the 5V+ and GND. For those line on a attiny, check the datasheet @ atmel.com
for the 14pdip it's:
pin 1 5V
pin 4 RESET (Needs a 10K resistor in parrallel with 5V+)
pin 7 MOSI
pin 8 MISO
pin 9 CLK
pin 14 GND

                     +-\/-+
               VCC  1|    |14  GND
          (D0) PB0  2|    |13  AREF
          (D1) PB1  3|    |12  PA1 (D9)
             RESET  4|    |11  PA2 (D8)
INT0  PWM (D2) PB2  5|    |10  PA3 (D7)
      PWM (D3) PA7  6|    |9   PA4 (D6)
      PWM (D4) PA6  7|    |8   PA5 (D5) PWM
                     +----+

I just found out that you can set this parameter in boards.txt, so when you selected the attiny84, it will use automatic the arduinoIsp
So you don't have to change your preference file.
This is updated in the latest 03 version

Next you have to edit your preference file, and change the upload.using=bootloader to upload.using=arduinoisp
see http://arduino.cc/en/Hacking/Programmer for more info

Now you can upload to the atting84 without bootloader :slight_smile:
remember when you want to upload to a normal arduino, you have to change the preference file again to bootloader

S.C. - wow, thanks - I'll be trying this too.

I just found out, the fuses has to be set too.
I found a workaround for this as well.
Burn the bootloader first, this will set the fuses correct.
There is no bootloader, but its uploading a fake bootloader.
blink sketch on pin 2 (arduino pin 0)
For this you have to download the core again, a update in it
new attiny84-03 core

sweet, thank you!

SuperCow, you are awesome!
Your mod for the 0018 worked just fine!

Uploading sketches on the tiny84 on the breadboard via the ArduinoISP... is just a click away!

THANK YOU VERY MUCH for your time and effort!

Just a small question though, what if we want to use pins 2,3 as the XTAL inputs for the attiny84 clock?
Will it be possible for you to come with another "fake" bootloader that
sets the fuses for the tiny84 to work with an external crystal?
An maybe, as a confirmation, it will flash a LED at pin4 instead.

Will making this "fakeXTAL.hex" be easy? ::slight_smile:

That is not problem at all.
But for this to work you need 8 MHz or 16MHz.
Arduino doesn't support other MHZ.
It will work, but your timing will be off for the delay functions etc.

For an external crystal between 8-16mhz use these fuses:
Edit the boards.txt in the attiny84 folder
attiny84.bootloader.low_fuses=0xff
attiny84.bootloader.high_fuses=0xdd
attiny84.bootloader.extended_fuses=0xff

Then just burn the bootloader again.
Your right about the blink led, its on port 3 (d1)
But you lose the 2 ports for digitalwrite, so arduino pin 0 and 1 you cant use then.

But in most cases 8mhz if fast enough, so i designed it around 8mhz to save 2 pins.

by the time you hook up the isp, tiptoe around the 1 int and aref yea there is not a whole bunch left

Osgeld, you can use the MOSI, MISO, SCK pins for I/O as well as programming.

SuperCow, you are right, 8MHz is fast enough for most projects.

But, I run into my first problem with the ATtiny84.
My analogRead commands don't seem to work at all!
I am defining pinMode on pin9 (actual pin12 on the chip) to be INPUT.
Then I use the analogRead command to quantify a voltage range.
But nothing seems to work. I have tried other pins as well.

I see that both the ATtiny84 and the ATmega328 (used in the Arduino) use 10bit ADCs, so my quantification should be the same.
(I used the arduino to test-drive my sketch-code first)

Any ideas on that? :-/

Osgeld, you can use the MOSI, MISO, SCK pins for I/O as well as programming.

I know you can but I would imagine it would be a major PITA during development to hook up the progammer, program, unhook and reconnect the circuit, OH crap my timing is wrong let me fix that real quick ...

;D

maybe I just need to get better at programming lol

You dont have to set the pinmode for analogread.
To read pin 12 (pa1) you have to use analogRead(1);
PA1 = 1
PA7 = 7

PA0 pin 13 is the aref, don't use this pin, it doesn't have internal pull-up enabled, and can destroy stuff. And i know, i have killed 4-5 leds on this pin when i was making the core, trail and error ;D

I havent had the chance to sit down and play with your new revision, is there anything different aside from 18 compatibility?

asking cause I have it all setup and working great from your last version, and wondering if I would benefit by upgrading (in mid project, been using your older version for a few weeks now)

SuperCow (like the new avatar btw),

I did as you said, removed the pinMode line and used analogRead(1)
for PA1 (also tried 2, for PA2) and fed the voltage at pin12 (and pin11 also).

Damn code doesn't seem to care! Stil NO-GO for the analogRead command!
The code itself is quite simple as far as analogReading goes.

Could it be a bug elsewhere?
Could it be I am so stupid I am overlooking something trivial?
:-/

Also, how does the AVG discriminate between pin1 as digital pin (physical chip pin3, PB1)
and pin1 as an analog pin1 (physical pin12, PA1)?
:question

My bad!
I was leaving the AREF pin unconected. Thought there was an internal 5V supply (wasn't there?).

But my last question stands...

S.C. Thanks again for a greatly needed attiny core. Not quite working for me yet though.

I did a fresh arduino-018 install and downloaded the attiny84-03 core. did not make any other changes - correct?

when I try to do a sketch download (or burn the "bootloader") I get a message saying the device signature is incorrect(shows as 0's).

Binary sketch size: 818 bytes (of a 8192 byte maximum)

avrdude: please define PAGEL and BS2 signals in the configuration file for part ATtiny84
avrdude: Yikes!  Invalid device signature.
         Double check connections and try again, or use -F to override
         this check.

Looking at the verbose output below it seems to me that the arduinoisp code is responding but the attiny84 is not. I've double checked all the connections and they look right. disconnecting sck, miso, or mosi all give the same error. disconnecting reset gives a different error. Any thoughts?

Binary sketch size: 818 bytes (of a 8192 byte maximum)
C:\Users\Bill\Desktop\parents 2009 taxes\arduino-0018\arduino-0018\hardware/tools/avr/bin/avrdude -CC:\Users\Bill\Desktop\parents 2009 taxes\arduino-0018\arduino-0018\hardware/tools/avr/etc/avrdude.conf -v -v -v -v -pattiny84 -cstk500v1 -P\\.\COM1 -b19200 -Uflash:w:C:\Users\Bill\AppData\Local\Temp\build5363555325787943731.tmp\tiny84mule.cpp.hex:i 


avrdude: Version 5.4-arduino, compiled on Oct 11 2007 at 19:12:32
         Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/

         System wide configuration file is "C:\Users\Bill\Desktop\parents 2009 taxes\arduino-0018\arduino-0018\hardware/tools/avr/etc/avrdude.conf"

         Using Port            : \\.\COM1
         Using Programmer      : stk500v1
         Overriding Baud Rate  : 19200
avrdude: ser_open(): setting dtr
avrdude: Send: 0 [30]   [20] 
avrdude: Send: 0 [30]   [20] 
avrdude: Send: 0 [30]   [20] 
avrdude: Recv: 
avrdude: Recv: 
         AVR Part              : ATtiny84
         Chip Erase delay      : 4500 us
         PAGEL                 : P00
         BS2                   : P00
         RESET disposition     : possible i/o
         RETRY pulse           : SCK
         serial program mode   : yes
         parallel program mode : yes
         Timeout               : 200
         StabDelay             : 100
         CmdexeDelay           : 25
         SyncLoops             : 32
         ByteDelay             : 0
         PollIndex             : 3
         PollValue             : 0x53
         Memory Detail         :

                                  Block Poll               Page                       Polled
           Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
           ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
           eeprom        65     6     4    0 no        512    4      0  4000  4500 0xff 0xff
                                  Block Poll               Page                       Polled
           Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
           ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
           flash         65     6    32    0 yes      8192   64    128  4500  4500 0xff 0xff
                                  Block Poll               Page                       Polled
           Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
           ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
           signature      0     0     0    0 no          3    0      0     0     0 0x00 0x00
                                  Block Poll               Page                       Polled
           Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
           ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
           lock           0     0     0    0 no          1    0      0  9000  9000 0x00 0x00
                                  Block Poll               Page                       Polled
           Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
           ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
           lfuse          0     0     0    0 no          1    0      0  9000  9000 0x00 0x00
                                  Block Poll               Page                       Polled
           Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
           ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
           hfuse          0     0     0    0 no          1    0      0  9000  9000 0x00 0x00
                                  Block Poll               Page                       Polled
           Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
           ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
           efuse          0     0     0    0 no          1    0      0  9000  9000 0x00 0x00
                                  Block Poll               Page                       Polled
           Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
           ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
           calibration    0     0     0    0 no          1    0      0     0     0 0x00 0x00

         Programmer Type : STK500
         Description     : Atmel STK500 Version 1.x firmware
avrdude: Send: A [41] . [80]   [20] 
avrdude: Recv: 
avrdude: Recv: 
avrdude: Recv: 
avrdude: Send: A [41] . [81]   [20] 
avrdude: Recv: 
avrdude: Recv: 
avrdude: Recv: 
avrdude: Send: A [41] . [82]   [20] 
avrdude: Recv: 
avrdude: Recv: 
avrdude: Recv: 
avrdude: Send: A [41] . [98]   [20] 
avrdude: Recv: 
avrdude: Recv: 
avrdude: Recv: 
         Hardware Version: 2
         Firmware Version: 1.18
         Topcard         : Unknown
avrdude: Send: A [41] . [84]   [20] 
avrdude: Recv: 
avrdude: Recv: 
avrdude: Recv: 
avrdude: Send: A [41] . [85]   [20] 
avrdude: Recv: 
avrdude: Recv: 
avrdude: Recv: 
avrdude: Send: A [41] . [86]   [20] 
avrdude: Recv: 
avrdude: Recv: 
avrdude: Recv: 
avrdude: Send: A [41] . [87]   [20] 
avrdude: Recv: 
avrdude: Recv: 
avrdude: Recv: 
avrdude: Send: A [41] . [89]   [20] 
avrdude: Recv: 
avrdude: Recv: 
avrdude: Recv: 
         Vtarget         : 0.0 V
         Varef           : 0.0 V
         Oscillator      : Off
         SCK period      : 0.1 us

avrdude: Send: A [41] . [81]   [20] 
avrdude: Recv: 
avrdude: Recv: 
avrdude: Recv: 
avrdude: Send: A [41] . [82]   [20] 
avrdude: Recv: 
avrdude: Recv: 
avrdude: Recv: 
avrdude: Send: B [42] . [14] . [00] . [00] . [01] . [01] . [01] . [01] . [03] . [ff] . [ff] . [ff] . [ff] . [00] @ [40] . [02] . [00] . [00] . [00]   [20] . [00]   [20] 
avrdude: Recv: 
avrdude: Recv: 
avrdude: please define PAGEL and BS2 signals in the configuration file for part ATtiny84
avrdude: Send: P [50]   [20] 
avrdude: Recv: 
avrdude: Recv: 
avrdude: AVR device initialized and ready to accept instructions

Reading | avrdude: Send: u [75]   [20] 
avrdude: Recv: 
################################################## | 100% 0.05s

avrdude: Device signature = 0x000000
avrdude: Yikes!  Invalid device signature.
         Double check connections and try again, or use -F to override
         this check.

avrdude: Send: Q [51]   [20] 
avrdude: Recv: 
avrdude: Recv: 

avrdude done.  Thank you.

BillGeo On the analog is a small error that will be fixed on the next release.
You can do this: analogReference(0); in setup.
This will use the internal aref. Now its indeed on external.

bill2009, do you use a 10K resistor parallel on the reset?

As you can see on the breadbord, the reset line (pin 1 on a atmega168) is hook on a resistor and the other side of the resistor has 5V. The green line is the reset to the arduinoISP.

bill2009, do you use a 10K resistor parallel on the reset?

yes sir, brown-black-ORANGE from pin 4 of the attiny84 to ground and pin 4 goes to 10 of the driver. i'll see if i have another chip i can try to program.

Damn!
I seem to be geting the same error as Bill2009 does.

avrdude: please define PAGEL and BS2 signals in the configuration file for part ATtiny84
avrdude: Yikes!  Invalid device signature.
         Double check connections and try again, or use -F to override
         this check.

BTW, pin4 (RESETpin) on the ATtiny84, is supposed to be kept high (via the 10k resistor).
OK, so if it's set low the program should reset... right?
I manually tie it to ground... and there is no reset of the program!

What't going on...

I'm going to delve into this! :smiley:

BTW, pin4 (RESETpin) on the ATtiny84, is supposed to be kept high (via the 10k resistor).
OK, so if it's set low the program should reset... right?
I manually tie it to ground... and there is no reset of the program!

that would reset the program running in the attiny84 - but there isn't one is there?