Hi,
I have a ATtiny84 and I am using an Arduino UNO as the ISP programmer (Thanks Coding Badly for the updated TinyISP, that works with Arduino 1.0). Anyhow, I have programmed the chip with Blink sketch and all looks good, I get the flashing LED.
My next test is to see if I can output some serial text back to my laptop via the Arduino Serial Monitor so I can debug the stuff I develop.
I have downloaded and installed the attiny library and I am using the TinyDebugSerial to output a simple string in a loop every 1 second.
I have burned the bootloader to 8MHz and upload the simple sketch. When I connect the pin 2 - PB0 to pin 0 (rx) of the UNO, via a 220 ohms resistor, I see the TX led flicker every second, so I know the ATtiny84 is sending out my string, but the Arduino Serial Monitor show garbled data every second.
dear CB....
YOU GOT ME re the bad news...you are a baaaad mannnnn!....ive been researching using software serial to get an output from my T85 to the Ardy's serial monitor....but if you have good news for our brother in arms, here's my email address as well... hesynergy@gmail.com
you might try 4800 and 1200 for the serial rate in the serial monitor. If a different baud rate works it will give some info that we could use to help troubleshoot.
hesynergy:
dear CB.... YOU GOT ME re the bad news...you are a baaaad mannnnn!....
]
ive been researching using software serial to get an output from my T85 to the Ardy's serial monitor....but if you have good news for our brother in arms
Are you using an external clock with the ATtiny? The internal clock is not always accurate enough for serial communication, even at low baud rates.
Also, the SoftwareSerial library in Arduino 1.0 will work on the ATtiny, assuming you're running at 8 or 16 MHz (not 1 MHz). In case you want to try a different serial library.
I have connected up an ATtiny84 to an Uno using the high-low tech instructions for Arduino 1.0. I have no other wires connecting the two other than MISO MOSI, SCK, RESET, VCC and GROUND. I can upload simple code that reads a photosensor and a pushbutton and I can light LEDs and switch relays. What I can't get working is serial comms. I've tried various pins to no avail.
Do I need to add more wires? Where? I am a real beginner and would appreciate any help. Thanks in advance.
I only want to send information back to my PC for debugging purposes. I am not getting anything at all on the serial monitor, just a blank window. Thanks.
CodingBadly's tiny core has no problem providing serial output on the tiny84--at least for me at 1MHz and 8MHz using the internal clock and a 38400 baud rate. The trick is using the correct pin. On Speeds less than or equal to 8MHz use pin 2, at 16MHz use pin 13. Since it is bit banged serial, I don't think it will work at speeds other than those three.
wanderson:
CodingBadly's tiny core has no problem providing serial output on the tiny84--at least for me at 1MHz and 8MHz using the internal clock and a 38400 baud rate. The trick is using the correct pin. On Speeds less than or equal to 8MHz use pin 2, at 16MHz use pin 13. Since it is bit banged serial, I don't think it will work at speeds other than those three.
He used the same pin as used if a xtal is hooked up to the chip for slower speeds, and since faster speeds need a crystal in most of the tiny's he had to switch the pin for those speeds. If you wanted to change the core code provided in the tiny libraries you could make any pin the default serial output.