Go Down

Topic: Attiny85 serial comms (Read 12253 times) previous topic - next topic

brainbooster

is there any way to let the attiny85 (uart-less) communicate with a softwareserial when it's clocked at 1mhz?
i would like to connect it to a serial lcd.
i've compiled against the 45_85 core and the arduino tiny core but without success.
any help ?

(deleted)


brainbooster

#2
Apr 17, 2011, 04:45 pm Last Edit: Apr 17, 2011, 04:58 pm by BrainBooster Reason: 1
thank you for your reply
tested and it doesn't work too.. :(
i know , the core i'm using has a tinydebugserial, but i cant find examples around...
i would also be happy with a tx only solution
Edit:
my fuses are:
lfuse E2
hfuse DF
efuse FF
and avrdude says they're ok

(deleted)


brainbooster

i saw it , but it says 4800bps, i need 9600 because the serial lcd only works at that baudrate..
do you think it could be modified to reach 9600bps?

(deleted)

#5
Apr 17, 2011, 05:14 pm Last Edit: Apr 17, 2011, 05:20 pm by spycatcher2k Reason: 1
(deleted)

(deleted)

#6
Apr 17, 2011, 05:17 pm Last Edit: Apr 17, 2011, 05:44 pm by spycatcher2k Reason: 1
(deleted)

brainbooster

#7
Apr 17, 2011, 06:14 pm Last Edit: Apr 17, 2011, 07:45 pm by BrainBooster Reason: 1
thank you for your advice, but i know newsoftwareserial leans on interrupts and it wont work out of the box with the attiny85.
i would avoid to use interrupts if it is possible..
Edit:
anyway , programming fuses at 8mhz let the newsoftwareserial (with some modifications) actually work, but i'm afraid about interrupts and timers screwing up, but  now at least i can read my hallo world on my lcd.

Coding Badly

Quote
is there any way to let the attiny85 (uart-less) communicate with a softwareserial when it's clocked at 1mhz?


It depends.  Do you need to be able to receive, transmit, or both?

westfw

For transmit-only to a serial LCD, you should certainly be able to do 9600bps even on a 1MHz AVR.  That's about 106 microseconds per bit (or instructions, at 1MHz, approximately); plenty of time!
However, the arduino "softwareserial" library is not a particularly good place to start for doing this, since it's designed to use interrupts to allow several concurrent receive/transmit serial ports, which is overkill, and the timer-based interrupts may not work correctly on a tiny85, either.

brainbooster

that's the what i thought for first... it should be not so complicate to bitbang an rs232 frame.. divide the clock and the baudrate to have the delay between two subsequent bits, send the start bit, transform the char in byte and send the 0 or the 1, send the stop bit.
But with this method in my tests, if i send   "aaaa" i receive sometimes "aaaq" or sometimes the right string, or randomly "qqaq", i guess because of the internal oscillator and his low precision.
do you think TinyTune may help?
and why when i use the arduinoTiny core i'm not able to do it via the tinydebug serial at 1mhz?

Coding Badly

Quote
that's the what i thought for first... it should be not so complicate to bitbang an rs232 frame.. divide the clock and the baudrate to have the delay between two subsequent bits, send the start bit, transform the char in byte and send the 0 or the 1, send the stop bit.


That's exactly how Tiny Debug Serial works.

But with this method in my tests, if i send   "aaaa" i receive sometimes "aaaq" or sometimes the right string, or randomly "qqaq", i guess because of the internal oscillator and his low precision.


The untuned internal oscillator is probably why serial communications does not work.

Quote
do you think TinyTune may help?


It has helped me.  If the temperature and voltage is fairly stable I've been able to tune the internal oscillator to ±0.5%.  Which is certainly good enough for serial communications to work.

Quote
and why when i use the arduinoTiny core i'm not able to do it via the tinydebug serial at 1mhz?


It worked when I tested it.   :D  Try tuning the processor.

Go Up