Re: [bascom] Timing?


From Claus Kühnel <ckuehnel@ieee.org>
Date Sun, 24 Jun 2001 18:01:01 +0200

Hi Timo
I tried the following snippet for M163 in simulation:

$sim
$crystal = 4000000
$baud = 9600

Dim I As Byte
Ubrr = 51              ' Baudrate Value for 9600
I = &H40
Print Chr(i);
End

The UBRR was set to 19. This value is wrong for a baud rate of 9600.
Therefore I added the line Ubrr = 51 and the right value is set after
internal initialization.
Try it with your hardware. I am very intersted in the result.
Bye
Claus Kühnel

// If interested then have a look to www.ckskript.ch or www.ckskript.de for
my BASCOM books.

----- Original Message -----
From: "Timo Engelmann" <mail@timo-engelmann.de>
To: <bascom@grote.net>
Sent: Sunday, June 24, 2001 12:03 PM
Subject: [bascom] Timing?


>
> Hi,
>
> I have an Problem with the AVR AT MEGA163L.
> The communication over the Serial RS232 is
> only function if I use the compiler directive
>
> $crystal = 888888
>
> But I use an 4MHz Crystal!
>
> Is there an internal division of the clock?
> And how can i switch this to 1:1 ?
>
> I use the BASCOM AVR Compiler.
>
> Thanx for your help!
>
>
> |  Timo Engelmann
> |  Erwin-Heim-Straße 20
> |  D-74189 Weinsberg
> |  tel:   (07134) 15050
> |  mobil: (0171) 6363462
> |  fax:   (07134) 903941
> |  email: mail@timo-engelmann.de
>