On 2010-7-16 19:38, Sébastien Lorquet wrote:
No. Only the write access was obviously a giant breach. Giving a read access is totally normal and is what all open source projects do. When someone has something to write, he can send you a patch against a known svn revision. Then you can import the patch by yourself, and make contributors' work visible, while retaining full control on your server.

Ok, it's done. I deem it's going far away from uCsim topic.


I have copied some serial communication examples from MCS-51 course books, build them using SDCC, and simulating the same way for both plain files and /dev/tty. None works. Both tty and plain files are losing frames.

The testing command line:

    s51 -tC52 -S in=/dev/tty1,out=/dev/tty1   rs232_example_m.ihx
    s51 -tC52 -S in=testdata.in,out=/dev/tty1 rs232_example_m.ihx


Thanks,
Lenik


The example is included in the attachment.

/***********************************************************************************
 *  标题:                  RS232串口通信试验(接受与发送)           
                 *
 *                                                                              
                                                                                
   *
 *  1.通过本例程了解串口的基本原理及使用 
,理解并掌握对串口进行初始化                                 *
 *                                                                              
                                                                                
   *
 *   2.请使用串口调试助手(Baud 
4800、数据位8、停止位1、效验位无)做为上位机来做收发试验。
 *     
在调试助手字符串输入框中输入数字和字符,按发送按钮,然后观察接受窗口的变化。也可以用
 *       调试助手自动循环发送。                                      
                                                                   *
 *                                                                              
   *
 * 请学员认真消化本例程,学会用C语言操作串口                
                       *
 
*************************************************************************************/

#include <8052.H>

char Flag;
unsigned int ReData, SenData;

void main(void) {

    SCON = 0x50; //REN=1允许串行接受状态,串口工作模式1
    TMOD |= 0x20; //定时器工作方式2
    PCON |= 0x80;
    //TH1  = 0xFD;     //baud*2  /* reload value 
19200、数据位8、停止位1。效验位无 (11.0592)
    TH1 = 0xF3; // //baud*2  /*  
波特率4800、数据位8、停止位1。效验位无 (12M)
    TL1 = 0xF3;
    TR1 = 1;
    ES = 1; //开串口中断
    EA = 1; // 开总中断
    // IE = 0x0;

    while (1) {

        if (Flag == 1) {
            SBUF = SenData; //SBUF接受/发送缓冲器
            while (TI == 0)
                ;
            TI = 0;
            Flag = 0;
        }

    }

}

/****************************************************
 串口中断程序
 ******************************************************/
void ser_int(void)
__interrupt 4 __using 1
{

    if(RI == 1) //RI接受中断标志
    {
        RI = 0; //清除RI接受中断标志
        ReData = SBUF; //SUBF接受/发送缓冲器
        SenData=ReData;
        Flag=1;
    }
}
:0400000002002B329D
:01000B0032C2
:0100130032BA
:01001B0032B2
:030023000200B226
:0300840002002651
:0500260012008780FEBE
:0E008700759850438920438780758DF3758BE3
:07009500F3D28ED2ACD2AF12
:0A009C007800E2B401FA7803E2F5FF
:0100A60099C0
:0500A70010990280FB2E
:0600AC007800E4F280EA96
:0C00B200C0E0C0D075D008109802801784
:0C00BE00AA997B007801EAF208EBF278C6
:0A00CA0003EAF208EBF2780074017B
:0100D400F239
:0500D500D0D0D0E032A4
:06005A00E478FFF6D8FD7A
:080038007900E94400601B7A25
:05004000009000DE78D5
:030045000575A09E
:0A00480000E493F2A308B8000205DB
:08005200A0D9F4DAF275A0FF59
:080060007805E84400600A790C
:030068000075A080
:06006B0000E4F309D8FCDB
:080071007800E84400600C79FE
:0B00790000900005E4F0A3D8FCD9FAC9
:03002B0075810FCD
:0A002E001200DAE5826003020026EA
:0400DA007582002209
:00000001FF
hello, world
0123456789012345678900123456789001234567890012345678900123456789001234567890
------------------------------------------------------------------------------
This SF.net email is sponsored by Sprint
What will you do first with EVO, the first 4G phone?
Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
_______________________________________________
Sdcc-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/sdcc-user

Reply via email to