I will do these changes what about other error......??RX_PIN = 1;
TX_PIN = 1;
i have not written this code i have just manipulated using hi tech samples and yours in previous post...
I will do these changes what about other error......??RX_PIN = 1;
TX_PIN = 1;
#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
void Initialize (void); //<----- YOU FORGOT THE "void's"
void main ()
{
Initialize (); <---- YOU FORGOT THE";" {
while(1)
{
putchar('H'); //print the letter 'H'
putchar('i'); //print 'i'
putchar('\r'); // return to beginning of line
putchar('\n'); //new line
}
}
void Initialize () //<----- YOU FORGOT THE "void"
{
RX_PIN = 1;
TX_PIN = 0;
SPBRG = DIVIDER;
RCSTA = (NINE_BITS|0x90);
TXSTA = (SPEED|NINE_BITS|0x20);
}
#include <htc.h>
#include "usart.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
void Initialize ();
void main ()
{
Initialize ();
while(1)
{
putch('H'); //print the letter 'H'
putch('i'); //print 'i'
putch('\r'); // return to beginning of line
putch('\n'); //new line
}
}
void Initialize ()
{
RX_PIN = 1;
TX_PIN = 0;
SPBRG = DIVIDER;
RCSTA = (NINE_BITS|0x90);
TXSTA = (SPEED|NINE_BITS|0x20);
}
#include <htc.h>
__CONFIG(LVP_OFF & BOREN_OFF & PWRTE_ON & WDTE_OFF & FOSC_HS);
#define _XTAL_FREQ 20000000
unsigned char HSerin(void);
void HSerout(unsigned char ch), HSerinit(void);
void main(void) // program entry
{
int index = 0;
unsigned char ch;
ADCON1 = 0x6; // Analogue off
HSerinit();
__delay_ms(150);
while(1) // endless Loop
{
ch = HSerin(); // wait for a character
HSerout(ch); // Echo back
}
}
void HSerinit()
{
TRISC = 0xC0; // should ideally be set
SPBRG = 129; // 20Mhz xtal 9600 BAUD
TXSTA = 0x24; // TXEN and BRGH
RCSTA = 0x90; // SPEN and CREN
}
void HSerout(unsigned char ch)
{
while(!TXIF); // Wait for module to finish
TXREG = ch; // ready to send
}
unsigned char HSerin()
{
while(!RCIF); // Wait for a character
return RCREG; // return character
}
With the last module you linked, you may not be able to. That was suggested for inter-PIC communication. This is why I didn't want to talk about PICs talking to each other just yet...HI,
I am using this code with this terminal program for window 7 plaese tell what setting to do iam unable to type in this window...
Just for now forgot the wireless 2.4ghz module...That module claims 2.4GHz communication,
I mean to say terminal window screen how to comm to computer using window 7 and all this pic uC and usb tll i linked in previous post!!You can't write on the screen because you are writing to a port.
by Duane Benson
by Jake Hertz
by Aaron Carman
by Robert Keim