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 ><
 

Attachments

  • Imagine0455.jpg
    233.9 KB · Views: 282
you have to make some effort. Lets see the code you have so far. Which compiler ?
 
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
 
Do you have a schematic with the PIC, and all other hardware connected to it ?
 
Last edited:
pic18f4520

some pictures:
 

Attachments

  • screenshot.2.jpg
    92.9 KB · Views: 246
  • screenshot.3.jpg
    108.4 KB · Views: 242
  • screenshot.5.jpg
    87.4 KB · Views: 227
It is doubtful you are going to get any help here.
So far you have posted a program that blinks a LCD backlight and the pinouts for your PIC.

Do you expect us to do all the work for you ?
 
u mean you C, not C++. MPLAB does not have a compliler that supports C++ that I know of.
 
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…