View previous topic :: View next topic |
Author |
Message |
krolikbest
Joined: 02 Jan 2017 Posts: 112
|
Posted: Thu Sep 10, 2020 1:42 pm Post subject: Qestion about ATtiny13 |
|
|
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 |
|
|
albertsm
Joined: 09 Apr 2004 Posts: 5914 Location: Holland
|
Posted: Thu Sep 10, 2020 3:20 pm Post subject: |
|
|
if you use a low baud like 9600 it will work fine. _________________ Mark |
|
Back to top |
|
|
plouf
Joined: 19 Jan 2012 Posts: 78 Location: Athens,Greece
|
Posted: Thu Sep 10, 2020 8:53 pm Post subject: |
|
|
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 |
|
|
krolikbest
Joined: 02 Jan 2017 Posts: 112
|
Posted: Fri Sep 11, 2020 6:41 am Post subject: |
|
|
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 |
|
Back to top |
|
|
albertsm
Joined: 09 Apr 2004 Posts: 5914 Location: Holland
|
Posted: Fri Sep 11, 2020 10:37 am Post subject: |
|
|
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 |
|
|
laborratte
Joined: 27 Jul 2005 Posts: 299 Location: Berlin
|
Posted: Fri Sep 11, 2020 10:52 am Post subject: |
|
|
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 |
|
|
krolikbest
Joined: 02 Jan 2017 Posts: 112
|
Posted: Fri Sep 11, 2020 11:23 am Post subject: |
|
|
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 |
|
|
|