Go Down

Topic: SoftwareSerial with ATTiny84 using ATtiny library (Read 51 times) previous topic - next topic

Coding Badly

#25
Sep 23, 2012, 10:19 pm Last Edit: Sep 23, 2012, 10:26 pm by Coding Badly Reason: 1

I had to make a correction.  Please re-download (or git pull) before continuing.

Coding Badly


Enabling the Serial Relay...

• Load the TinyISP sketch

• Navigate to the TinyISP_BuildOptions.h file

• Locate this line...

[font=Courier New]#define RELAY_SERIAL_ENABLED              0[/font]

  ...and change it to this (change the one to a zero)...

[font=Courier New]#define RELAY_SERIAL_ENABLED              1[/font]

• Navigate to the TinyISP.pde (TinyISP.ino) file

• Locate this line...

[font=Courier New]//#include <SoftwareSerial.h>[/font]

  ...and change it to this (remove the comment)...

[font=Courier New]#include <SoftwareSerial.h>[/font]

• Upload the modified sketch to your Uno

Coding Badly


Wiring the Serial Relay...

• Digital pin 12 on the Uno is receive.  Connect transmit from the target to pin 12 on the Uno.  This pin is also used when programming the target (MISO).

• Digital pin 14 (A0) on the Uno is transmit.  It can be left unconnected or it can be connected to receive on the target.

Coding Badly


Using the Serial Relay...

• After opening Serial Monitor (or another terminal application), send a single exclamation mark (!) to activate the Monitor (which also activates the Serial Relay)

• When finished, send a second single exclamation mark (!) to return to Programming

• The Monitor supports three other commands...

[font=Courier New]  @  [/font]Toggle between holding the target in reset after programming and allowing the target to run immediately
[font=Courier New]  #  [/font]Reset the target now or allow the target to run if it is held in reset
[font=Courier New]  $  [/font]Hold the target in reset

Erni

#29
Sep 23, 2012, 11:30 pm Last Edit: Sep 23, 2012, 11:32 pm by Erni Reason: 1
Now I have redownloadet the TinyISP and made the corrections mentioned in reply #22 and #26.

I can upload the blink sketch as before but when I try to send a exclamation mark (!) in the serial monotor, all I get is  this
Code: [Select]
ÿ

which I belive means -1 or nothing returned.

I am using Attiny85, IDE 1.0, and have tried both 1mHz and 8mHz

My setup is:
I have left the wires from the programming setup, which means that pin12 on the Uno is connected to MISO. I have not connected pin14 to anything.

My test sketch is the blink sketch with a println
Code: [Select]
void setup() {                
 // initialize the digital pin as an output.
 // Pin 13 has an LED connected on most Arduino boards:
 
 Serial.begin(9600);
 pinMode(3, OUTPUT);    
}

void loop() {
 Serial.println("Testing...");
 digitalWrite(3, HIGH);   // set the LED on
 delay(500);              
 digitalWrite(3, LOW);    // set the LED off
 delay(100);            
}

Go Up