Pages: 1 ... 10 11 [12] 13 14   Go Down
Author Topic: SoftwareSerial with ATTiny84 using ATtiny library  (Read 48471 times)
0 Members and 1 Guest are viewing this topic.
Global Moderator
Dallas
Online Online
Shannon Member
*****
Karma: 209
Posts: 13023
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

It's not a problem to use the capacitor, but it's a little hassle to get it to contact into the headers good or otherwise jumper it from a breadboard.

Arc the pins so the capacitor hangs over the middle of the board.  If you always use the same capacitor arcing the pins also helps to ensure the capacitor is connected the correct way around.

Quote
It appears that avrdude does not invoke the auto-reset when using the stk500v1 protocol to the Uno R3 or Mega2560 R3.

Huh.  So it doesn't.  I wonder if that changed or if I have been a dumb-ass.

Quote
So the reset capacitor really doesn't do anything in this case, except for going into Serial Monitor.

Beats waiting 10 seconds.


Thoughts on moving Serial Relay to Serial1?
Logged

Wahiawa, Hawaii
Online Online
God Member
*****
Karma: 30
Posts: 626
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thoughts on moving Serial Relay to Serial1?

Serial1 works fine for me.  Will it complicate things to allow it on MISO as an option?

Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 9
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi All,

Does anyone know if this can be used with something else that uses the MISO/MOSI? I need to debug an ATTiny84 connected to an NRF24L01+ transmitter, but I just get knock bang faults when trying to debug. I assume its conflicting on the MISO/MOSI pins.

Is there an alternative? Can the TinyDebugKnockBang use a different pin? (I understand I would have to move the pin once the programming is done, but its better than no debug!)

Thanks

Kihon
Logged

Global Moderator
Dallas
Online Online
Shannon Member
*****
Karma: 209
Posts: 13023
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Hello,

Can the TinyDebugKnockBang use a different pin?

Yes.

The pin assignment for the ATtiny84 is here...
http://code.google.com/p/arduino-tiny/source/browse/TinyDebugKnockBang.h?repo=debugknockbang#55

Or, you could assign values to the KBS_* macros at an earlier point in the compilation...
http://code.google.com/p/arduino-tiny/source/browse/TinyDebugKnockBang.h?repo=debugknockbang#108

On the TinyISP side, enable RELAY_KNOCK_BANG_USE_ALTERNATE_PIN in _TinyISP_BuildOptions.h ...
http://code.google.com/p/arduino-tiny/source/browse/_TinyISP_BuildOptions.h?repo=isp#42

The alternate pins on 328 processors is digital pin 7 (PD7)...
http://code.google.com/p/arduino-tiny/source/browse/TinyISP_SelectBuildOptions.h?repo=isp#200

Logged

Offline Offline
Jr. Member
**
Karma: 0
Posts: 52
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi, I´m currently trying to get Tiny Debug Knock-Bang to work with my Attiny 85 @ 8mhz. I followed the guide from page 2 #33 and succeeded in getting Serial Monitor response to "!" . Then i followed on to the Knock-Bang debug but i cant get it to work even though my baud rate in Serial Monitor was set to 19200. When the capacitor between gnd and reset isnt set my arduino (328 nano) led blinks every time i change the baud rate in the monitor. Totally have no clue what is going on, i can compile the example sketch and upload it but i can´t read my tiny smiley-sad I even tried it with 1 mhz makes no difference.
The only option i have left is using Serial and switching pins all the time but it works.

Now i´ve gotten a way bigger problem, flashed following sketch :

Code:
void setup(){
  Serial.begin(9600);
  pinMode( A1, INPUT );  //PB2 (ADC1) 
}

void loop(){
  Serial.println(analogRead(A1));
  delay(100);
}

Now my nano led keeps blinking all the time, the analog read on the CLK pin on the tiny seems to mess up with tinyISP, i can´t upload any more and getting sync errors ( i can see it is being initialized RX/TX on nano blinking shortly). I just need to "reset" or overwrite the progmem of the tiny. What are my options here ?
« Last Edit: November 27, 2013, 12:11:02 pm by smithy » Logged

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

I don't think the sketch you uploaded to the tiny is the problem.
I just tried to upload your sketch, and afterwards I could upload the blink sketch without problems.

I use TinyISP on a UNO, (and a 10uF capacitor from reset to ground)

Do you have something else connected to the tiny while programming ?
Logged

Offline Offline
Jr. Member
**
Karma: 0
Posts: 52
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I don´t know i´ve read  that using pinmode can cause some problems, i tried flashing arduinoISP and tinyISP again. Somehow i got lucky and the led didn´t blink any more maybe the setting of tinyISP was wrong (buildoptions) and i was able to flash, now i still wanna try tinydebugknockbang. From what i have understood the reply to the ! message is arduino based not tiny based so i kinda didnt figure out how to get a Serial read from  my tiny except using Serial and a Serial USB converter (used for programming pro mini).

Yes i have connected a line from pb3 (Serial TX) to RX of my Serial USB converter, even while i Flash since the port is not used. I can definately tell that the blinking only occured when PB2 was connected to D13 ( i guess there was a bug because i used Serial in my programm but had turned the settings to using Knockbang).

Since I wanted to programm differential read and I´m getting strange offset readings (around 1000), i thought maybe because I use Serial. Does the DIDR0 reg set off the ADC ? I am measuring PB4-PB4 and i still get high values even though my DIDR0 reg is --11 1111.
Only when I leave the BIN in ADSCRB 0 i get 0 as measurement, which should be not true.
Sorry for going offtopic here, maybe u tried smth. similar and had same issues.


« Last Edit: November 28, 2013, 02:07:20 pm by smithy » Logged

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

I'm not sure what you're asking about and certainly not in the last section.

To get started with Knockbang, here is what I do:

In  _TinyISP_BuildOptions_h i put these lines:

Code:
#define RELAY_SERIAL_ENABLED  0
#define RELAY_KNOCK_BANG_ENABLED 1

And in TinyISP I comment this:

Code:
//#include <SoftwareSerial.h>

Then I upload this sketch to the ATtiny85:

Code:
#include <TinyDebugKnockBang.h>

int x=0;

void setup( void ) {
  Debug.begin( 250000 );
 }

void loop( void )
{
  Debug.print("Test-");
  Debug.println(x++);
  delay( 1000 );
}

Open the serial monitor @19200 and enter  !

More details can be found here:

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

Offline Offline
Jr. Member
**
Karma: 0
Posts: 52
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
Open the serial monitor @19200 and enter  !

It wasn´t clear to me that you have to start the monitor for KnockBang aswell smiley tyvm

Logged

Offline Offline
Sr. Member
****
Karma: 2
Posts: 344
YES! It is possible. Even Impossible Says I m Possible. :)
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset


Modify TinyISP to use Knock-Bang instead of Serial...

• Load TinyISP.pde into Arduino 1.0.1

• Navigate to the TinyISP_BuildOptions.h tab

• Change RELAY_KNOCK_BANG_ENABLED to this (change the zero to a one)...

#define RELAY_KNOCK_BANG_ENABLED           1 

• Change RELAY_SERIAL_ENABLED to this (change the one to a zero)...

#define RELAY_SERIAL_ENABLED               0 

• Navigate to the TinyISP tab

• Add a comment to this line...

// #include <SoftwareSerial.h>

• Upload the sketch to your Uno


Greetings,
I have a couple of ATtiny2313 chips & I want to burn thr arduino bootloader into it & upload sketches. I have an uno board, a couple of breadboards & jumper wires etc.
I followed This tutorial http://www.ernstc.dk/arduino/2313.htm
& this ATtiny core to setup my IDE http://code.google.com/p/arduino-tiny/
In that page the author refers your posts from arduino community http://arduino.cc/forum/index.php/topic,123388.30.html

Need to clarify a few things before I finally burn the bootloader....
1. What core is the most appropriate? The one that is referred in the tutorial or should I use your github core files? I am using arduino 1.5
2. Will you please tell me in brief what is serial relay & knockBang protocol?
I searched google but didn't find anything appropriate. Tried searches...

KnockBang - https://www.google.co.in/search?q=what+is+relay+knockbang&ie=utf-8&oe=utf-8&rls=org.mozilla:en-US:official&client=firefox-a&channel=fflb&gws_rd=cr&ei=noWlUvWlOIWErAfMzoHoBA#channel=fflb&q=knockbang+protocol&rls=org.mozilla:en-US%3Aofficial

Relay Serial - https://www.google.co.in/search?q=relay+serial&ie=utf-8&oe=utf-8&rls=org.mozilla:en-US:official&client=firefox-a&channel=fflb&gws_rd=cr&ei=54WlUvfFJMiKrQeQsoHwCQ
Thanking you in anticipation.
« Last Edit: December 09, 2013, 04:43:15 am by nightcrawler218 » Logged

"Imagination is more important than knowledge."
-Einstein

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

Quote
I want to burn thr arduino bootloader into

Do you realy want ton use a bootloader ?
If you use a programmer as mentioned in that tutorial, you don't need a bootloader.
Burning bootloader is just a way to set the fuses for the desired clock frequense

Quote
I am using arduino 1.5

If you use version 1.5 you will have to make a few changes.

http://forum.arduino.cc/index.php?topic=51984.msg1463698#msg1463698

Quote
what is serial relay & knockBang protocol

It is a very smart way to communicate with the t2313. If you use it you don't have to use a external serial/USB converter,
 and you don't need to change between programming and serial connection, it is almost like programming an Arduino Uno.

You have to use a special sketch. Use this called TinyISP

https://github.com/Coding-Badly/TinyISP/zipball/master

Instead of the usual ArduinoISP, that is included with the IDE

BTW: I am the author of the page you mentioned:
http://www.ernstc.dk/arduino/2313.htm
If you have any comments, improvements please let me know
« Last Edit: December 09, 2013, 07:32:11 am by Erni » Logged

Global Moderator
Dallas
Online Online
Shannon Member
*****
Karma: 209
Posts: 13023
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

If you use version 1.5 you will have to make a few changes.

No longer necessary.  Tiny Core 1 has been packaged for Arduino 1.5.  Both are available on the home page...
http://code.google.com/p/arduino-tiny/
Logged

Offline Offline
Sr. Member
****
Karma: 2
Posts: 344
YES! It is possible. Even Impossible Says I m Possible. :)
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hello  smiley

Thanks for your response. I was a little bit surprised to find the author here. Thanks for your time & effort that you put in the article to help us. Thanks to Coding Badly too.
I have successfully uploaded sketches to ATtiny2313 by using (Arduino UNO) ArduinoISP & SPI protocol. I used the ATtiny core for arduino1.5

Now the other half. I have a sketch loader circuit (FTDI based breakout board). I want my ATtiny to get burnt using the FTDI chip just like we  upload sketches in ATmega328 on BreadBoard.

I want to replace the UNO board by FTDI breakout board (Tx, Rx, RST pin). I did this but IDE says NO USB aavailable. Any help please.
What it TinyISP? Has it something to do with my issue? I have downloaded the coding-badly tinyISP zip file. What should I do now? Thanks for all your support & guidance
cheers.
« Last Edit: December 09, 2013, 04:59:22 pm by nightcrawler218 » Logged

"Imagination is more important than knowledge."
-Einstein

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

Quote
What it TinyISP?

It is just a replacement for ArduinoISP, with extra features

If you want to use a  FTDI  board , you will need a bootloader. I haven't heard of any bootloader for the t2313, maybe because of the very small memory :2K Flash, 128 SRAM

I saw that there should be a bootloader for ATtiny85
http://forum.arduino.cc/index.php?topic=203108.0
But the t85 has 4 times as much memory

Quote
Thanks for your response. I was a little bit surprised to find the author here. Thanks for your time & effort that you put in the article to help us

You are welcome.

And just to avoid any mistakes.
The Tiny core, TinyISP and so on are developed and maintained by Coding Badly.
Something like that far exceeds my programming skills, I am just a hobbyist


« Last Edit: December 09, 2013, 05:36:36 pm by Erni » Logged

Offline Offline
Sr. Member
****
Karma: 2
Posts: 344
YES! It is possible. Even Impossible Says I m Possible. :)
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thanks for your response. Glad to be here in this community
smiley
Logged

"Imagination is more important than knowledge."
-Einstein

Pages: 1 ... 10 11 [12] 13 14   Go Up
Jump to: