Offline
Newbie
Karma: 0
Posts: 45
|
 |
« Reply #15 on: September 20, 2012, 01:40:50 pm » |
I already ordered a zif-header to be able to remove the 328 easily and without damage. If you are interested, I have a version of the ArduinoISP sketch that makes what you are trying to do much simpler.
What does your modified sketch do to make it simpler and would it allow me to program the external micro and still get serial data without changing the connections every time?
|
|
|
|
|
Logged
|
|
|
|
|
Global Moderator
Dallas
Offline
Shannon Member
Karma: 118
Posts: 10167
|
 |
« Reply #16 on: September 20, 2012, 04:15:45 pm » |
What does your modified sketch do to make it simpler and would it allow me to program the external micro and still get serial data without changing the connections every time? The sketch provides a "serial relay" which has two on-wire options... the standard TTL-serial and something I call Knock-Bang. The Knock-Bang protocol is designed specifically for debugging a tiny processor when using an Arduino as a programmer. It's more robust and faster than TTL-serial. In either case, you don't need to fiddle with the wiring. MISO (one of the programming lines) is used for serial communications.
|
|
|
|
|
Logged
|
|
|
|
|
Offline
Newbie
Karma: 0
Posts: 45
|
 |
« Reply #17 on: September 21, 2012, 07:07:57 am » |
That sounds great, could you post the library here? I'll try the serial interface without the 328 once the zif socket arrives.
|
|
|
|
|
Logged
|
|
|
|
|
Offline
Newbie
Karma: 0
Posts: 45
|
 |
« Reply #18 on: September 21, 2012, 10:16:45 am » |
Ok, I couldn't wait for the zif socket;) Once I removed the Arduino and plugged the Serial cable into the TX(not RX as before) pin on the Arduino board, everything worked just fine! So it seems as if the Arduino blocks the communication if its inserted and your library should be able to solve my problem.
|
|
|
|
|
Logged
|
|
|
|
|
Global Moderator
Dallas
Offline
Shannon Member
Karma: 118
Posts: 10167
|
 |
« Reply #19 on: September 22, 2012, 04:28:27 pm » |
The latest version of the sketch (TinyISP) can be downloaded from here... https://github.com/Coding-Badly/TinyISP/zipball/masterOr, the source can be browsed here... https://github.com/Coding-Badly/TinyISPAs published, it is a drop-in replacement for the ArduinoISP sketch. Please download it and try it. At this point, the only noticeable difference should be shorter upload times. I will add more instructions later (probably tonight).
|
|
|
|
« Last Edit: September 22, 2012, 04:47:23 pm by Coding Badly »
|
Logged
|
|
|
|
|
Offline
Newbie
Karma: 0
Posts: 45
|
 |
« Reply #20 on: September 23, 2012, 02:40:19 am » |
Thanks, but it won't compile In file included from TinyISP.cpp:43: TinyISP_SanityChecks.h:45:6: error: #error The Knock-Bang Relay and Serial Relay are mutually exclusive for this processor. Enable one or the other but not both. See the <TinyISP_BuildOptions.h> file. TinyISP_SanityChecks.h:51:10: error: #error Ensure the "#include <SoftwareSerial.h>" line in the sketch is not commented-out or set RELAY_SERIAL_ENABLED to 0 in the <TinyISP_BuildOptions.h> file.
I can remove the 2nd error by removing the comment from the "//#include <SoftwareSerial.h>" line but once I changed the "#define RELAY_KNOCK_BANG_ENABLED 1" to "#define RELAY_KNOCK_BANG_ENABLED 0" in "TinyISP_BuildOptions.h" a whole bunch of compile errors appear. SoftwareSerial/SoftwareSerial.cpp.o: In function `__vector_3': /Applications/Arduino.app/Contents/Resources/Java/libraries/SoftwareSerial/SoftwareSerial.cpp:302: multiple definition of `__vector_3' KnockBangReceiver.cpp.o:KnockBangReceiver.cpp:271: first defined here TinyISP/KnockBangParser.cpp.o: In function `TinyDebugKnockBangParserClass::process()': /Users/daniel/Dropbox/Code/Arduino/libraries/TinyISP/KnockBangParser.cpp:51: multiple definition of `TinyDebugKnockBangParserClass::process()' KnockBangParser.cpp.o:KnockBangParser.cpp:51: first defined here TinyISP/KnockBangParser.cpp.o:/Users/daniel/Dropbox/Code/Arduino/libraries/TinyISP/KnockBangParser.cpp:51: multiple definition of `TinyDebugParser' KnockBangParser.cpp.o:KnockBangParser.cpp:51: first defined here TinyISP/KnockBangReceiver.cpp.o: In function `TinyDebugKnockBangClass_AssemblyMacros()': /Users/daniel/Dropbox/Code/Arduino/libraries/TinyISP/KnockBangReceiver.cpp:155: multiple definition of `TinyDebugKnockBangClass_AssemblyMacros()' KnockBangReceiver.cpp.o:KnockBangReceiver.cpp:155: first defined here TinyISP/KnockBangReceiver.cpp.o: In function `KnockBangReceive_begin()': /Users/daniel/Dropbox/Code/Arduino/libraries/TinyISP/KnockBangReceiver.cpp:184: multiple definition of `KnockBangReceive_begin()' KnockBangReceiver.cpp.o:KnockBangReceiver.cpp:184: first defined here TinyISP/KnockBangReceiver.cpp.o: In function `KnockBangReceive_end()': /Users/daniel/Dropbox/Code/Arduino/libraries/TinyISP/KnockBangReceiver.cpp:211: multiple definition of `KnockBangReceive_end()' KnockBangReceiver.cpp.o:KnockBangReceiver.cpp:211: first defined here TinyISP/KnockBangReceiver.cpp.o: In function `KnockBangReceive_available()': /Users/daniel/Dropbox/Code/Arduino/libraries/TinyISP/KnockBangReceiver.cpp:238: multiple definition of `KnockBangReceive_available()' KnockBangReceiver.cpp.o:KnockBangReceiver.cpp:238: first defined here TinyISP/KnockBangReceiver.cpp.o: In function `KnockBangReceive_read()': /Users/daniel/Dropbox/Code/Arduino/libraries/TinyISP/KnockBangReceiver.cpp:250: multiple definition of `KnockBangReceive_read()' KnockBangReceiver.cpp.o:KnockBangReceiver.cpp:250: first defined here TinyISP/KnockBangReceiver.cpp.o: In function `__vector_3': /Users/daniel/Dropbox/Code/Arduino/libraries/TinyISP/KnockBangReceiver.cpp:271: multiple definition of `__vector_3' KnockBangReceiver.cpp.o:KnockBangReceiver.cpp:271: first defined here TinyISP/KnockBangReceiver.cpp.o: In function `KnockBangReceive_getStats(kbr_stats_t&)': /Users/daniel/Dropbox/Code/Arduino/libraries/TinyISP/KnockBangReceiver.cpp:598: multiple definition of `KnockBangReceive_getStats(kbr_stats_t&)' KnockBangReceiver.cpp.o:KnockBangReceiver.cpp:598: first defined here TinyISP/KnockBangReceiver.cpp.o: In function `KnockBangReceive_getLastFault()': /Users/daniel/Dropbox/Code/Arduino/libraries/TinyISP/KnockBangReceiver.cpp:637: multiple definition of `KnockBangReceive_getLastFault()' KnockBangReceiver.cpp.o:KnockBangReceiver.cpp:637: first defined here TinyISP/KnockBangReceiver.cpp.o: In function `KnockBangReceive_getLastDebug1()': /Users/daniel/Dropbox/Code/Arduino/libraries/TinyISP/KnockBangReceiver.cpp:656: multiple definition of `KnockBangReceive_getLastDebug1()' KnockBangReceiver.cpp.o:KnockBangReceiver.cpp:656: first defined here TinyISP/TinyISP_AispLED.cpp.o: In function `AispLEDClass::setMode(AispLEDClass::mode_t)': /Users/daniel/Dropbox/Code/Arduino/libraries/TinyISP/TinyISP_AispLED.cpp:94: multiple definition of `AispLEDClass::setMode(AispLEDClass::mode_t)' TinyISP_AispLED.cpp.o:TinyISP_AispLED.cpp:94: first defined here TinyISP/TinyISP_AispLED.cpp.o: In function `AispLEDClass::update()': /Users/daniel/Dropbox/Code/Arduino/libraries/TinyISP/TinyISP_AispLED.cpp:108: multiple definition of `AispLEDClass::update()' TinyISP_AispLED.cpp.o:TinyISP_AispLED.cpp:108: first defined here TinyISP/TinyISP_AispLED.cpp.o: In function `AispLEDClass::flash()': /Users/daniel/Dropbox/Code/Arduino/libraries/TinyISP/TinyISP_AispLED.cpp:77: multiple definition of `AispLEDClass::flash()' TinyISP_AispLED.cpp.o:TinyISP_AispLED.cpp:77: first defined here TinyISP/TinyISP_AispLED.cpp.o: In function `AispLEDClass::error()': /Users/daniel/Dropbox/Code/Arduino/libraries/TinyISP/TinyISP_AispLED.cpp:66: multiple definition of `AispLEDClass::error()' TinyISP_AispLED.cpp.o:TinyISP_AispLED.cpp:66: first defined here TinyISP/TinyISP_AispLED.cpp.o: In function `AispLEDClass::begin(unsigned char)': /Users/daniel/Dropbox/Code/Arduino/libraries/TinyISP/TinyISP_AispLED.cpp:53: multiple definition of `AispLEDClass::begin(unsigned char)' TinyISP_AispLED.cpp.o:TinyISP_AispLED.cpp:53: first defined here TinyISP/TinyISP_AispLED.cpp.o:/Users/daniel/Dropbox/Code/Arduino/libraries/TinyISP/TinyISP_AispLED.cpp:94: multiple definition of `StatusIndicator' TinyISP_AispLED.cpp.o:TinyISP_AispLED.cpp:94: first defined here TinyISP/TinyISP_Monitor.cpp.o: In function `monitor_run(unsigned char&)': /Users/daniel/Dropbox/Code/Arduino/libraries/TinyISP/TinyISP_Monitor.cpp:123: multiple definition of `monitor_run(unsigned char&)' TinyISP_Monitor.cpp.o:TinyISP_Monitor.cpp:123: first defined here TinyISP/TinyISP_Programmer.cpp.o: In function `programmer_toggle_hold_in_reset()': /Users/daniel/Dropbox/Code/Arduino/libraries/TinyISP/TinyISP_Programmer.cpp:820: multiple definition of `programmer_toggle_hold_in_reset()' TinyISP_Programmer.cpp.o:TinyISP_Programmer.cpp:820: first defined here TinyISP/TinyISP_Programmer.cpp.o: In function `programmer_error_occurred()': /Users/daniel/Dropbox/Code/Arduino/libraries/TinyISP/TinyISP_Programmer.cpp:857: multiple definition of `programmer_error_occurred()' TinyISP_Programmer.cpp.o:TinyISP_Programmer.cpp:857: first defined here TinyISP/TinyISP_Programmer.cpp.o: In function `programmer_release_target_from_reset()': /Users/daniel/Dropbox/Code/Arduino/libraries/TinyISP/TinyISP_Programmer.cpp:829: multiple definition of `programmer_release_target_from_reset()' TinyISP_Programmer.cpp.o:TinyISP_Programmer.cpp:829: first defined here TinyISP/TinyISP_Programmer.cpp.o: In function `programmer_hold_target_in_reset()': /Users/daniel/Dropbox/Code/Arduino/libraries/TinyISP/TinyISP_Programmer.cpp:852: multiple definition of `programmer_hold_target_in_reset()' TinyISP_Programmer.cpp.o:TinyISP_Programmer.cpp:852: first defined here TinyISP/TinyISP_Programmer.cpp.o: In function `programmer_reset_target()': /Users/daniel/Dropbox/Code/Arduino/libraries/TinyISP/TinyISP_Programmer.cpp:834: multiple definition of `programmer_reset_target()' TinyISP_Programmer.cpp.o:TinyISP_Programmer.cpp:834: first defined here TinyISP/TinyISP_Programmer.cpp.o: In function `programmer_toggle_hold_in_reset()': /Users/daniel/Dropbox/Code/Arduino/libraries/TinyISP/TinyISP_Programmer.cpp:820: multiple definition of `param' TinyISP_Programmer.cpp.o:TinyISP_Programmer.cpp:820: first defined here TinyISP/TinyISP_Programmer.cpp.o: In function `programmer_process_command(unsigned char)': /Users/daniel/Dropbox/Code/Arduino/libraries/TinyISP/TinyISP_Programmer.cpp:689: multiple definition of `programmer_process_command(unsigned char)' TinyISP_Programmer.cpp.o:TinyISP_Programmer.cpp:689: first defined here TinyISP/TinyISP_Programmer.cpp.o: In function `programmer_toggle_hold_in_reset()': /Users/daniel/Dropbox/Code/Arduino/libraries/TinyISP/TinyISP_Programmer.cpp:820: multiple definition of `programmer_active' TinyISP_Programmer.cpp.o:TinyISP_Programmer.cpp:820: first defined here TinyISP/TinyISP_SPI.cpp.o: In function `spi_begin()': /Users/daniel/Dropbox/Code/Arduino/libraries/TinyISP/TinyISP_SPI.cpp:67: multiple definition of `spi_begin()' TinyISP_SPI.cpp.o:TinyISP_SPI.cpp:67: first defined here TinyISP/TinyISP_SPI.cpp.o: In function `spi_end()': /Users/daniel/Dropbox/Code/Arduino/libraries/TinyISP/TinyISP_SPI.cpp:102: multiple definition of `spi_end()' TinyISP_SPI.cpp.o:TinyISP_SPI.cpp:102: first defined here TinyISP/TinyISP_SPI.cpp.o: In function `spi_send': /Users/daniel/Dropbox/Code/Arduino/libraries/TinyISP/TinyISP_SPI.cpp:120: multiple definition of `spi_transaction(unsigned char, unsigned char, unsigned char, unsigned char)' TinyISP_SPI.cpp.o:TinyISP_SPI.cpp:120: first defined here TinyISP/TinyISP_SPI.cpp.o: In function `spi_transaction2(unsigned long)': /Users/daniel/Dropbox/Code/Arduino/libraries/TinyISP/TinyISP_SPI.cpp:183: multiple definition of `spi_transaction2(unsigned long)' TinyISP_SPI.cpp.o:TinyISP_SPI.cpp:183: first defined here
|
|
|
|
|
Logged
|
|
|
|
|
Global Moderator
Dallas
Offline
Shannon Member
Karma: 118
Posts: 10167
|
 |
« Reply #21 on: September 23, 2012, 03:19:38 am » |
Arduino IDE version?
|
|
|
|
|
Logged
|
|
|
|
|
Global Moderator
Dallas
Offline
Shannon Member
Karma: 118
Posts: 10167
|
 |
« Reply #22 on: September 23, 2012, 03:36:36 am » |
My apologies. The current version is configured for a Teensy. Try this...
• Load the TinyISP sketch
• Undo whatever changes you made
• Navigate to the TinyISP_BuildOptions.h file
• Locate this line...
#define RELAY_KNOCK_BANG_ENABLED 1
...and change it to this (change the one to a zero)...
#define RELAY_KNOCK_BANG_ENABLED 0
• Locate this line...
#define RELAY_SERIAL_ENABLED 1
...and change it to this (change the one to a zero)...
#define RELAY_SERIAL_ENABLED 0
|
|
|
|
|
Logged
|
|
|
|
|
Denmark
Offline
God Member
Karma: 19
Posts: 683
|
 |
« Reply #23 on: September 23, 2012, 10:14:39 am » |
I have tried the TinyISP in Arduino version 1.0 and an Attiny85.
After making the changes above evrything works, the heartbeat Led beats, and and I can upload the Blink example.
I have tried it in version 0021 too, without much succes. In that version, heartbeat ok, burn bootloader OK, but when I try oplading the Blink example, it just get stuck without any error messages.
Now I just need to find out how to use the serial communication.
|
|
|
|
|
Logged
|
|
|
|
|
Offline
Newbie
Karma: 0
Posts: 45
|
 |
« Reply #24 on: September 23, 2012, 11:30:06 am » |
I'm using the newest Arduino version and changed the lines, but now I get: TinyISP_RelaySoftSerial.h:45: error: 'SoftwareSerial' does not name a type TinyISP_RelaySoftSerial.h:51: error: 'SerialRelay' does not name a type /Users/daniel/Dropbox/Code/Arduino/libraries/TinyISP/TinyISP_Monitor.cpp: In function 'bool monitor_run(uint8_t&)': TinyISP_Monitor.cpp:130: error: 'RelaySerial' was not declared in this scope
Didn't I disable the serial relay by setting the setting to 0, because that's what I need in the end 
|
|
|
|
|
Logged
|
|
|
|
|
Global Moderator
Dallas
Offline
Shannon Member
Karma: 118
Posts: 10167
|
 |
« Reply #25 on: September 23, 2012, 03:19:05 pm » |
I had to make a correction. Please re-download (or git pull) before continuing.
|
|
|
|
« Last Edit: September 23, 2012, 03:26:15 pm by Coding Badly »
|
Logged
|
|
|
|
|
Global Moderator
Dallas
Offline
Shannon Member
Karma: 118
Posts: 10167
|
 |
« Reply #26 on: September 23, 2012, 03:29:53 pm » |
Enabling the Serial Relay...
• Load the TinyISP sketch
• Navigate to the TinyISP_BuildOptions.h file
• Locate this line...
#define RELAY_SERIAL_ENABLED 0
...and change it to this (change the one to a zero)...
#define RELAY_SERIAL_ENABLED 1
• Navigate to the TinyISP.pde (TinyISP.ino) file
• Locate this line...
//#include <SoftwareSerial.h>
...and change it to this (remove the comment)...
#include <SoftwareSerial.h>
• Upload the modified sketch to your Uno
|
|
|
|
|
Logged
|
|
|
|
|
Global Moderator
Dallas
Offline
Shannon Member
Karma: 118
Posts: 10167
|
 |
« Reply #27 on: September 23, 2012, 03:33:16 pm » |
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.
|
|
|
|
|
Logged
|
|
|
|
|
Global Moderator
Dallas
Offline
Shannon Member
Karma: 118
Posts: 10167
|
 |
« Reply #28 on: September 23, 2012, 03:36:49 pm » |
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...
@ Toggle between holding the target in reset after programming and allowing the target to run immediately # Reset the target now or allow the target to run if it is held in reset $ Hold the target in reset
|
|
|
|
|
Logged
|
|
|
|
|
Denmark
Offline
God Member
Karma: 19
Posts: 683
|
 |
« Reply #29 on: September 23, 2012, 04:30:03 pm » |
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 ÿ 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 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); }
|
|
|
|
« Last Edit: September 23, 2012, 04:32:32 pm by Erni »
|
Logged
|
|
|
|
|
|