This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Why SMOD does not work

When I configure uart communication of ADE7169 device(enhanced 8052 core),I encountered a problem that comment out or not the code (MOV PCON,#80H ;Here is not wor)(line 5)
does not affect uart's baud.But as document description,SMOD (PCON MSB) will double baudrate if it is assert.I am sure I have assert SMOD ,because when I monitor sfr's state,i find this bit is set to one.
Who know why?who can help me?
Thank you in advanced!
My code is follow:
MOV RCAP2L,#0AFH ;
MOV RCAP2H,#0FFH ;
MOV TL2,#0AFH ;
MOV TH2,#0FFH ;
;MOV PCON,#80H ;Here is not work
MOV T2CON,#34H ;SET timer2
MOV SCON,#50H ;MODE1 and ENABLE RECV
SETB EA ;GLOBAL INTERRUPT ENABLE
SETB ES ;SERIAL INTERRUPT ENABLE

Parents
  • My keil version is 808a.
    I am sure that PCON MSB(SMOD) is asserted.I open peripherals -> serial.In this windows SMOD1 will be changed if I add such code(mov PCON,#80h;)in my program.But Transmit Baudrate and Receive Baudrate looks like no change if I add such code.

    The showned value in "serial channel" has been doubled,isn't it?Or, When SMOD1 = 1,real uart baudrate equals Baudrate showned in "serial Channel" windows times 2.Am I right?

    I want to set uart work at mode2,Tranmit Baudrate and Receive Baudrate depends on timer2.My code above is correct or not? Thanks in advance!

Reply
  • My keil version is 808a.
    I am sure that PCON MSB(SMOD) is asserted.I open peripherals -> serial.In this windows SMOD1 will be changed if I add such code(mov PCON,#80h;)in my program.But Transmit Baudrate and Receive Baudrate looks like no change if I add such code.

    The showned value in "serial channel" has been doubled,isn't it?Or, When SMOD1 = 1,real uart baudrate equals Baudrate showned in "serial Channel" windows times 2.Am I right?

    I want to set uart work at mode2,Tranmit Baudrate and Receive Baudrate depends on timer2.My code above is correct or not? Thanks in advance!

Children