ATTiny85 TinyDebugSerial ÿÿÿþÿÿÿÿüÿÿÿÿÿÿÿÿ

Hi there,

Everytime I get this mess coming through the Serial Monitor. I don't understand where I could have gone wrong. I have gone over this tutorial a thousand times, and I get a perfect working project.

When it comes to writing my own projects, they also work fine. I just can't get any readable communication from my chip! I have hooked it up I believe correctly for gathering output:

Im using an UNO.

10 uF capacitor between Reset and GND.
PB3 wired to RX.

I just don't get it! I have looked on quite a few places for information about it before posting here. I have 6 ATTiny85s, they all produce the same result, regardless of burning bootloaders.

Edit:
For the Answer to this problem please refer to the instructional posts numbered #14 and #18
Thanks again Erni!

That Looks like a different language... Usually the one spoken when the serial monitor and the controller don't match...
Had you taken the time to read and follow the "Suggestions" contained at the top of the forum page, You might have come away with more than a guess..
Can You.. Guess the reason? Why. (Just in case... http://arduino.cc/forum/index.php/topic,149016.0.html It's This One...)

Doc

OK, so how am I going wrong with the communication between the two devices?

Looks like a baud rate mismatch. Do you have the serial monitor baud matching the sketch coding? If so, are you sure on the clock speed of the ATTiny85? Maybe the fuses?

I have a simple sketch uploaded to the ATTiny85, either burnt bootloaders of 8MHz or 1MHz:

void setup() {
Serial.begin(9600);
}

void loop() {
delay(1000);
Serial.println("hola mundo");
}

I open the serial monitor and connect the readout, and again i get pulses of garbage.

Try the various baud settings in serial monitor (starting with 9600*2 and 9600/2) to see if one works. The device may be fused to operate at a different clock speed than what your core thinks.

-br

þþþþþþþþþþþþþþþþþþþ - 4800
ÿÿÿÿÿÿÿÿøÿÿÿÿÿÿÿÿÿÿ - 9600
Nothing - 19200

SadamHu:
I have a simple sketch uploaded to the ATTiny85, either burnt bootloaders of 8MHz or 1MHz:

void setup() {
Serial.begin(9600);
}

void loop() {
delay(1000);
Serial.println("hola mundo");
}

I open the serial monitor and connect the readout, and again i get pulses of garbage.

What kind of board did you set the arduino IDE to? This is where clock confusion can come in. Are you sure the fuse bits are being set correctly, are you able to read them back and verify them? Try running the standard blink program and see how fast the LED blinks. This will be a dead giveaway if there is a clock mismatch.

ok, I see now, the timing is out. I uploaded blink to both the arduino and the tiny. then powered them up at the same time. They slowly go in and out of sync.

how do I "read them back and verify them?"?

Is this the next step I have to take?

I dont have an Oscilloscope $$$

Also, how many times can I "burn bootloader" before the chip is stuffed? Could that be causing the issue?

Theese ÿ means -1 or nothing received.

If you want to use TinyDebugSerial you will need a Serial/usb converter.
You can use your Arduino UNO, see this Communication with Tiny's

BTW, are you using this core ?:

https://code.google.com/p/arduino-tiny/

Thank you Erni, I found your page before posting and gave that a good test. This is how I recieve these characters. I found a previous post before where you were commenting on about these characters. In the end the poster decided to use knock. And was able to debug and recieve messages that way. I hope to find the cause and solution to this problem and have logged here for future reference. Im glad you have seen my post XD

Yes i am using that core

I have a capacitor between gnd and reset, should it just be a wire?

And yes pb3 to rx with 220 resistor

Still yyyyyy

If you don't have a scope, it's simple enough to try all the available baud rates to see if one works. The difference between the actual speed and 9600 will reveal something about the nature of the clock mismatch.

What fuse settings are you using, and how are you setting them?

-br

I have a capacitor between gnd and reset, should it just be a wire?

Yes just a wire, it keeps the Atmega in constant reset.

The alternative is to remove the chip from the UNO, but I find that too risky.

SadamHu:
ok, I see now, the timing is out. I uploaded blink to both the arduino and the tiny. then powered them up at the same time. They slowly go in and out of sync.

If they slowly go in and out of sync, then it sounds like they are running at the "same" speed, one is just a bit faster. If the clock is off by 8 or 15MHz, the LED would blink way more slowly. It would be hugely obvious that one was twice as fast or even eight or sixteen times as fast. They wouldn't be close at all.

You can burn the bootloader til the cows come home before having a flash failure.

afremont:
What kind of board did you set the arduino IDE to? This is where clock confusion can come in. Are you sure the fuse bits are being set correctly, are you able to read them back and verify them? Try running the standard blink program and see how fast the LED blinks. This will be a dead giveaway if there is a clock mismatch.

I have tried both 8 and 1Mhz. How exactly do you read them back and verify them?

billroy:
If you don't have a scope, it's simple enough to try all the available baud rates to see if one works.

I have tried all the baud rates I still get the same garbage. It must have something to do with the internal oscillator not running at the correct speed? I read somewhere they can be anywhere up to 10% out from factory!!!

billroy:
What fuse settings are you using, and how are you setting them?

Here, let me show you all exactly how I set up my tinys. XD

SadamHu:
ok, I see now, the timing is out. I uploaded blink to both the arduino and the tiny. then powered them up at the same time. They slowly go in and out of sync.

how do I "read them back and verify them?"?

Is this the next step I have to take?

The internal oscillators are not very accurate. To improve the accuracy of the internal oscillator, you can change the OSCCAL register until a timed event (say flashing an LED every 1 second) actually results in a flash every 1 second. You could change for example the blink sketch by changing the OSCCAL value in setup:

OSCCAL = OSCCAL + 1;

Timing the flashes with a stop watch should tell you whether the oscillator is running fast or slow, increase the OSCCAL value more if it is slow, decrease it if too fast.

It seems as if the Tiny Tuner code varies the OSCCAL value to match the expected bit pattern of a serial transmission of the character 'x'. It is a good automatic procedure, but you need to hook up a serial line that transmits the expected value. Of course in your case what you really want to do is calibrate the oscillator to give reliable serial transmissions, so the Tiny Tuner is probably the most appropriate method for your situation.

Christo:
Of course in your case what you really want to do is calibrate the oscillator to give reliable serial transmissions, so the Tiny Tuner is probably the most appropriate method for your situation.

I will certainly be giving this a go when I exhaust all other options, because I think its a simple fix. Apparently with a crossover wire from reset to ground. But when I do that I get nothing in the serial monitor

afremont:
If they slowly go in and out of sync, then it sounds like they are running at the "same" speed, one is just a bit faster. If the clock is off by 8 or 15MHz, the LED would blink way more slowly. It would be hugely obvious that one was twice as fast or even eight or sixteen times as fast. They wouldn't be close at all.

From what I'm seeing, it looks like the chips must be running at a decent speed. I just don't get why I'm getting messed up feedback at all different baud rates.

Erni:
Yes just a wire, it keeps the Atmega in constant reset.

The alternative is to remove the chip from the UNO, but I find that too risky.

I have tried a wire, and i get NOTHING in the serial monitor, the TX led also doesnt flash. If I remove the wire and leave it open the TX led begins to flash again! lol! I took out the chip and I couldn't get the com port to show up, but I think theres another reason it was doing that. I will try again without a chip in the arduino when I get some free time. But so far from what I have read from other people that have experienced this issue, they seem to use a wire from reset to gnd, or they use coding badly's knock library. I tried setting up his library, but I couldn't work out which was his latest version of TinyISP. I would totally use it if I could figure out which is the latest version, and how to install it. LOL!!!

Has anyone followed my tutorial? Thats how I setup the Tinys. Is this the correct way? Is there a step in there thats not right?

Here is a image of the results I get:

I will need to try out taking the chip from the arduino again, and test it that way. Have I wired it wrong? Why would the TX light not show up at all with a wire on reset and GND ? Ill have to purchase one of those usb-serial converters.

Thanks very much all of you for helping me out with this nooblike issue. I really appreciate it! :slight_smile:

I would try to remove all wires, except the ground, 5V and the connection from PB3 to TX on the Arduino, like the second picture here:

http://www.ernstc.dk/arduino/tinycom.html

Note that you should use PIN 1 on Arduino, marked TX->1

Normally I am not a big fan of Fritzing, but your pictures are very clear, +1

Ah yes! thats it! The whole time I was connecting the serial pin out to RX on the arduino! I'm sure I read somewhere to do that! Ah well nevermind. It is so good to finally be able to debug! Thank you so much Erni! +1

Glad to hear you got it working ! :smiley: