Go Down

Topic: ATtiny84 and TinyDebugSerial shows garbled text.... (Read 6898 times) previous topic - next topic

winneymj

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.

Anyone have any ideas?

Thanks
Mark


winneymj


Coding Badly


I have bad news and I have good news.

First the bad news.  I just can't get motivated to help you with what you are trying to do.  I'm afraid you may be on your own.

Now for the good news.  I have something available that works far better.  If you're interested, send me a Personal Message with an email address.

(Just kidding on the bad news.  If you REALLY want help with what you're attempting, just let me know.)

hesynergy



I have bad news and I have good news.

First the bad news.  I just can't get motivated to help you with what you are trying to do.  I'm afraid you may be on your own.

Now for the good news.  I have something available that works far better.  If you're interested, send me a Personal Message with an email address.

(Just kidding on the bad news.  If you REALLY want help with what you're attempting, just let me know.)




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

kf2qd

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.

Coding Badly

dear CB.... YOU GOT ME re the bad news...you are a baaaad mannnnn!....


]:D

Quote
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


What are you using for a programmer?

What is the target?  ATtiny84?

mellis

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.

phreddsmytthe

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.

Coding Badly


Do you need serial output (e.g. sending data to a sensor) or do you need something for debugging purposes?

phreddsmytthe

#10
Jun 01, 2012, 03:14 pm Last Edit: Jun 01, 2012, 04:29 pm by Phredd Reason: 1
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.

Coding Badly

I only want to send information back to my PC for debugging purposes.


Check your Personal Messages.

izik

I would also like to get information onto my Serial Monitor from a Tiny

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.

bperrybap


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.


For bit banging, why would the pin used matter?

Go Up