0 Usuarios y 1 Visitante están viendo este tema.
Saludos , primero que los pines tx y rx deben estar configurados como entradas, el usart hace el resto del trabajo, segundo que la hoja de aplicacion AN774 es lo mejor que hay para aprender a usar el usart, y ahi dice lo siguiente (haciendo referencia al primer codigo que posteo leon Pic)CitarNote: The user needs to ensure that the TXIFflag is never tested immediately following awrite to TXREG. If necessary, ‘NOP’ instruc-tions can be inserted but simply rearrang-ing the code is usually sufficient.Asi que ya sabes ponle un nop despues de hacer el movwf TXREG. y el problema tendria que solucionarse
Note: The user needs to ensure that the TXIFflag is never tested immediately following awrite to TXREG. If necessary, ‘NOP’ instruc-tions can be inserted but simply rearrang-ing the code is usually sufficient.
Bit SPEN (RCSTA<7>) and bits TRISB<2:1> have to be set in order to configure pins RB2/TX/CK and RB1/RX/DT as the Universal Synchronous Asynchronous Receiver Transmitter.