We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
I am confused how to use UART 1 in P89c669.
Normally for using UART 0 i follow the below register initialization.
SCON = 0x50; //Serial com in mode 1 and REN - 1 TMOD = 0x20; //Timer 1 in mode 2 - auto reload mode TH1 = 0xFD; //Timer 1 to operate at 19600 baud rate TL1 = 0x00; //since auto relaod mode TL1 = 0 TR1 = 1; //Run control bit to start the timer 1
So i check the RI and TI bit for reception and transmission.
In the datasheet it is mentioned that for UART 0 we can use Timer 1 or Timer 2 or Baud Rate generate register for generating the baud rate. But here i use Timer 1.
For using the UART 1 it is mentioned that we should use the baud rate generator register for communication.
Can anybody help me how to use UART 1 for serial port communication.
I want to use UART 1 same as that of UART 0.
Ur right.
But using the baud rate generator how to configure for serial port commnuication???
can we use UART 1 in the similar fashion of UART 0?
It looks like you need to configure bits SM0_1 and SM1_1 in S1CON for the number of data bits you want (8 or 9) then use this formula fOSC/(BRATE+16) were BRGR1 is the MSB of BRATE and BRGR0 is the LSB to get the baudrate you want. then enable the baudrate generator, BRGEN=1 in BRGCON.
ya i tried as what u said. but there was no output at all.actually i am using RS 232 to control a power supply.
The power supply can be controlled when i use UART 0. But with UART 1 it coudnt communicate.
I am not sure where the problem lies.
i also have problem in compile of code to add include of header "#include "maxim.h"" what is the problem?