Forum - MCS Electronics

 

FAQFAQ SearchSearch RegisterRegister Log inLog in

Qestion about ATtiny13

 
Post new topic   Reply to topic    www.mcselec.com Forum Index -> Various
View previous topic :: View next topic  
Author Message
krolikbest

Bascom Member



Joined: 02 Jan 2017
Posts: 71

poland.gif
PostPosted: Thu Sep 10, 2020 1:42 pm    Post subject: Qestion about ATtiny13 Reply with quote

Hello,

currently I'm building a small collecting system based on ATtiny13. In short: chip reads some signal from tilt sensor and sends some info through esp8266 (as a 'AT' commands) to computer (Raspberry). So far I tested esp8266 with arduino uno but as i mentioned should it be attiny13. Because I don't have them (attiny13) yet my question concerns hardware specification of attiny13: it runs with internal oscillator (default 9.6 MHz) and my program only reads high or low state of one pin and sends it via uart, so should I use some external clock (attiny13 doesn't have possibility to connect external XTAL as ATMega328) in order to use uart stable or I don't have to worry about stability with such a simple program?

Regards,
Back to top
View user's profile
albertsm

Administrator



Joined: 09 Apr 2004
Posts: 5070
Location: Holland

blank.gif
PostPosted: Thu Sep 10, 2020 3:20 pm    Post subject: Reply with quote

if you use a low baud like 9600 it will work fine.
_________________
Mark
Back to top
View user's profile Visit poster's website
plouf

Bascom Member



Joined: 19 Jan 2012
Posts: 27
Location: Athens,Greece

greece.gif
PostPosted: Thu Sep 10, 2020 8:53 pm    Post subject: Reply with quote

but as long as this is a NEW design , why you have choose tiny13 witch have NO internal uart, and not, for example, tiny202 which is cheaper, has more program memory and has hardware uart !?
Back to top
View user's profile
krolikbest

Bascom Member



Joined: 02 Jan 2017
Posts: 71

poland.gif
PostPosted: Fri Sep 11, 2020 6:41 am    Post subject: Reply with quote

There is a possibility of destructive load/pressure damage and that is why I decided to use tiny13 and the esp8266-01. This kind of sensor should give me a warning shortly before being damaged and then 'go to heaven' and live long and happily Smile
Back to top
View user's profile
albertsm

Administrator



Joined: 09 Apr 2004
Posts: 5070
Location: Holland

blank.gif
PostPosted: Fri Sep 11, 2020 10:37 am    Post subject: Reply with quote

But plouf is still right. It is not about the actual question but it is good advise. Ok, they are in DIP package which might be a good reason. But they are also more expensive unless you have a big stock of them.
Having a HW UART is always preferable. But for a simple task tiny13 is ok too. i do not know all in/out. and when change are chip is damaged, you can replace DIP easy, that is right.

_________________
Mark
Back to top
View user's profile Visit poster's website
laborratte

Bascom Expert



Joined: 27 Jul 2005
Posts: 262
Location: Berlin

germany.gif
PostPosted: Fri Sep 11, 2020 10:52 am    Post subject: Reply with quote

Main problem is temperature stability of internal R-C oscillator. For asynchronous communication it is too poor on tiny13, independent from baudrate.
As a rule of thumb you get into trouble with more than 4% error - this is independent of baudrate so a slow baudrate will not help. You can get better margins by shorter frame formats as 6N1 or even 5N1, but this is totally unusual in these days.
There are some new xtiny chips which have build in temperature compensation, but I personally wouldn't trust it.
Better way is to use a synchronous communication protocol as I2C or SPI or synchronous serial. Or you implement a "autobaud" sync-Feature, where the first data byte (known on both sides, i.e. $55) is used to adjust the baudrate.
Back to top
View user's profile
krolikbest

Bascom Member



Joined: 02 Jan 2017
Posts: 71

poland.gif
PostPosted: Fri Sep 11, 2020 11:23 am    Post subject: Reply with quote

Yes, resistance (working stability) for low temperatur is important. I'm still on a very initail stage of project thus there is not a problem to consider change of chip and there I've more points to think about with this project, one of them is for example power - strictly saying accu/solar power. If someone had/has some experience and would like to share a little...
Back to top
View user's profile
Display posts from previous:   
Post new topic   Reply to topic    www.mcselec.com Forum Index -> Various All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum