|
|
View previous topic :: View next topic |
Author |
Message |
skillfox
Joined: 21 Oct 2011 Posts: 2
|
RF module don't work, where is the problem? |
Posted: Fri Oct 21, 2011 9:44 am |
|
|
RF module don't work, where is the problem?
Transmitter:
Code: |
#include <16f877A.h> // Kullanılacak denetleyicinin başlık dosyası tanıtılıyor.
#fuses XT,NOWDT,NOPROTECT,NOBROWNOUT,NOLVP,NOPUT,NOWRT,NODEBUG,NOCPD
#use delay (clock=4000000)
#use rs232 (baud=600, xmit=pin_C6, rcv=pin_C7)
#byte lcdport = 0x06
#byte lcdport_tris = 0x86
#include "3310.h"
char islem=0;
unsigned int a=0;
#int_rda
void serial_isr() {
islem=getch();
//putc(islem);
//disable_interrupts(int_rda);
}
void init()
{
lcdport_tris = 0x00; // lcdport all bits are outputs
port_b_pullups(TRUE);
nokia_init();
}
void main ()
{
init();
enable_interrupts(int_rda);
#if defined(__PCD__)
enable_interrupts(intr_global);
#else
enable_interrupts(global);
#endif
while(TRUE)
{
// delay_ms(10000);
//islem="null";
//islem=bgetc();
if (islem=='R'||islem=='r')
{ nokia_clean_ddram();
nokia_gotoxy(8,2);
printf(nokia_printchar," R geldi. ");
for(a=0;a<5;a++)
putc(0b01010101);
putc('x');
putc('R');
islem=0;
if (kbhit()) break;
}
if (islem=='L'||islem=='l')
{
nokia_clean_ddram();
nokia_gotoxy(8,2);
printf(nokia_printchar," L geldi. ");
for( a=0;a<5;a++)
putc(0b01010101);
putc('x');
putc('L');
islem=0;
if (kbhit()) break;
}
if (islem=='N'||islem=='n')
{
nokia_clean_ddram();
nokia_gotoxy(8,2);
printf(nokia_printchar," N geldi. ");
for( a=0;a<5;a++)
putc(0b01010101);
putc('x');
putc('N');
islem=0;
if (kbhit()) break;
}
if (islem=='U'||islem=='u')
{
nokia_clean_ddram();
nokia_gotoxy(8,2);
printf(nokia_printchar," U geldi. ");
for( a=0;a<5;a++)
putc(0b01010101);
putc('x');
putc('U');
islem=0;
if (kbhit()) break;
}
if (islem=='S'||islem=='s')
{
nokia_clean_ddram();
nokia_gotoxy(8,2);
printf(nokia_printchar," S geldi. ");
for( a=0;a<5;a++)
putc(0b01010101);
putc('x');
putc('S');
islem=0;
if (kbhit()) break;
}
}
}
|
Receiver 628a:
Code: |
#include <16f628A.h>
#fuses XT,NOWDT,NOPROTECT,NOBROWNOUT,NOLVP,NOPUT,NOCPD
#use delay (clock=4000000)
#use rs232 (baud=600, xmit=pin_b2, rcv=pin_b1)
int i=0,hiz=80;
char m=0,n=0;
const int yarim_adim[]={0x01,0x03,0x02,0x06,0x04,0x0C,0x08,0x09};
#int_rda
void seri_int()
{
if(getc()=='x')
m='x';
n=getc();
}
void main()
{
char a=0,temp=0;
enable_interrupts(int_rda);
#if defined(__PCD__)
enable_interrupts(intr_global);
#else
enable_interrupts(global);
#endif
while(TRUE)
{
if(m=='x')
{
i = 0;
a=n;
if(a=='U')
{
hiz-=10;
a = temp;
}
if(a=='N')
{
hiz+=10;
a = temp;
}
if(a=='R')
{
temp = 'R';
for (;i<8;i++)
{
output_A(yarim_adim[i]);
delay_ms(hiz);
if (i==7)
i=0;
if (kbhit()) break;
}
}
if(a=='L')
{
temp = 'L';
for (;i>=0;i--)
{
if (i==0)
i=7;
output_a(yarim_adim[i]);
delay_ms(hiz);
if (kbhit()) break;
}
}
}
}
if(a=='S')
output_a(0x00);
} |
and photo about my circuit.
|
|
|
temtronic
Joined: 01 Jul 2010 Posts: 9244 Location: Greensville,Ontario
|
|
Posted: Fri Oct 21, 2011 11:10 am |
|
|
You don't post what RF module or a link to it's datasheet.
First thing I'd do is remove the RF modules and connect the PICs together serial-serial and verify taht the code actually works. If it works, then the RF modules are at fault, or the wiring to them, or some other problem... |
|
|
skillfox
Joined: 21 Oct 2011 Posts: 2
|
hi |
Posted: Fri Oct 21, 2011 11:33 am |
|
|
temtronic wrote: | You don't post what RF module or a link to it's datasheet.
First thing I'd do is remove the RF modules and connect the PICs together serial-serial and verify that the code actually works. If it works, then the RF modules are at fault, or the wiring to them, or some other problem... |
Now i tried rf module and its working. I add a button to 877 and led to 628 and when i push the button led is lighting. And I look the data sheets everything is right
I have some problems about Codes. I'm waiting for ideas. |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|