hi, i recently bought a PIC18F458 development board (
https://www.futurlec.com/PIC18F458_Development_Board.shtml). when the MC came the code examples were all in basic, but i'm not very good at it... but i have seen some PIC18f452 with C++ codes that one of my friends has written, and i tried to compile one of his 452 programs (that blinks an LED at RB0) with 458 header file. i used MPLAB and the c18 compiler.. and used the uploader program that came with my board (CP458V3.exe) to upload the program to my PIC.. but nothing happens, when i run it. but i have tried uploading a hex file that came with my board and it works, so i know my board works and the uploader as well works...
here follows the source code that i'm using.
/*
* This program blinks an LED at PORTB RB0.
*/
#include <p18f458.h> /* for TRISB and PORTB declarations */
#include <delays.h>
/*
* - set HS oscillator
* - disable watchdog timer
* - disable low voltage programming
*/
#pragma config OSC = HS
#pragma config WDT = OFF
#pragma config LVP = OFF
int on;
int off;
void main (void)
{
on = 0x01;
off = 0x00;
PORTA = 0; /*clear PORTB */
TRISA = 0; /* configure PORTB for output */
while (1)
{
PORTA = on;
Delay10KTCYx (255);
PORTA = off;
Delay10KTCYx (255);
}
}
so i would be very glad if any one could tell me what i'm doing wrong and how to correct it, or give me a C++ code example for PIC18F458. please help me... and i as well wanna to know if there is a difference between "hex files" and "intel hex files"...
i could be reached via email at
majestricx@hotmail.com, if needed...
thanks a lot
-Hasan