Problem with UART and Microcontrollers

Status
Not open for further replies.

masiha308

Newbie level 4
Joined
Apr 18, 2010
Messages
7
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Location
iran
Activity points
1,331
UART and Microcontroller

Hello;
I want to transmit and receive some data between two Microcontrollers wirelessly. Therefore, I buy two microcontrollers, one transmitter and one receiver.
Microcontroller: PIC16F877A
Receiver: ARX-433-ULC
Transmitter: ATX-433-IA
Modulation Protocol of Transmitter and receiver is OOK (on-off-keying) .I think if I use UART (Universal asynchronous receiver transmitter) for data telemetry It work good .therefore, I write a program that is UART base data transmission by wire I test It and It work well, but when I use transmitter receiver for data telemetry(wirelessly test) It don’t work.
Do you have any idea?

Regards
 

Re: UART and Microcontroller

Do you send some preamble bytes before the main data?
 

Re: UART and Microcontroller

This is my Program
It give tree number by keypad and send it by UART
/////////////MASTER\\\\\\\\\\\\\\
#include <16F877A.h>
#use delay(clock=20000000)
#include <K4X4.c>
#use rs232(baud=1221,xmit=PIN_C6,rcv=PIN_C7)
void main(){
unsigned int8 i=0,t=0,m=0,result=0;
set_tris_a (0x00);
kbd_init();
setup_ccp1(CCP_PWM);
set_pwm1_duty(80);
setup_timer_2(T2_DIV_BY_16,150,1);
main:
do {
i=kbd_getc();
} while(i=='\0');
do {
t=kbd_getc();
}while(t=='\0');
do {
m=kbd_getc();
} while(m=='\0');
result=((i*100)-4800)+((t*10)-480)+((m)-48);
output_high(PIN_A0);
putc(result);
//printf(lcd_putc,"\f%u",result);
output_low(PIN_A0);
goto main;
}

/////////////////SLAVE\\\\\\\\\\\\\\\\\\\\
#include <16F877A.h>
#use delay(clock=20000000)
#include <K4X4.c>
#include <LCD.c>
#use rs232(baud=1221,xmit=PIN_C6,rcv=PIN_C7)
void main(){
unsigned int8 p=0,value=0;
lcd_init();
lcd_putc("HELLO");
// delay_ms(10000);
while(true){
p=getc();
printf(lcd_putc,"\f%u",p);
}
}

DO you work by OOK Transmitter....
 

Status
Not open for further replies.

Similar threads

Cookies are required to use this site. You must accept them to continue using the site. Learn more…