Skip to main content
Visitor II
January 26, 2006
Question

ST72334N4 & SCI

  • January 26, 2006
  • 2 replies
  • 743 views
Posted on January 26, 2006 at 08:22

ST72334N4 & SCI

    This topic has been closed for replies.

    2 replies

    ylltklAuthor
    Visitor II
    January 23, 2006
    Posted on January 23, 2006 at 04:17

    HI,

    Currently I using the ST72334N4 and I face a problem related to SCI. I wish to connect the ST72334N4 to PC (Visual Basic) via Uart and the baud rate is 19200, no parity, 8 bit data, 1 start and 1 stop bit. Below is the setting for St72334 I used. The ST72334 Fosc is 8MHz and using SCI receive interrupt.

    SCICR1=0x00;

    SCICR2=0x00;

    SCIBRR=0x00;

    SCIERPR=26;

    SCIETPR=26;

    //set as SCI receive, interrupt enable

    PEDR &= 0xEF;

    PEDR|=0x03;

    SCICR2 = 0x24;

    On the PC side, I am using Visual Basic MSCOMM control and set the property as ''19200,N,8,1''. I sent a byte of data from PC to ST72334 using MSCOMM1.OUTPUT=chr(x). x is a value from 0-255.

    I notice that for x=0-128, St72334 can receive the byte correctly. For x=129-255, ST72334 receive the byte wrongly, always receive ''0''.

    May I know why this happen and how do I solve this problem?

    Please help ASAP coz I am now stuck and cannot continue the development.

    Thanks.

    regards,

    St72334 user.

    :(

    Visitor II
    January 26, 2006
    Posted on January 26, 2006 at 08:22

    Hi,

    did you still record the transferred data signals with an oscilloscope? Are they correct?

    Of my experience I may not beleave, that the µC doesn't work correctly in your configuration.

    But: What sense does it make to clear port PE4 and to set PE0 (TD0) and PE1 (RDI)????

    btw.: You can fix exactly the same baudrate using the prescaler of the Baud Rate Register (BRR) SCP=13 and SCT = SCR = 2.

    Regards

    WoRo