# attiny2313 serial interface with baudrate 115200

Status
Not open for further replies.

#### acus

##### Junior Member level 1
attiny2313 set baudrate

pleasee anyone help me.. i want to build project wih attiny2313 serial comunication with baudrate 115200 heres some example:

$regfile = "attiny2313.dat"$crystal = 20000000

$baud = 115200 Dim Cr As Byte Cr = &H0D Config Com1 = 115200 , Synchrone = 0 , Parity = None , Stopbits = 1 , Databits = 8 , Clockpol = 0 Waitms 5 Print "acus kasep pisan" ; Chr(cr); End i have test with avr simulator and works fine but if i conect with pc (hyperterminal) it's not working. the result is not "acus kasep pisan" any solution...? i try with crystal external 4mhz,20mhz still not working... #### ktec1 ##### Member level 2 attiny crystal baud acus said: pleasee anyone help me.. i want to build project wih attiny2313 serial comunication with baudrate 115200 heres some example:$regfile = "attiny2313.dat"
$crystal = 20000000$baud = 115200

Dim Cr As Byte
Cr = &H0D

Config Com1 = 115200 , Synchrone = 0 , Parity = None , Stopbits = 1 , Databits = 8 , Clockpol = 0

Waitms 5

Print "acus kasep pisan" ; Chr(cr);

End

i have test with avr simulator and works fine but if i conect with pc (hyperterminal) it's not working. the result is not "acus kasep pisan"

any solution...? i try with crystal external 4mhz,20mhz still not working...
hi!
you should consider that it should be a good relation beetwen the frequency of the
micro and baudrate to get minimum errorrate ,with freq of 4 or 8 or 16 or 20 Mhz
we have more than 7% percent error and more than 1% is not acceptable,
try using external crystal of 11059200 hzs nearly i'm sure you would get right answer
goodluck!

#### yogi

##### Full Member level 6
interface attiny 2313

I think it is the problem with fuse bits. Default frequency of most of atmega uC are 1mhz, so if you are using 115.2kbps, see the error. If it is .2% then it is ok. Read fuse bits and program fuse bits for external crystal. Since it is not working for 4mhz and 20mhz, it is almost sure that fuse bits is the problem. See this link to know about setting fuse bits
http://booksbybibin.14.forumer.com/viewtopic.php?t=106

Bibin John
www.bibinjohn.tk

#### jhbbunch

##### Full Member level 4
attiny2313 byte from pc

Using a UBBR value of 20 or 21 you will get 119,048 baud or 113,640 baud.
The 11.0592 MHz crystal mentioned above will give you exactly 115,200 baud.

Status
Not open for further replies.