Pages: [1]   Go Down
Author Topic: My path towards ATTiny and serial Comms  (Read 441 times)
0 Members and 1 Guest are viewing this topic.
0
Offline Offline
Full Member
***
Karma: 0
Posts: 155
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I'm working on a project that I would like to interface a ATTiny85 with XBee series2.  I've been successful with getting a bootloader on the ATTiny, I've also got the blinking LED sketch loaded and working without any problems.  The first obsticle (of many I'm sure) is that I get the error:

Code:
'Serial' was not declared in this scope

I've tried to do google searches, and it appears that I'm not using the right core.  The articles that I've read are not the most recent and I'm not sure what core to needs to be loaded.

This blog post is what I used as a guide to get me started:  http://www.txoof.com/2013/04/reading-serial-data-from-attiny85.html

Here is the simple sketch that I've tried to use without success:

Code:
void setup()  {
 Serial.begin(9600);
}
 
void loop()
{
 Serial.println("Can it be true?! A serial monitor indeed!");
 delay(10);
}

Any advice on how to choose a core would be great.  Thanks!
Logged

Leeds, UK
Offline Offline
Edison Member
*
Karma: 80
Posts: 1726
Once the magic blue smoke is released, it won't go back in!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

You could try my core:
https://github.com/TCWORLD/ATTinyCore

It has a built in software Serial library which can be used in the same way as the hardware library (e.g. Serial.begin() etc.) - PB0 is TX and PB1 is RX.
Logged

~Tom~

Wahiawa, Hawaii
Offline Offline
God Member
*****
Karma: 29
Posts: 588
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

You could also try https://code.google.com/p/arduino-tiny/downloads/list.  It also has built in software serial support.

Logged

0
Offline Offline
Full Member
***
Karma: 0
Posts: 155
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Ok so I admit I'm a total noob when it comes to cores.  Can I easily load multiple cores into the arduino IDE or am I up against a one at a time kind of thing?


Logged

Wahiawa, Hawaii
Offline Offline
God Member
*****
Karma: 29
Posts: 588
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

The various types of cores should be added to your \sketches\hardware folder.  If you create separate folder names under the hardware folder then you could have multiple cores loaded.  However, note this caution, that the boards list may get very long.  The IDE will add entries to the Boards list by reading in the boards.txt file in each core directory under \hardware folder.

I usually will switch between them by just changing the filename for boards.txt in each core that I'm not using to something else.

\sketches\hardware\tiny\boards.txt    (this one active)
\sketches\hardware\attiny\boards.txt.unused   (this one not active)

Logged

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


There isn't enough difference between the two to matter.

https://github.com/TCWORLD/ATTinyCore/commits/master
http://code.google.com/p/arduino-tiny/source/list

Nothing relevant to the t85 processor.
Logged

Pages: [1]   Go Up
Jump to: