Go Down

Topic: TinyDebugSerial syntax (Read 8256 times) previous topic - next topic

Erni

Feb 09, 2012, 03:05 pm Last Edit: Feb 09, 2012, 03:11 pm by Erni Reason: 1
when debugging my attiny85 code i have been using SoftwareSerial to output the information.

However the TinyDebugSerial should use less memory so I am trying to use it, but I cant find any documentation or examples of how to use it.
I have tryed something like this

Code: [Select]

/*
TinyDebugSerial test
*/
TinyDebugSerial mySerial= TinyDebugSerial();
int val=78;
void setup() {                
}

void loop() {
 mySerial.write(val);
}


It compiles, but no output is written to the serial terminal ( I am using hyperterminal on a windows machine)
I assume that PB1 is the serial out (MISO)

A forum/google search give no useful result

I am using this core http://code.google.com/p/arduino-tiny/

dxw00d

A forum/google search give http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1285218245/15

Quote
Tiny Debug Serial has been added.  This is a small, very accurate, write only "software serial".  Obviously, it can be used for any serial communications but the intended purpose is to replace Serial for debugging.  Three baud rates are supported: 9600, 38400, and 115200 at two processor speeds: 8 MHz and 1 MHz.  The baud rate must be a constant: "Serial.begin(9600);" is OK; "Serial.begin(userselectedbaud);" is not.  Different combinations of baud rate and processor speed will produce different compile sizes.  If you're concerned with size, stick with 38400.  If you're concerned that the processor's clock is not accurate, stick with 9600.  On the '84 processor, the Serial transmit pin is PB0 / pin 0.  On the x5 processor, the Serial transmit pin is PB3 / pin 3.  Basically, the transmit pin is the first I/O pin in the upper-left corner.  If you'd like a baud / processor combination added please let me know.

Erni

Thanks dxw00d
I don't know how I missed that, now it works.
But I have to figure ot how I can output numbers, this out N, the ASCII value of 78

Code: [Select]
/*
TinyDebugSerial test
*/

uint8_t val=78;
void setup() {               
Serial.begin(9600);
}

void loop() {
Serial.write(val);
Serial.write(" Loop\n");

}



dxw00d

Normally, I'd use Serial.print().

Erni

dxw00d you have saved my day, Serial.print() did the job, thanks

hesynergy


dxw00d you have saved my day, Serial.print() did the job, thanks


So Erni,

I thought you could use the arduino IDE's serial monitor....you are not?

I thought that tiny serial was one way, so hooking up physical pin 1 on the t85 as rx connecting to the Arduino(UNO in my case) and gnd to gnd, and reset to gnd on the UNO wools do the trick.

How are you doing it? Could you take a pix and post the hookup here please?

Btw does this hookup work for both tiny tuner and tinydebug serial, or ami mixing my metaphors

Thanks,

chas

Erni

#6
Jun 01, 2012, 08:43 pm Last Edit: Jun 01, 2012, 08:49 pm by Erni Reason: 1
hesynergy

The Output pin when using TinyDebugSerial is PB3 (the pin below the reset pin :))
Quote

On the x5 processor, the Serial transmit pin is PB3 / pin 3


You can use the serial monitor in the Arduino IDE, or any other serial monitor
Attiny85 PB3 connected to rx on arduino
Attiny85 Gnd -> Arduino Gnd
And reset on Arduino to ground

I could make a picture tomorrow if you still need it.
I have not yet tried the TinyTuner



Go Up