Rockbox.org home
release
dev builds
extras
themes manual
wiki
device status forums
mailing lists
IRC bugs
patches
dev guide



Rockbox mail archive

Subject: Re: Baud rate calculations
From: Paul Suade (paul.suade_at_laposte.net)
Date: 2001-12-10


GOT IT !

setup_sci1 (int baudrate /* r4 */) :

0x000047A8: mov r4,r5 ; r5 = r4
0x000047AA: mov.l @(0x078,pc),r4 ; 0x00004820 (0x00B71B00 --> 12000000 !)
...
0x000047B8: mov #0x00,r6 ; r6 = 0
0x000047BA: mov.w r1,@r3 ; PBCR1 &= 0xff0f; |= 0xa0
0x000047BC: shll2 r5
0x000047BE: mov.b r6,@r8 ; SCR1 = 0;
0x000047C0: add r5,r5
0x000047C2: mov.l @(0x06C,pc),r1 ; 0x0000482C (0x05FFFEC8)
0x000047C4: shll2 r5 ; r5 = r5*32 --> r5 = baudrate *32 !
0x000047C6: mov.b r6,@r1
0x000047C8: jsr @r7 ; r0 = r4/r5
0x000047CA: nop
0x000047CC: mov r0,r7 ; r7 = 12000000 / (baudrate*32) !
0x000047CE: mov r7,r1
0x000047D0: add #0xFF,r1 ; r1 = (12000000 / (baudrate*32))-1 !
0x000047D2: mov.l @(0x060,pc),r0 ; 0x00004830 (0x05FFFEC9) BRR1
0x000047D4: mov.b r1,@r0 ; BRR1 = (12000000 / (baudrate*32))-1 !
...

----- Original Message -----
From: Björn Stenberg <bjorn_at_haxx.se>
To: Jukebox development <jukebox_at_cool.haxx.se>
Sent: Monday, December 10, 2001 10:45 AM
Subject: RE: Baud rate calculations

> Nielsen Linus (ext) wrote:
>
> > No it doesn't set it to 255. The 0xff Björn is referring to
> > is a subtraction (using add #0xff). The BRR value is dynamically
> > calculated.
>
> Ah, yes! So I was right, I did sleep too little. :-)
>
> Well spotted.
>
> /Björn



Page was last modified "Jan 10 2012" The Rockbox Crew
aaa