Denmark
Offline
God Member
Karma: 23
Posts: 704
|
 |
« Reply #90 on: December 16, 2012, 04:06:18 pm » |
(Except for 0.6 MHz. I'm surprised that works. As the clock speed is reduced below 1 MHz, the protocol becomes less reliable. At 0.5 MHz it should fail.) Now I have done some more testing at 600 kHz and it is indeed unreliable. I had a sketch running for more than 40 minutes whitout any errors, other tests only 4-5 lines before I got a KnockBang error, and most tests between those.
|
|
|
|
|
Logged
|
|
|
|
|
Global Moderator
Dallas
Offline
Shannon Member
Karma: 129
Posts: 10379
|
 |
« Reply #91 on: December 17, 2012, 04:11:56 am » |
Now I have done some more testing at 600 kHz and it is indeed unreliable. Do you have a need for Knock-Bang to work at clock speeds below 1 MHz? I had a sketch running for more than 40 minutes whitout any errors, Excellent!
|
|
|
|
|
Logged
|
|
|
|
|
Denmark
Offline
God Member
Karma: 23
Posts: 704
|
 |
« Reply #92 on: December 17, 2012, 04:46:33 am » |
Do you have a need for Knock-Bang to work at clock speeds below 1 MHz? No, I was just curious to see if it worked.
|
|
|
|
|
Logged
|
|
|
|
|
Offline
Full Member
Karma: 2
Posts: 140
|
 |
« Reply #93 on: January 15, 2013, 07:50:13 pm » |
this seems like a really awesome project and exactly what I am looking for. however the sketch doesn't seem to want to compile. I get this error: In file included from KnockBangReceiver.cpp:36: TinyISP_SelectBuildOptions.h:175:2: error: #error I'm on an Uno and IDE v1.0.1. I think it might have to do with TinyISP_BuildOptions.h, that doesn't seem to be in the files included.i did find TinyISP_SelectBuildOptions.h and that seemed right, however settings in there already matched what you said to change. any suggestions?
|
|
|
|
|
Logged
|
for(i = 0, i < 820480075, i++){ Design(); Code(); delay(1000); } // hellowoo.com
|
|
|
|
Global Moderator
Dallas
Offline
Shannon Member
Karma: 129
Posts: 10379
|
 |
« Reply #94 on: January 16, 2013, 12:29:08 am » |
Sorry about that. Try it now.
|
|
|
|
|
Logged
|
|
|
|
|
Valencia, Spain
Offline
Faraday Member
Karma: 72
Posts: 2500
|
 |
« Reply #95 on: January 16, 2013, 07:56:19 am » |
Not sure how this is supposed to work without power... It won't. That's what they taught me in EE  It might ... if one of the I/O pins is connected to a voltage source. OTOH this is a good way to destroy chips, don't try it at home.
|
|
|
|
|
Logged
|
No, I don't answer questions sent in private messages...
|
|
|
|
Offline
Full Member
Karma: 2
Posts: 140
|
 |
« Reply #96 on: January 17, 2013, 11:15:00 pm » |
Sorry about that. Try it now.
ahh, there we go! perfect. thank you.
|
|
|
|
|
Logged
|
for(i = 0, i < 820480075, i++){ Design(); Code(); delay(1000); } // hellowoo.com
|
|
|
|
Offline
Full Member
Karma: 2
Posts: 140
|
 |
« Reply #97 on: January 17, 2013, 11:44:55 pm » |
Install the Tiny Debug Knock-Bang library... • Download the latest version of Tiny Debug Knock-Bang... https://github.com/Coding-Badly/TinyDebugKnockBang/zipball/masterhttps://github.com/Coding-Badly/TinyDebugKnockBang• Extract the contents to a directory named TinyDebugKnockBang in your Arduino sketchbook library folder • Start the Arduino IDE • Ensure one of the tiny processor "boards" is selected • Copy-and-paste this small test into the edit window... #include <TinyDebugKnockBang.h>
void setup( void ) { Debug.begin( 250000 ); }
void loop( void ) { Debug.println( F( "Caitlin! " ) ); delay( 1000 ); } • Verify that the sketch compiles I seem to be missing something. Maybe I don't fully understand what knock-bang is. Was assuming this was a simple "hello world" type message that you can test this one, could be wrong. I have selected attiny85 at 8mhz as board and it upload fine and I can even add "!" into debugger and I get "--- Monitor starting ---" but it seems nothing is coming out. Also have 19200 baud set, no line ending. I uploaded the sketch you showed earlier: #include <TinyDebugKnockBang.h>
void setup( void ) { Debug.begin( 250000 ); }
void loop( void ) { Debug.println( F( "Caitlin! " ) ); delay( 1000 ); } But I am not getting anything in the monitor aside from initiated message. On arduino its connected to Tx (though it seems like it would be Rx but all other monitors I have set up use Rx for some reason) and PB3 on the attiny (with 220ohm resistor between). Might be missing something though?
|
|
|
|
« Last Edit: January 17, 2013, 11:46:53 pm by hilukasz »
|
Logged
|
for(i = 0, i < 820480075, i++){ Design(); Code(); delay(1000); } // hellowoo.com
|
|
|
|
Global Moderator
Dallas
Offline
Shannon Member
Karma: 129
Posts: 10379
|
 |
« Reply #98 on: January 18, 2013, 01:08:30 am » |
I seem to be missing something. You are. Documentation. Work keeps getting in the way. Try this... • With the TinyISP sketch loaded in the Arduino IDE, switch to the _TinyISP_BuildOptions.h tab # (sadly, it ended up the last tab) • Add this line below the Put build options here comment... #define RELAY_KNOCK_BANG_ENABLED 1• Upload the modified sketch (don't forget to remove the auto-reset disable capacitor) # Or, with the Arduino IDE not running use an external editor to modify the file.
|
|
|
|
|
Logged
|
|
|
|
|
Offline
Full Member
Karma: 2
Posts: 140
|
 |
« Reply #99 on: January 18, 2013, 11:36:29 pm » |
I seem to be missing something. You are. Documentation. Work keeps getting in the way. Try this... • With the TinyISP sketch loaded in the Arduino IDE, switch to the _TinyISP_BuildOptions.h tab # (sadly, it ended up the last tab) • Add this line below the Put build options here comment... #define RELAY_KNOCK_BANG_ENABLED 1• Upload the modified sketch (don't forget to remove the auto-reset disable capacitor) # Or, with the Arduino IDE not running use an external editor to modify the file. • Upload the modified sketch (don't forget to remove the auto-reset disable capacitor) Is that the on between reset and ground? I did that and no change, still get the error: --- Knock-Bang fault: 11 ---
--- Knock-Bang fault: 11 ---
|
|
|
|
« Last Edit: January 19, 2013, 12:48:24 am by hilukasz »
|
Logged
|
for(i = 0, i < 820480075, i++){ Design(); Code(); delay(1000); } // hellowoo.com
|
|
|
|
Global Moderator
Dallas
Offline
Shannon Member
Karma: 129
Posts: 10379
|
 |
« Reply #100 on: January 19, 2013, 01:09:50 am » |
Is that the on between reset and ground? Yes. I did that and no change, still get the error: --- Knock-Bang fault: 11 --- --- Knock-Bang fault: 11 ---
No change? Earlier you reported that nothing was being output to the Serial Monitor. Were error messages being output?
|
|
|
|
|
Logged
|
|
|
|
|
Offline
Full Member
Karma: 2
Posts: 140
|
 |
« Reply #101 on: January 19, 2013, 01:29:26 am » |
definitely a change, it now says --- Knock-Bang fault: 11 --- instead of nothing. Of course I should clarify, it did indicate the monitor was starting and stopping.
Edit: trimmed the unnecessary quote.
|
|
|
|
« Last Edit: January 19, 2013, 01:49:38 am by Coding Badly »
|
Logged
|
for(i = 0, i < 820480075, i++){ Design(); Code(); delay(1000); } // hellowoo.com
|
|
|
|
Global Moderator
Dallas
Offline
Shannon Member
Karma: 129
Posts: 10379
|
 |
« Reply #102 on: January 19, 2013, 03:19:10 am » |
The receive errors are listed here... https://github.com/Coding-Badly/TinyISP/blob/master/KnockBangReceiver.cpp#L285The one of interest is... fault_timeout_knock = 0x11The receiver (your Uno) is expecting a low pulse of a certain duration (a "knock"). The pulse is too short to be a knock. The problem could be caused by the target running at 1 MHz with code built for a processor running at 8 MHz. Which "board" do you have selected? Have you used "burn bootloader" to change the fuses?
|
|
|
|
|
Logged
|
|
|
|
|
Denmark
Offline
God Member
Karma: 23
Posts: 704
|
 |
« Reply #103 on: January 19, 2013, 07:11:52 am » |
The problem could be caused by the target running at 1 MHz with code built for a processor running at 8 MHz. If it is of any help, I just tried a Attiny85 running at 1MHZ and selected board Attiny85 @ 8MHZ and got: --- Knock-Bang fault: 11 --- With the same target and selcting board Attiny85 @ 1MHZ it works as expected (Output to the serial monitor looks as it should)
|
|
|
|
« Last Edit: January 19, 2013, 07:14:06 am by Erni »
|
Logged
|
|
|
|
|
Offline
Full Member
Karma: 2
Posts: 140
|
 |
« Reply #104 on: January 19, 2013, 12:55:58 pm » |
The problem could be caused by the target running at 1 MHz with code built for a processor running at 8 MHz. If it is of any help, I just tried a Attiny85 running at 1MHZ and selected board Attiny85 @ 8MHZ and got: --- Knock-Bang fault: 11 --- With the same target and selcting board Attiny85 @ 1MHZ it works as expected (Output to the serial monitor looks as it should) yeah, I just did this too. It makes sense since the frequency is 8 times faster, would make the signal shorter. I was under impression serial monitor needed to be 8Mhz like normal, but this seems to run differently. It works perfect now! thanks guys.
|
|
|
|
|
Logged
|
for(i = 0, i < 820480075, i++){ Design(); Code(); delay(1000); } // hellowoo.com
|
|
|
|
|