Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronic Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Register Log in

attiny2313 serial interface with baudrate 115200

Status
Not open for further replies.

acus

Junior Member level 1
Joined
Sep 7, 2005
Messages
17
Helped
1
Reputation
2
Reaction score
0
Trophy points
1,281
Activity points
1,404
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
Joined
Aug 20, 2007
Messages
44
Helped
2
Reputation
4
Reaction score
1
Trophy points
1,288
Activity points
1,596
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
Joined
Jan 8, 2005
Messages
339
Helped
22
Reputation
44
Reaction score
5
Trophy points
1,298
Activity points
2,181
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
Joined
Feb 21, 2006
Messages
199
Helped
17
Reputation
34
Reaction score
3
Trophy points
1,298
Activity points
2,902
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.
Toggle Sidebar

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Top