Pages: 1 ... 12 13 [14] 15 16 ... 19   Go Down
Author Topic: LumiNet (based on attiny84)  (Read 54788 times)
0 Members and 1 Guest are viewing this topic.
0
Offline Offline
Newbie
*
Karma: 0
Posts: 22
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

It's nice to see that the Attiny84 gets attention.
It's a mCU that is suitable in many projects, and quite full-futured too.

I am currently having problems with mine.

For starters, I downloaded the Bohne-moded Arduino IDE... and it does not run!
Yea, double-clicking on "arduino.exe" yields a hourglass cursor for 3-4 secs, and then nothing.
Any ideas???

The idea is to use the modified IDE to "port" my 00018 standard-IDE sketch.
I intend to take the compiled .hex file outputted by the modified IDE and use avrdude
to flash it directly yo the attiny84 chip as shown here: http://jimsmindtank.com/using-the-arduinoisp-sketch-part-2/

By the way, I am using an arduino with the ISP sketch in it.
It's supposed to function as an avrisp programmer.

Hardware-wise, only the MOSI, MISO, SCK, RESET and Vcc/GND pins are connected to the Attiny84, is that OK?
I'd like to use the internal 8MHz clock.

Will that work? What fuses will need changing? And how do I do it???

Also it would be nice to also burn an Arduino compatible bootloader to the 84
so all future sketch uploads can be done via USB (and FTDI chip or cable).
Is such a bootloader available? I only see LumiNet bootloaders for the 84
in the modified IDE subdirectories.


I guess the first thing to be addressed is the modified-IDE-not-running issue.
 :-/

Sorry for the long an newbie post, and thank you in advance for your help.
 smiley-grin

Logged

ottawa, canada
Offline Offline
God Member
*****
Karma: 6
Posts: 990
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

try running the attiny84 core files in the regular ide.
Logged

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

Will do that and report back.

Meanwhile I tried just reading the fuses from a "factory new" ATtiny84,
using an Arduino (with the ISP sketch), and avrdude (that was in the WINavr package),
but to no avail. No luck.

Other details include:
+VCC = 5V from the Arduino board
MOSI, MISO, RESET, SCK to pins 7, 8, 4, 9 of the t84 (DIP14 package), through 10K resistors.
12Mhz Crystal at pins 2 and 3, an then two 22pF capacitors to ground.

avrdude command is as follows:
avrdude -c arduino -p t84 -P COM9 -U hfuse:r:high.txt -U lfuse:r:low.txt

(also tried using other programmers for the -c option, like avrisp, STK500 etc.)

What is wrong with the above setup?!
WTF?!?! :o

Anyway, I am at a dead end with the avrdude approach,
so I'm going to try using the t84 core with the original 000018 IDE.
« Last Edit: June 02, 2010, 01:21:10 pm by BillGeo » Logged

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

No luck either.

I followed the instructions found HERE but NO-GO!!!

But even if I can compile a valid attiny84 .hex file, how am I supposed to
upload it to the mCU if I cant get the Arduino-ISP to work with it?
Logged

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

Billgeo, im am updating my attiny84 core to the 0018 version.

I will have it soon ready, the old one will not work in 0018
Logged

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

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?

 :-/
Logged

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

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

Code:
                    +-\/-+
               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 smiley
remember when you want to upload to a normal arduino, you have to change the preference file again to bootloader


« Last Edit: June 02, 2010, 07:17:33 pm by SuperCow » Logged

ottawa, canada
Offline Offline
God Member
*****
Karma: 6
Posts: 990
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

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

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

« Last Edit: June 02, 2010, 06:51:35 pm by SuperCow » Logged

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

sweet, thank you!
Logged


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

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?  :smiley
Logged

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

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

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

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


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

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? :-/
Logged

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

Quote
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
« Last Edit: June 03, 2010, 05:35:37 pm by Osgeld » Logged


Pages: 1 ... 12 13 [14] 15 16 ... 19   Go Up
Jump to: