User`s manual

UC-8410/8416/8418 LX User’s Manual Programmer’s Guide
5-15
Baudrate inaccuracy
Divisor = 921600/Target Baud Rate. (Only Integer part)
ENUM = 8 * (921600/Target - Divisor) ( Round up or down)
Inaccuracy = (Target Baud Rate – 921600/(Divisor + (ENUM/8))) / Target Baud Rate * 100%
E.g.,
To calculate 500000 bps
Divisor = 1, ENUM = 7,
Inaccuracy = 1.7%
*The Inaccuracy should less than 2% for the device to work reliably.
Special Note
1. If the target baudrate is not a special baudrate (e.g., 50, 75, 110, 134, 150, 200, 300, 600, 1200,
1800, 2400, 4800, 9600, 19200, 38400, 57600, 115200, 230400, 460800, 921600), the termios
cflag will be set to the same flag.
2. If you use stty to get the serial information, you will get a speed equal to 0.
SRAM
1. Introduction
The UC-8410/8416/8418 provides 256 KB of embedded SRAM. As there is a system battery
inside the computer, the SRAM can work and be used to keep data even when the system is
crashed. This means that the data stored on the SRAM will not be lost after the
UC-8410/8416/8418 is powered off.
2. How the SRAM works
The SRAM device can be programmed through the file /dev/sram. This means that you can
read from or write to /dev/sram to store data on the embedded SRAM. The following example
illustrates how to do this:
/**************************************************************
History :
Versoin Author Date Comment
1.0 Jared Wu. 09-11-2008 Write a pattern to SRAM.
**************************************************************/
#include <sys/types.h>
#include <sys/stat.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <fcntl.h>
#include <linux/kd.h>
#define SRAM_SIZE 0x00040000 // 256 Kbytes
static char sram_buf1[SRAM_SIZE], sram_buf2[SRAM_SIZE];
int main(int argc, char * argv[])
{
int fd, len;
unsigned long ms=0;