EngineersGarage

  • Engineers Garage Main Site
  • Visit our active EE Forums
    • EDABoard.com
    • Electro-Tech-Online
  • Projects & Tutorials
    • Circuits
    • Electronic Projects
    • Tutorials
    • Components
  • Digi-Key Store
    • Cables, Wires
    • Connectors, Interconnect
    • Discrete
    • Electromechanical
    • Embedded Computers
    • Enclosures, Hardware, Office
    • Integrated Circuits (ICs)
    • Isolators
    • LED/Optoelectronics
    • Passive
    • Power, Circuit Protection
    • Programmers
    • RF, Wireless
    • Semiconductors
    • Sensors, Transducers
    • Test Products
    • Tools
  • Advertise
You are here: Home / Topics / Help me i”m newbie ( IR tranfer data)

Help me i”m newbie ( IR tranfer data)

|

Projects › Projects › Help me i”m newbie ( IR tranfer data)

  • This topic has 2 replies, 2 voices, and was last updated 12 years, 7 months ago by AJISH ALFRED.
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • July 13, 2013 at 5:12 pm #2538
    Hung
    Participant

    Hi there.

     I want to design the project IR  .

    That is mean inftrared data transmisstion with the PIC microcontrller.

     so i saw some projects  and i saw the code, but i dont understand 

     

    the  value of clock . i mean how many. the value of Crystal . 3Mhz, 4Mhz….so on. please help me. anybody .

     

     

     the code:

    #include<p18f452.h>
    #pragma config OSC=HSPLL, WDT=OFF,BOR=OFF,PWRT=ON
    voidputch(char byte)
    {
    while (!PIR1bits.TXIF);
    TXREG = byte;
    }
    chargetch(void)
    {
    while (!PIR1bits.RCIF);
    return RCREG;
    }
    voidwait800us(void)
    {
    int x = 610;
    while(x–);
    }
    voidmain(void)
    {
    //initializevariables
    charinput, whichBit,temp, total;
    //initializeserial registers
    TXSTAbits.TXEN = 1;
    RCSTAbits.SPEN = 1;
    RCSTAbits.CREN = 1;
    SPBRG = 0x40;
    //Setup PORTB
    INTCON2bits.RBPU= 0;
    TRISB = 0x0F;
    PORTB = 0;
    //Setup Timer2
    T2CON = 0x79; //PRE= 4 POST= 16
    PR2 = 187;
    putch(‘R’);
    putch(‘x’);
    putch(0x0D);
    putch(0x0A);
    while(1)
    {
    while(!PORTBbits.RB0);
    T2CONbits.TMR2ON= 1;
    whichBit= 0;
    total= 0;
    while(whichBit< 8)
    {
    while(!PIR1bits.TMR2IF);
    PR2 = 125;
    PIR1bits.TMR2IF= 0;
    if(PORTBbits.RB0== 0)
    {
    temp= 1 << whichBit;
    total += temp;
    }
    whichBit++;
    }
    putch(total);
    T2CONbits.TMR2ON= 0;
    PR2 = 187;
    }
    }
    July 14, 2013 at 8:59 am #10141
    Hung
    Participant

    Hey . I need your help. plz

     

    July 14, 2013 at 5:15 pm #10144
    AJISH ALFRED
    Participant

    Hi,

    Please post the circuit diagram or block diagram of the code so that we can help you with exact answers

  • Author
    Posts
Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.
Log In

RSS Recent Posts

  • What diode should I use? March 7, 2026
  • LM016L + PCF8574 I2C Backpack Schematic with Backlight Control March 7, 2026
  • Expensive hobby March 7, 2026
  • USING EASYEDA BUT SOMETHING ISN'T RIGHT? March 7, 2026
  • What is this component and what is its function? March 6, 2026

Stay Up To Date

Newsletter Signup
EngineersGarage

Copyright © 2026 WTWH Media LLC. All Rights Reserved. The material on this site may not be reproduced, distributed, transmitted, cached or otherwise used, except with the prior written permission of WTWH Media
Privacy Policy | Advertising | About Us

Search Engineers Garage

  • Engineers Garage Main Site
  • Visit our active EE Forums
    • EDABoard.com
    • Electro-Tech-Online
  • Projects & Tutorials
    • Circuits
    • Electronic Projects
    • Tutorials
    • Components
  • Digi-Key Store
    • Cables, Wires
    • Connectors, Interconnect
    • Discrete
    • Electromechanical
    • Embedded Computers
    • Enclosures, Hardware, Office
    • Integrated Circuits (ICs)
    • Isolators
    • LED/Optoelectronics
    • Passive
    • Power, Circuit Protection
    • Programmers
    • RF, Wireless
    • Semiconductors
    • Sensors, Transducers
    • Test Products
    • Tools
  • Advertise