CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

RF module don't work, where is the problem?

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
skillfox



Joined: 21 Oct 2011
Posts: 2

View user's profile Send private message

RF module don't work, where is the problem?
PostPosted: Fri Oct 21, 2011 9:44 am     Reply with quote

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: 9229
Location: Greensville,Ontario

View user's profile Send private message

PostPosted: Fri Oct 21, 2011 11:10 am     Reply with quote

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

View user's profile Send private message

hi
PostPosted: Fri Oct 21, 2011 11:33 am     Reply with quote

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.
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
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