Pages: 1 ... 4 5 [6] 7 8 ... 19   Go Down
Author Topic: LumiNet (based on attiny84)  (Read 57812 times)
0 Members and 1 Guest are viewing this topic.
0
Offline Offline
God Member
*****
Karma: 1
Posts: 588
LumiNet rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

sounds easy. I can have a look at the servo lib. The servo signals need a special timing. The routines must be adjusted to different system clocks I guess. No big problem.

Do you want to develop a need board that has servo drivers and IR onboard?
Logged


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

That would be great a working servo libary for the attiny smiley

As for development, i'm going to use the breadboard first ofcouse.
(ive already done it with a normal arduino)

Then im going to solder it on a experimenters board.
Im trying to make within 4.5 by 3 cm or smaller.
The servos and ir-receiver are connected with wire.

This is the code i use for the IR http://www.rjw.speedxs.nl/arduino/lego_reciver.pde
With the ladyada motor schild to drive motor's


Instead of lego motor's im going to drive servo motor's on the same protocol.
Thats why size matters, it has to fit in a lego block  ;D
« Last Edit: August 06, 2009, 11:44:56 am by SuperCow » Logged

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

I have placed a order for the attinys and rest of the components
I am exited to test it.

To get it running on 8mhz, i have to remove the "Divide clock by 8 internally; [CKDIV8=0]" in the fuses?

Also i noticed you have disabled the brown-out detection.
All arduino fuses have it enabled. Is there a reason for it?
Logged

Offline Offline
Jr. Member
**
Karma: 2
Posts: 85
(╯°□°)╯︵ ┻━┻
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Yeah, you should remove that.. Took me some days to realize that this option made my Single Chip Arduino's timings go crazy!!! ;D

Of course you must select the 8mhz clock setting, which is selected by default! smiley-razz
Logged

0
Offline Offline
God Member
*****
Karma: 1
Posts: 588
LumiNet rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Yes, LumiNet nodes run at 8MHz.
You can also change the clockspeed at runtime in the setup() function. In order to run the attiny84 at 8MHz you can use this piece of code:
Code:
cli();
CLKPR = (1 << CLKPCE);//INITIALIZE CLOCK CHANGE
CLKPR = 0x00;//NO PRESCALER
You can find more information in my diplom thesis (on the LumiNet homepage) at page 66.

I don't use brown-out detection on LumiNet nodes... I don't need it, but of course you can activate it if you wish to... should make no difference for most applications.

I will have a look at the servo lib soon.
Logged


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

ok, I'm finally ready to build something with the attiny84 support.  A couple of questions:
1) I understand the arduino pin assignments as follows:
ATTINY pin 2 is arduino digital 3
ATTINY pin 3 is arduino digital 2
ATTINY pin 4 is arduino digital 11 (also the attiny's reset)
ATTINY pin 5 is arduino digital 1
ATTINY pin 6 is arduino digital 0
ATTINY pin 7 is arduino digital 10
ATTINY pin 8 is arduino digital 9
ATTINY pin 9 is arduino digital 8
ATTINY pin 10 is arduino digital 7
ATTINY pin 11 is arduino digital 6
ATTINY pin 12 is arduino digital 5
ATTINY pin 13 is arduino digital 4
2) I need two external interrupts
- Pin 5 of the attiny84 is labeled INT0, does that correspond to arduino interrupt 0?
- Can I use the pin change interrupt support for my other interrupt - say on the attiny84's pin 13?
3) I need one analogRead - does this work and which pin is Analog 0?  I looked in wiring_analog.c but it's not obvious.

Thanks for the help
Logged

Bill Rowe
Olduino - An Arduino for the First of Us
www.olduino.wordpress.com

0
Offline Offline
God Member
*****
Karma: 1
Posts: 588
LumiNet rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

You can see the pin mapping in the hardware/cores/luminet folder - in the file pins_arduino.c

Code:
// Luminet board
//                *   *
//                D0  D1
//            VCC PA7 PB2 GND
//             |   |   |   |
//             |   |   |   |
//    VCC---                   ---VCC
//D7  PA3---                   ---PB1  D2
//D6  PA2---                   ---PB0  D3
//    GND---                   ---GND
//             |   |   |   |
//             |   |   |   |
//            VCC PA1 PA0 GND
//                D5  D4
//
// red   led:   PA4 (d8) -- pin available if jumper is not connected
// green led: * PA5 (d9)  -- pin available if jumper is not connected
// blue  led: * PA6 (d10)  -- pin available if jumper is not connected
// reset:       PB3 (d11)

The attiny pin depends on your ic size. The following table might make the mapping more clear:
Arduino Pin #tiny84 pin name
0PA7
1PB2
2PB1
3PB0
4PA0
5PA1
6PA2
7PA3
8PA4 -- red led
9PA5 -- green led
10PA6 -- blue led
(11)(PB3) -- reset
Logged


0
Offline Offline
God Member
*****
Karma: 1
Posts: 588
LumiNet rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Analog Pin 0 is PA0 (this is Arduino Pin # 4 corresponding to the table above).
So analogRead(0) reads the analog value from PA0.


pin change interrupts are not supported at the moment (only for attiny2313), but I can add this within minutes if you really need it. You can find the code  for the interrupt handling in the file WInterrupts.c in your hardware/cores/luminet folder.

Using pins other than INT0 or INT1 for pin change interrupts is not supported by any Arduino hardware at the moment, I guess. But I can add this if you are sure whar you are doing. INT0 and INT1 are far better than the interrupts on the other pins.
« Last Edit: August 17, 2009, 07:27:58 pm by bohne » Logged


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

Quote
The following table might make the mapping more clear:Arduino Pin #  tiny84 pin name  
0  PA7  
1  PB2  
2  PB1  
3  PB0  
4  PA0  
5  PA1  
6  PA2  
7  PA3  
8  PA4 -- red led  
9  PA5 -- green led  
10  PA6 -- blue led  
(11)  (PB3) -- reset  
Ok that helps a lot.

Quote
Analog Pin 0 is PA0 (this is Arduino Pin # 4 corresponding to the table above).
So analogRead(0) reads the analog value from PA0.
OK that's great.

Quote
pin change interrupts are not supported at the moment (only for attiny2313), but I can add this within minutes if you really need it. You can find the code  for the interrupt handling in the file WInterrupts.c in your hardware/cores/luminet folder.

Using pins other than INT0 or INT1 for pin change interrupts is not supported by any Arduino hardware at the moment, I guess. But I can add this if you are sure whar you are doing. INT0 and INT1 are far better than the interrupts on the other pins.
I'd like to use int0 and int1 but i only see int0 on the pinouts - am I missing something?  I just need to be able to respond to pulses from two different sources.

Logged

Bill Rowe
Olduino - An Arduino for the First of Us
www.olduino.wordpress.com

Toronto, Canada
Offline Offline
Full Member
***
Karma: 0
Posts: 144
Arduino rocks
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
I'd like to use int0 and int1 but i only see int0 on the pinouts - am I missing something?  I just need to be able to respond to pulses from two different sources

Yeah, I had the same problem. I need to count pulses from encoders so I need at least 2 interrupts. I decided to go for a tiny2313, but it looks it was a big mistake, since the code doesn't fit in the tiny 2k flash... Now I redesigned the board and I'll go for tiny861 that has 2 interrupts, TWI and enough space for the code. All I need now is to figure out how to change the tiny84 and tiny2313 files for tiny861. I could ask bohne nicely, but I'd like to try it out myself first. But I think this tiny might work for your project too.
Logged


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

Quote
Yeah, I had the same problem. I need to count pulses from encoders so I need at least 2 interrupts.
Did you think about using the pin change interrupts?  It doesn't look THAT hard.

the attiny861 does look like it would do everything I need but now we're up to 20 pins and another new, non-standard chip(which I don't have one of anyway!).  For the moment I'm going to keep plugging at the 84 and if I can't make that work I'll just have to squeeze in a 168/328.  I don't think I could fit in the 2313 either.

I must say, as I go through this process, I'm impressed with the design of the 8/168/328 chips and their selection for the arduino.  It really does seem to be a sweet-spot for small-ish size with lots of function built in.
Logged

Bill Rowe
Olduino - An Arduino for the First of Us
www.olduino.wordpress.com

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

Hi,

This is very interesting topic and I'm trying to study this.

I got my small program working fine with arduino. Now I would like to put it ti attiny 2313. I have downloaded all the software from luminet.

I still don't understand how do I put my 'blink' program to attiny 2313. Is is possible if somebody can explain step by step how to do it and make the LED blink.

I have

- modified arduino diecimila which can program bootloader to itself using bitbang.
- attiny 2313 chip
- all the basic electonic components

Is is possible to put the 'blink' to attiny with this available HW?
Logged

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

ive got my attinys, only i dont get it to work.
I have successfully uploaded the sensor bootloader.
Only i can not upload sketches on pin 6&7

Im using a usb to ttl cable. Hooking the tx/rx to the tiny and using the auto reset with a 100n cap.

There 3 bootloaders, there the confusion start (maybe a idea to release a standalone version)

What bootloader do i need? i want to use the bootloader to upload sketches. I and i have to recompile it for 8mhz?

Looking to the pins_arduino, there is nothing on the digital_pin_to_timer ? thats for pwm?

When i get blink to work im very happy, then i can look to interrup for my ir-sensor smiley-grin
And if that is done, its the servo-motor haha

Logged

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

Ive tried to upload the blink with the icsp.
Uploading going fine, but no blink

ive tried pin 0 and 4.
I have put a multimeter on all pins of the tiny, nothing is high

Also i changed the arduino_pins there only 11 usable pins, your have much more, so i changed it to 11 and put it in a nice order, but still does not work
Logged

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

i have successfully compiled a "blink" for the attiny84 then loaded it with avrdude and an icsp type programmer.

the attiny had only power, ground, the programming pins and a led hooked up.

there is no bootloader used, just the bare ivr.  i was not able to get the ide to do the upload but that may have been my homebrew programmer.  i get the impression that the ide will happily drive a programmer - the bootloader emulates one of the protocols that's used by the programmers.

I also believe there are bootloaders for the attiny's but i don't have one.
Logged

Bill Rowe
Olduino - An Arduino for the First of Us
www.olduino.wordpress.com

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