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.
Hi,
I've started using the micro XC864, but I've some doubt that I would be gratefully if some could response.
I'm trying to make an aplication controled by PC in which the micro recives some ordres by UART in pin P1.1 and then responses with the UART in the port p0.2 to another chip (a transceiver bluetooth).
My question is, that's is possible?, it seems that this chip just got one UART, so that can I change the port it's using during the program?, how I make it?.
I 've used "Dave" to generate the code but it don't let you do this changes during the program.
I attach the code used in order to choose the ports for each case that I've created with Dave:
/// Pin TXD_1 (P0.2) is selected for transmission /// Pin RXD_1 (P0.1) is selected for reception
SFR_PAGE(_pp2, noSST);// switch to page 2 without saving P0_ALTSEL0 &= ~(ubyte)0x04; // configure alternate function register 0 P0_ALTSEL1 |= (ubyte)0x04; // configure alternate function register 1 SFR_PAGE(_pp0, noSST); // switch to page 0 without saving P0_DIR |= (ubyte)0x04; // set output direction
/// Pin TXD_0 (P1.1) is selected for transmission /// Pin RXD_0 (P1.0) is selected for reception
SFR_PAGE(_pp2, noSST); // switch to page 2 without saving P1_ALTSEL0 &= ~(ubyte)0x02; // configure alternate function register 0 P1_ALTSEL1 |= (ubyte)0x02; // configure alternate function register 1 SFR_PAGE(_pp0, noSST); // switch to page 0 without saving P1_DIR |= (ubyte)0x02; // set output direction