Hi,
I need USART for one uC to another uC also plaese tell what changes to be done ??
I need USART for one uC to another uC also plaese tell what changes to be done ??
Have you gotten your interface module yet? You can check it that way...OK, i have edited the code..is this fine now???
I have installed PIC oshon simulator can't we test in it?
Rich (BB code):#include <htc.h> __CONFIG(LVP_OFF & BOREN_OFF & PWRTE_ON & WDTE_OFF & FOSC_HS); #define _XTAL_FREQ 20000000 #define NINE 0 /* Use 9bit communication? FALSE=8bit */ #define BAUD 9600 #define RX_PIN TRISB2 #define TX_PIN TRISB5 #define DIVIDER ((int)(_XTAL_FREQ/(16UL * BAUD) -1)) #if NINE == 1 #define NINE_BITS 0x40 #else #define NINE_BITS 0 #endif #if HIGH_SPEED == 1 #define SPEED 0x4 #else #define SPEED 0 #endif Initialize (); /* TRISC=0X00; TX9=0; TXEN=1; SYNC=0; BRGH=0; SPEN=1 RX9=0; CREN=0; FERR=0; OERR=0; SPBRG=31;*/ void main () { Initialize (); //initialize device while(1) { putch('H'); //print the letter 'H' putch('i'); //print 'i' putch('\r'); // return to beginning of line putch('\n'); //new line } } /* Serial initialization */ Initialize (){ RX_PIN = 1; TX_PIN = 1; SPBRG = DIVIDER; RCSTA = (NINE_BITS|0x90); TXSTA = (SPEED|NINE_BITS|0x20); }
How many variables would you like to work with? Stick to getting one communicating to the computer, then you can rest assured you have one working interface before trying to add another device...Hi,
I need USART for one uC to another uC also plaese tell what changes to be done ??
WHat are trying to say?Might I suggest-again- that you focus on actually doing this before adding new variables to the situation?
Stick to trying to get a single PIC communicating with a computer, then move on to getting two PICs talking to each other. That way when you do move to two PICs communicating, you can know that at least one PIC is operating properly, and know a problem, if one exists, lies with the other PIC.WHat are trying to say?
please tell fast i have to ordered it!
OK, then this code is fine and how to test in any simulator like oshonStick to trying to get a single PIC communicating with a computer, then move on to getting two PICs talking to each other. That way when you do move to two PICs communicating, you can know that at least one PIC is operating properly, and know a problem, if one exists, lies with the other PIC.
#include <htc.h>
__CONFIG(LVP_OFF & BOREN_OFF & PWRTE_ON & WDTE_OFF & FOSC_HS);
#define _XTAL_FREQ 20000000
#define NINE 0 /* Use 9bit communication? FALSE=8bit */
#define BAUD 9600
#define RX_PIN TRISB2
#define TX_PIN TRISB5
#define DIVIDER ((int)(_XTAL_FREQ/(16UL * BAUD) -1))
#if NINE == 1
#define NINE_BITS 0x40
#else #define NINE_BITS 0
#endif #if HIGH_SPEED == 1
#define SPEED 0x4
#else #define SPEED 0
#endif Initialize (); /*
TRISC=0X00;
TX9=0;
TXEN=1;
SYNC=0;
BRGH=0;
SPEN=1 RX9=0;
CREN=0;
FERR=0;
OERR=0
SPBRG=31;*/ void main () {
Initialize (); //initialize device
while(1) {
putch('H'); //print the letter 'H'
putch('i'); //print 'i'
putch('\r'); // return to beginning of line
putch('\n'); //new line } }
OK, i will work with it later at least can you suggest me which one will be fine ??
The first ones are one-way communication and have no encoding scheme, so you'd have to provide one. These are pretty hard to use outright, so I would suggest another module.OK, i will work with it later at least can you suggest me which one will be fine ??
can i use that low cost Rx and Tx Rs 350/. pair ??
My Aim is to control Speed of PMDC motor wireless...!!
I could not agree more. I would start setting up the PIC to just send some well known strings in an endless loop to a terminal program in a PC. Then this is working 100% It is time to do the receive part on the PIC. Use the terminal program and set the PIC up to echo any char typed in on the terminal program. Then you have those part working and ONLY then. You are ready for more complicated work. Then you try to run before you can walk. You will only stumble, and then come crying to the forum asking for comfort. Then this happen to often. The forum will get weary and ignore youStick to trying to get a single PIC communicating with a computer, then move on to getting two PICs talking to each other. That way when you do move to two PICs communicating, you can know that at least one PIC is operating properly, and know a problem, if one exists, lies with the other PIC.
I had buy that Tx and Rx module i only need to send the ADC result to another uC.....!!The first ones are one-way communication and have no encoding scheme, so you'd have to provide one. These are pretty hard to use outright, so I would suggest another module.
Now i have get this so, please tell how to use it??That kit is way to complex for you. This is what you need http://robokits.co.in/shop/index.php...products_id=64
1.) buy the module suggested
2.) plug the module in to the PIC. Rx of module to TX of PIC and TX if module to Rx of PIC
3.) write program that will use the PIC's UART module to send data, with the correct configuration (baud rate, stop bits, parity, etc.) to be compatible with the USB to TTL module.
4.) use a terminal program (i.e. hyperterminal or TeraTerm) to connect to the virtual COM port that is created for the USB to TTL-again, with the same configuration add both the PIC and USB to TTL module are using and watch the data stream.
Download driver from that page. Install the driver. Then plug it in.Now i have get this so, please tell how to use it??
and how?