Go Down

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

Erni

If you can upload a working blink sketch to your Tiny, you should be able to use TinyDebugSerial, which is a one way communication.

Code: [Select]

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

void loop() {
  Serial.println("Testing..");
  delay(100);
}


The output from the tiny is pin PB3.

You the need a serial/usb converter to connect it to your computer/serial monitor

more on this:

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

As you see you have other options:

1. TinyDebugSerial
2. SoftwareSerial
3. Use TinyISP and Tinyknockbang
4. Use TinyISP and Serial Relay
5. Use TinyISP and Nullmodem


sej7278

any idea what needs modifying to make TinyISP and TinyDebugKnockBang work on a Mega2560? I could probably figure out the pin changes, but I don't know what to put to replace the ( __AVR_ATmega328P__ ) #define's.

also is there a way to search a thread on this forum?

Coding Badly

any idea what needs modifying to make TinyISP and TinyDebugKnockBang work on a Mega2560?


I have a version that may work but I have no way to test it.  If you agree to provide feedback (that includes success) then I'm willing to publish.

Quote
also is there a way to search a thread on this forum?


I'm not aware of any way.

hiduino


I have a version that may work but I have no way to test it.  If you agree to provide feedback (that includes success) then I'm willing to publish.


I'll be willing to test it out also.  I've actually been trying to play with TinyISP on my mega2560 but didn't get too far with it.


Coding Badly



I have a version that may work but I have no way to test it.  If you agree to provide feedback (that includes success) then I'm willing to publish.

I'll be willing to test it out also.


Excellent.  Is delivery via Github acceptable?


If you don't mind, I'd like you to review the pin assignments for mistakes / opinions...

LED_PIN is assigned to digital pin 13.  TinyISP uses a single LED for status.  I chose the on-board LED.

TICK_TOCK_PIN is assigned to digital pin 47.  The "Tick Tock" pin is used as a basic chronograph.  When the pin toggles a timestamp is output.  It allows basic performance monitoring and tuning.  I have a version that uses Input Capture so I try to assign TICK_TOCK_PIN to ICP1 (Input Capture for Timer 1).

Knock-Bang is always assigned to MISO which is PB4 / digital pin 50.

The SPI pins are...
MISO is 50.
MOSI is 51.
SCK is 52.
SS is 53.

The SPI pin assignments are only relevant when PROGRAMMER_SPI_CLOCK == SLOW.  I believe the Arduino core provides the assignments.


There are two more things that will have to be assigned pins: "Tuning Signal" and "Alternate Knock-Bang". 

The Tuning Signal is one-half of a much improved Tiny Tuner.  For the m328 processor the Tuning Signal is currently placed on a timer 2 output (OC2B).  The only requirement is the pin must be a timer output.  A pin close to the target (close to the SPI pins) is helpful.

There are times when MISO cannot be used for Knock-Bang.  The Alternate is simply another choice for Knock-Bang.  The only requirement is the pin has to support Pin Change Interrupts.  I typically choose this pin based on physical location: a pin close to the SPI pins that does not conflict with any other pin assignment.

Finally, the Serial Relay code will have to be updated (this is a note to myself).


Quote
I've actually been trying to play with TinyISP on my mega2560 but didn't get too far with it.


The code is very poorly structured for porting so it's certainly understandable you ran into problems.  I had to grep for a few things and I wrote the thing.

Go Up