logo       

Change to baud rate non stantard: msg#00022

Subject: Change to baud rate non stantard
Hi folks,

I would like to modify the baud rate of my second UART from my 5282. I
notice that the UBG11 and UBG21 registers stored the clock divider, and I
know that with my 60 MHZ CPU clock I need a 15 divider (0x0F) (60 M / (32 *
125000)) = 15.

I try to modify the registers in my app, but I didn't achieve to change to
125000, it works at 19200. Also, everytime I try to run again this command,
I get an error and I have to reboot uClinux. 

What I'am doing wrong?

Here is my code:
...
#include <linux/config.h>
#include <asm/system.h>

volatile unsigned char * ubg11 = (unsigned char *)0x40258;
volatile unsigned char * ubg21 = (unsigned char *)0x4025C;

int main(void){
        int fd, error;
        struct termios oldtio, newtio;
        unsigned char text1, text2, text3, text4;
        text1 = 0x55;
        text2 = 0xAA;
        text3 = 0x00;
        text4 = 0xFF;
        
        fd = open("/dev/ttyS1", O_RDWR | O_NOCTTY | O_NDELAY);

        if(fd < 0){
                printf("ERROR\n");
                printf("\t Error al obrir el dispositiu %d\n", errno);
                exit(1);
        }
        *ubg11 = 0x00;
        *ubg21 = 0x0F
...

Best regards,

Daniel Alomar i Claramonte
Research & Development Electronic Dept.
SERRA SOLDADURA, S.A.
WEB Site: http://www.serrasold.com
Knowledge Site: http://serratron.serrasold.com 

--------------------------------------------------------------------
To Subscribe send a message to:      ColdFire-On@xxxxxxxxxxxxxxxxxx
To Unsubscribe send a message to:    ColdFire-Off@xxxxxxxxxxxxxxxxxx
For further information, visit:      <http://www.WildRice.com/ColdFire/>




<Prev in Thread] Current Thread [Next in Thread>