Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Pic18f4520 -MPLAB IDE

Status
Not open for further replies.

temptation21

New Member
HI..i have a problem.. i have a project with name " designing an application (in MPLAB IDE) for interfacing with a remote IR signal (display key codes pressed)". Accessories: PIC18F4520, TSOP 1136, remote control ; pls if you can help me with the c++ CODE( main.c). an example please.. waiting for your answer ..thanks >:D<
 

Attachments

  • Imagine0455.jpg
    Imagine0455.jpg
    233.9 KB · Views: 229
Compiler: MCC18 (MPLAB (R) C18 Compiler). I tried using an oscilloscope to check if the remote control signal receiving tsop1136.
source code so far:
/***********************************************
main.c
project
LED toggle
Hardware: KT458-V0 (PIC18F4520)
nucleus: K5420 V1.0
Home address Firmware: 0x400
resources used:
RC5 -LCD backlight output
***********************************************/
/***********************************************
files included
***********************************************/
#include <p18cxxx.h>
/***********************************************
prototypes
***********************************************/
void high_isr(void);
void low_isr(void);
/***********************************************
Redirect interruptions
***********************************************/
#pragma code high_vector = 0x408
void interrupt_at_high_vector(void)
{
_asm
goto high_isr
_endasm
}//end interrupt_at_high_vector
#pragma code low_vector = 0x418
void interrupt_at_low_vector(void)
{
_asm
goto low_isr
_endasm
}//end interrupt_at_low_vector
/***********************************************
Interrupt handler (ISR)
***********************************************/
#pragma code
#pragma interrupt high_isr
void high_isr(void)
{
}//end high_isr
#pragma interruptlow low_isr
void low_isr(void)
{
}//end low_isr
/***********************************************
main function
***********************************************/
#pragma code
void main(void)
{
int n = 0; // timer counter
// Initialization pin RC5
LATCbits.LATC5 = 0; //PORT initialization LATCH
TRISCbits.TRISC5 = 0; // RC5 - out
LATBbits.LATB0=1;
TRISBbits.TRISB0=1;
while(1)
{
n++;
if(n == 0)
LATCbits.LATC5 = !LATCbits.LATC5; // Toggle backlight
}//end while
}//end main
/***********************************************
End Of File main.c
***********************************************/

How to receive & read the signal? How to display the key code pressed?
--------
Thank you for your involvement.
------
temptation21
 
pic18f4520

some pictures:
 

Attachments

  • screenshot.2.jpg
    screenshot.2.jpg
    92.9 KB · Views: 205
  • screenshot.3.jpg
    screenshot.3.jpg
    108.4 KB · Views: 205
  • screenshot.5.jpg
    screenshot.5.jpg
    87.4 KB · Views: 186
Who made the board in the Picture in post 1 you can make out a KIT something?
 
Status
Not open for further replies.
Back
Top