Skip to main content
debruyne.marc
Associate III
Oct 29, 2012 6:25 AM UTC
Question

stm8 uart1

Posted on October 29, 2012 at 07:25

hello,

please can someone one help me with a uart problem on the stm8s

i use a crystal of 14.7456 Mhz , also i do the change of the clock system, see the atached program.

the uart1 is initialised as, pa4 and pa5,

also i use a second computer with the DOCKLIGHT program to analyze the communication.

the uart is set for 9600 baud, 1 stop , 7 data even parity

also the docklight program is set for that .

if i send one character from the stm8s to the other computer i see that character correct.

even with different characters

no if i send a character from the docklight program on the other computeri also see that character correct in the stm8s data ram

but if i will send a string of characters ,for example 

    81    82    83    84    85    from the docklight program,i receive  in the stm8s data ram

    81    82    03    84    05

i have tryed with other characters, and it seems then the 7 bit is always set to 1, some characters are correct

please , is there any idea what i do wrong in the program

see atached assembly program file

many thanks

marc debruyne

    This topic has been closed for replies.

    3 replies

    konay61
    Associate III
    Oct 30, 2012 12:21 PM UTC
    Posted on October 30, 2012 at 13:21

    Hi Marc,

    I can suggest a solution before thinking on it deeply, that is ANDing the received data by 0x7F. It may fix your problem.

    Good luck,

    Kadir    

    jdf25252
    Associate II
    Oct 30, 2012 2:32 PM UTC
    Posted on October 30, 2012 at 15:32

    Since you've configured your terminal program for 7 bits Even parity  you can only use the lower 7 bits for data.  Bit 7 will be adjusted to provide even parity in the transmitted data.  Unless you REALLY need parity checking you will be much better off if you config BOTH ENDS for 8 bit no parity.

    jdf

    debruyne.marc
    Associate III
    Oct 30, 2012 5:48 PM UTC
    Posted on October 30, 2012 at 18:48

    hello

    thank you for the information, i have tryed it , and its working

     many thanks

    marc debruyne