Show Posts
Pages: 1 2 [3] 4 5 ... 10
31  Forum 2005-2010 (read only) / Development / Re: Tiny - Oscillator or Crystal? on: September 23, 2010, 09:49:50 pm
Internal, 8MHz. At least, that's what I'm planning to use.
32  Forum 2005-2010 (read only) / Development / Re: Which Tiny? on: September 24, 2010, 06:28:02 am
I have Tiny 84, 85, 861, 2313.
33  Forum 2005-2010 (read only) / Development / Re: Arduino IDE with ATTiny45 (porting) on: November 06, 2009, 07:12:16 am
I have played with tinys and I have ported a C library for USI TWI to Arduino. I didn't test it yet, as I can't program the tiny861 from Arduino and I don't use the AVR Studio. I posted the lib in this thread:, but since then I made some corrections and tried to add that user function, but something is missing and I can't figure out what. Also, I got the pin change interrupts working if you're interested but I also need the analog pins to work. I am working on a VU-meter based on tiny861 to act as a mouth for my robot but also use the twi to trigger other cool effects.
34  Forum 2005-2010 (read only) / Development / Re: USI TWI Slave library for all ATtinys on: November 06, 2009, 07:26:01 am
Here is the latest version but the user function still doesn't compile properly. I can't figure out what I'm doing wrong, please let me know if anyone can fix this for me. Thanks.
35  Forum 2005-2010 (read only) / Development / Re: USI TWI Slave library for all ATtinys on: November 04, 2009, 08:48:49 pm
I don't know where your errors come from... Perhaps wrong board? Don't forget, you need to set up a new board that uses a tiny and mod some core files. I still don't have a working lib yet, since I was trying to implement that bytes_arrived_event function that is missing something and it would not compile properly. For the moment, I have focussed on another project, this lib is a bit under the table until I'm done. I have a deadline for the current project on Nov 22nd. After that, we'll see what happens... I will probably need some help making the lib work with an OnRequest and OnReceive functions.
36  Forum 2005-2010 (read only) / Development / Re: USI TWI Slave library for all ATtinys on: October 01, 2009, 05:48:42 pm
Frank, thank you very much for your suggestions!

Firstly, I did not write the defines like that, just left them in place how I found them in the original library. Same thing for the circular buffer. All I did was to rename the functions to be consistent with the Arduino class style. At each compilation I was getting errors that I corrected one by one until I got the proper result. That was all I could make, as I don't know much programming yet. I'll try to fiddle with your suggestions and see if I can make it work. I will be very happy if I can make this lib act like the original Wire lib so there is not much of a difference. I still don't understand completely how to make that slave behavior when the master asks for data. But I'll try.

If you have more suggestions, please let me know!
37  Forum 2005-2010 (read only) / Development / USI TWI Slave library for all ATtinys on: September 30, 2009, 11:29:25 pm
Hi all, I've got my hands on a library created by Donald R. Blake and I have modified it to comply with the Arduino library sintax. It supports all tinys and some megas that have USI instead of TWI. It's intended purpose is to create a Slave device using a tiny microcontroller.

The library works just like the Serial library and has the similar commands:
usiTwiSlave::begin(address), available(bool), read(), write(byte), flush().

If someone more experienced than me can modify the library so we can create an event when there is something available in the buffer, please do so, I would really love to have this feature.


Get the zip file here:
38  Forum 2005-2010 (read only) / Troubleshooting / Re: Stk500 protocol error on: December 28, 2007, 01:49:49 am
Yes. Mea culpa. Thank you for reply.

I am using WinXP, Arduino-0010, uisp and avrdude are from the Tools\avr\bin folder.

The board is custom made serial single side Arduino. It is a prototype for a robot board, so it is done on Veroboard with wrapping wire, except for the power bus that is thicker. I espect to have a PCB made, but test must be done first.

I could never program the bootloader from the Arduino IDE, just using the burnpara.bat file in the bootloaders\atmega8 folder. I have edited the file to use stk200 instead of the dapa programmer after the first error came up.

Before the first bootloader programming, I could see the fuse bits settings in Bascom-AVR, but not since I've used the uisp program. I have tryed the -v=4 --rd_fuses settings with uisp to check fuses in verbose mode and it seems that uisp doesnt care if the signature is ok or not, it asumes it is a valid mega8. Funny thing is it allows me to upload code, change fuses and all, but the mega8 does not work properly with other loaders, including stk500 serial, avrdude and bascom using stk200. I need to get the serial uploading work so I can do it using a BlueSmirf module (the bluetooth link works, I have tested it with my other mcu - Nemesis).

The nest thing that I will try to do is use a fresh install of winxp, without any bluetooth, antivirus or other stuff going in the background. Unfortunately I don't have a new mega8 (I wish I can get a mega168...). I will use a breadboard to make the basic circuit with connections just for the SPI and serial.

If someone has a better idea, please let me know.
39  Forum 2005-2010 (read only) / Troubleshooting / Stk500 protocol error on: December 27, 2007, 06:18:36 pm
I have built a robot using a ATmega8. I have succesfully burned the mega8 bootloader using the dapa programmer. Then I got this error trying to upload the simple Blink sketch using serial cable and a ST232 level converter (which works for serial debugging with another mcu).  Here is the error:

Binary sketch size: 864 bytes (of a 7168 byte maximum)

avrdude: stk500_getsync(): not in sync: resp=0x00
avrdude: stk500_disable(): protocol error, expect=0x14, resp=0x51

When I reset the board, the LED on pin 13 blinks verry fast. After about 10 seconds blinks again (probably re-executes the bootloader). I have also reversed the Rx-Tx pins, same error happened.
The crystal that I am using is some old odd thing with a 16.000312MHz inscription (can this be the problem??).

Other odd thing: avrdude does not see the chip, it gives the 0xfffff signature, but uisp works with it using dapa or stk200 programmers. I could even restore the fuse settings to the ones in the datasheet but still not seen in avrdude. Re-burned the bootloader, same behaviour. Burned the Blink sketch using stk200 programmer, it works, but avrdude still does not see the chip... Re-burned the bootloader again, same error.

I ran out of options here, please let me know what to do with this chip. Should I get another one and throw this to the garbage?

Any help appreciated.
40  Forum 2005-2010 (read only) / Troubleshooting / Re: ping + servo... I'm missing something.... on: November 10, 2009, 05:28:50 pm
You don't need larger increments. I have it sweep 180 degrees one degree at a time, calculate the coordinates and show them on the display and it doesn't take more than 2 seconds to do a full 180 sweep. Take a look at my code and video here:
41  Forum 2005-2010 (read only) / Troubleshooting / Re: Another case of bootloader problem on: April 09, 2008, 05:54:19 am
I can set the high and low fuses with uisp, I can program the bootloader with it, but avrdude does not recognize the chip. Oh well, I'll wait another month or so untill I'll be able to buy a Diecimila loaded mega168.

Mean while, is there any possibility to change the avrdude with uisp in IDE? So that when I press the upload button the uisp loads the generated hex file into my chip? It would be a blast!

Thank you for your help!
42  Forum 2005-2010 (read only) / Troubleshooting / Another case of bootloader problem on: April 08, 2008, 03:43:55 pm
Hello all, I am a Bascom-AVR user (not very experienced...) and I wanted to start working with a C environment and Arduino looks like a good transition, since it is eazy to work with. I have a board made by me for a mobile robot a couple of years ago that uses ATmega8 and is Arduino compatible. I have a STK200 dongle that I am using with Bascom with no problems. I have also built the Parallel programmer from your website. Now here is the story:

I set the fuses to work with a 16MHz crystal in Bascom (using the STK200 dongle). Then I uploaded a simple Led Blink hex file and it worked great. I changed the dongle with the Parallel programmer and opened Arduino(v.10) and tryed to upload the bootloader for the ATmega8 (older board w/atmega8). It didn't work. After looking through the bootloader files, I have found a batch file with commands to burn the bootloader using uisp. I tryed the burnpara.bat file but it didn't work. I have opened a cmd window and read the uisp help file and found that I can use my STK200 dongle. I have changed the burnpara.bat file and it burned the bootloader. The LED started to flicker fast then a few seconds pause and repeat. I connected the serial dongle and tryed to upload the sample LED Blink sketch. It didn't work, saying wrong signature. Then I tryed to burn the blink.hex file using uisp. It worked. But no more bootloader... So I uploaded the bootloader again, verified corectly. But I still wasn't able to use the Arduino environment. Then I tryed with Bascom and surprise, it couldn't read the chip!!! Same thing like avrdude, device ID=ffffff... But I am able to use uisp to upload any hex file I made in Arduino!

Thinking that I will be better if I will get a ATmega168, I bought one and did the same as with the mega8! Set the fuses in Bascom, worked for a while with uisp to load the hex files since I was afraid not to loose this one too, then I wanted to try the bootloader again since it is a pain to click on the button to upload to the board, wait for the error message, go to a command window and upload using uisp... So, I changed the burnpara.bat file to work with atmega168 ant to write the corect values for the fuses as per instructions on your website (lock fuse to 0x3F, e=0x00, h=DD, l=0xFF and the lock fuse to 0x0F) and uploaded the ng bootloader. It verified corectly. But it happened the same thing as with the mega8, it didn't work from the Arduino environment and the chip doesn't give the corect signature again...

Reading the fuses with uisp I get this:
D:\Robotics\RoboProjects\Arduino\CDbot>uisp -dprog=stk200 -dpart=ATmega168 -dlpt=0x378 --rd_fuses
Atmel AVR ATmega168 is found.

Fuse Low Byte      = 0xff
Fuse High Byte     = 0xdd
Fuse Extended Byte = 0xff
Calibration Byte   = 0xbc  --  Read Only
Lock Bits          = 0xcf
    BLB12 -> 0
    BLB11 -> 0
    BLB02 -> 1
    BLB01 -> 1
      LB2 -> 1
      LB1 -> 1

So, the extended fuse is wrong. I can't see the signature fuse, but I suppose it is wrong too. I can modify all fuses except the extended fuse. This is the reason it still works with uisp (I guess). Is there any way to modify the fuses back to factory values? Reading the datasheet I get that they should be like this: e=0xF9, h=0xDF, l=0x62. The low and high fuses changed but the extended fuse is still 0xFF.

Any ideeas how to fix these 2 chips?
Any help is greatly appreciated!
Thanks in advance!
43  Forum 2005-2010 (read only) / Troubleshooting / Re: [FIXED] Problem burning bootloader on: April 08, 2008, 06:59:32 am
I have the same behaviour trying to burn the bootloader. Can you explain what was the board design error that you made? I also have a STK200 programmer that works with the uisp.

On a side note, what are the fuse settings for atmega168 using the same uisp commands?
44  Forum 2005-2010 (read only) / Development / Re: ATTiny85 port (work in progress) on: May 30, 2010, 05:11:40 pm
I want to use a Tiny45 for a tiny robot that uses 3 servos and 2 LDR sensors. For that I need the analog conversion to work and perhaps software servo, or I guess I'll just generate the servo pulses in my code, because the Servo library uses Timer1 that is 16bit in the mega, but 8 bit in the tiny. 8 bit PWM does not give a good enough resolution for servos.

So, I need to find out how to make it possible to compile and upload the sketches from the IDE (windows 7). I have tried in the past to port a Tiny861 but failed due to numerous libraries that do not work properly. I will be using a AVR ISP programmer to upload the sketches. Can someone point me what files I need to modify to make this work?

Thank you in advance.
45  Forum 2005-2010 (read only) / Development / Re: Arduino-ize the ATmega640 on: September 23, 2010, 09:47:04 pm
clock speed: 16MHz
status Led: PB6

Pages: 1 2 [3] 4 5 ... 10