Pages: 1 ... 5 6 [7] 8 9 ... 14   Go Down
Author Topic: SoftwareSerial with ATTiny84 using ATtiny library  (Read 47260 times)
0 Members and 3 Guests are viewing this topic.
Denmark
Offline Offline
Edison Member
*
Karma: 35
Posts: 1073
Happy Hobbyist
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
(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 Offline
Shannon Member
*****
Karma: 208
Posts: 12936
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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?

Quote
I had a sketch running for more than 40 minutes whitout any errors,

Excellent!
Logged

Denmark
Offline Offline
Edison Member
*
Karma: 35
Posts: 1073
Happy Hobbyist
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
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 Offline
Full Member
***
Karma: 3
Posts: 188
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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:

Code:
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 Offline
Shannon Member
*****
Karma: 208
Posts: 12936
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset


Sorry about that.  Try it now.
Logged

Valencia, Spain
Online Online
Faraday Member
**
Karma: 146
Posts: 5533
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Not sure how this is supposed to work without power...

It won't.

That's what they taught me in EE smiley-wink

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 (but I do accept thank-you notes...)

Offline Offline
Full Member
***
Karma: 3
Posts: 188
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset


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 Offline
Full Member
***
Karma: 3
Posts: 188
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset


Install the Tiny Debug Knock-Bang library...

• Download the latest version of Tiny Debug Knock-Bang...
https://github.com/Coding-Badly/TinyDebugKnockBang/zipball/master
https://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...

Code:
#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:

Code:
#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 Offline
Shannon Member
*****
Karma: 208
Posts: 12936
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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 Offline
Full Member
***
Karma: 3
Posts: 188
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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.


Quote
• 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:

Code:
--- 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 Offline
Shannon Member
*****
Karma: 208
Posts: 12936
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Is that the on between reset and ground?

Yes.

Quote
I did that and no change, still get the error:
Code:
--- 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 Offline
Full Member
***
Karma: 3
Posts: 188
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset


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 Offline
Shannon Member
*****
Karma: 208
Posts: 12936
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset


The receive errors are listed here...
https://github.com/Coding-Badly/TinyISP/blob/master/KnockBangReceiver.cpp#L285

The one of interest is...
fault_timeout_knock          = 0x11

The 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 Offline
Edison Member
*
Karma: 35
Posts: 1073
Happy Hobbyist
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
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:

Quote
--- 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 Offline
Full Member
***
Karma: 3
Posts: 188
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
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:

Quote
--- 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

Pages: 1 ... 5 6 [7] 8 9 ... 14   Go Up
Jump to: