Go Down

Topic: SoftwareSerial (on ATtiny85 8 MHz core) printing "boxes" - Answered (Read 498 times) previous topic - next topic

tweedius

Jan 30, 2013, 03:35 am Last Edit: Jan 30, 2013, 05:20 am by tweedius Reason: 1
Hello,

I've been trying unsuccessfully to get SoftwareSerial to display test characters to the IDE serial display.

I have an ATtiny85 hooked up to a sparkfun FT232RL USB to Serial breakout board.

I've been trying to run this program (modified SoftwareSerial example code):
Code: [Select]

#include <SoftwareSerial.h>

SoftwareSerial mySerial(4, 3); // RX, TX
int counter = 0;

void setup() 
{

  // set the data rate for the SoftwareSerial port
  mySerial.begin(4800);
  mySerial.println("Hello, world?");
}

void loop() // run over and over
{
  delay(100);
  mySerial.print("counter: ");
  mySerial.println(counter);
}


And all I get are "boxes", [][][][][][] (if they were actually boxes) displaying to the Arduino IDE.  It doesn't seem to matter whether I print an integer or a String, the only thing that happens is if I make the output: "11111111111111" vs "11111111" I get more or less "boxes."

I've altered the baud rate both in the script and on the Serial monitor and it does change to garbled text if the code and the Serial monitor baud rates do not match up.  I need it to work at 8 MHz as I believe that is what SoftwareSerial works at and 4800 baud is what my RF chip works at that I ultimately want to hook up to my circuit.

Has anyone seen this before, any help? 

I'd very much appreciate help, my head hurts from all of the banging.  :P

-Tweed


Coding Badly


tweedius

I have the ATtiny85 @ 8 MHz (internal oscillator; BOD disabled) core selected in the IDE, I'm programming it with the AVR ISP mkII.

Coding Badly


So you're building the program for a processor running at 8 MHz.  But that does not mean the processor is actually running at 8 MHz.

Execute Tools / Burn Bootloader to modify the processor (change the fuses) to run at 8 MHz.

tweedius

Thank you so much, that fixed it.  I've just recently begun experimenting with the Tinys.  I've seen countless posts by you too while trying to figure this out, how do you find the time man?

-Tweed

Coding Badly

Quote
Thank you so much, that fixed it.


You are welcome.

...how do you find the time man?


Hammock

Go Up