Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

ir remote control problem

Status
Not open for further replies.

falcon00002002

Newbie level 3
Joined
Sep 28, 2012
Messages
4
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,306
hi all
i make a send receive remote control to on or off 8 leds with 2 pic 16f628a
using mikroc manchester lib
when i connect tx and rx with 2 copper wire it work very well and when i connect tx to irled and rx to ir receiver with pnp transistor it dont work
can you help me to solve this problem ?
 

hi
can you tell me the frequency out from pic manchester lib when i use 4MHZ external crystal ?
i need 38khz to send and receive infrared .

- - - Updated - - -

c code for send

Code:
sbit MANTXPIN at Ra1_bit;
sbit MANTXPIN_Direction at TRISa1_bit;
char index, character;
int se;
void send()
{Delay_ms(50);
 Man_Send(0x0B);
 Delay_ms(50);
 Man_Send(se);
 Delay_ms(50);
 Man_Send(0x0E);}
void main()
{cmcon = 7;
 trisa=0b00011101;
 trisb=0xff;
 Man_Send_Init();
 se=0;
 for(;;)
 {if(rb0_bit==1)
  {se= 10;
   send();
   do{delay_ms(50);}
   while(rb0_bit==1);}
  if(rb1_bit==1)
  {se=11;
   send();
   do{delay_ms(50);}
   while(rb1_bit==1);}
  if(rb2_bit==1)
  {se=12;
   send();
   do{delay_ms(50);}
   while(rb2_bit==1);}
  if(rb3_bit==1)
  {se=13;
   send();
   do{delay_ms(50);}
   while(rb3_bit==1);}
  if(rb4_bit==1)
  {se=15;
   send();
   do{delay_ms(50);}
   while(rb4_bit==1);}
  if(rb5_bit==1)
  {se=16;
   send();
   do{delay_ms(50);}
   while(rb5_bit==1);}
  if(rb6_bit==1)
  {se=17;
   send();
  do{delay_ms(50);}
   while(rb6_bit==1);}
  if(rb7_bit==1)
  {se=18;
   send();
   do{delay_ms(50);}
   while(rb7_bit==1);}
  if(ra0_bit==1)
  {se=20;
   send();
   do{delay_ms(50);}
   while(ra0_bit==1);}
  if(ra2_bit==1)
  {se=22;
   send();
   do{delay_ms(50);}
   while(ra2_bit==1);}
  if(ra3_bit==1)
  {se=23;
   send();
   do{delay_ms(50);}
   while(ra3_bit==1);}
   if(ra4_bit==1)
  {se=24;
   send();
   do{delay_ms(50);}
   while(ra4_bit==1);}
 }
}

c code for receive

Code:
sbit MANRXPIN at RA4_bit;
sbit MANRXPIN_Direction at TRISa4_bit;
char error, ErrorCount, temp;
void main()
{trisa=0b00010000;
 trisb=0;
 porta=0;
 portb=0;
 ErrorCount = 0;
 cmcon  = 7;
 Man_Receive_Init();
 for(;;)
 {while (1)
  {temp = Man_Receive(&error);
   if (temp == 0x0B)
    break;
   if (error)
   {ErrorCount++;
    if (ErrorCount > 10)
    {Man_Synchro();
     ErrorCount = 0;
     break;}
  }}
  do
  {temp = Man_Receive(&error);
   if (temp == 10)
    {rb0_bit=!rb0_bit;}
   if (temp == 11)
    {rb1_bit=!rb1_bit;}
   if (temp == 12)
    {rb2_bit=!rb2_bit;}
   if (temp == 13)
    {rb3_bit=!rb3_bit;}
   if (temp == 15)
    {rb4_bit=!rb4_bit;}
   if (temp == 16)
    {rb5_bit=!rb5_bit;}
   if (temp == 17)
    {rb6_bit=!rb6_bit;}
   if (temp == 18)
    {rb7_bit=!rb7_bit;}
   if (temp == 20)
    {ra0_bit=!ra0_bit;}
    if (temp == 22)
    {ra1_bit=!ra1_bit;}
   if (temp == 23)
    {ra2_bit=!ra2_bit;}
   if (temp == 24)
    {ra3_bit=!ra3_bit;}
   Delay_ms(25);
  }
  while (temp != 0x0E);
}}
 
Last edited:

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top