RDxGladi
Newbie level 3
- Joined
- Feb 9, 2013
- Messages
- 3
- Helped
- 0
- Reputation
- 0
- Reaction score
- 0
- Trophy points
- 1,281
- Activity points
- 1,311
Hi everyone i'm new to this forum i have searched desperately everywhere for a solution but i just cannot get the pic to work :roll::roll::roll::roll: i wrote a code first which was rather big but once i burned it i couldnt get any output out of pic but than i wrote a simple programe which just toggled PORTB of the PIC uC and again i couldnt get the pic to work i even hooked it up with a voltmeter to check if i can get any output at any portB pin but nothing. Well than someone suggested that i should burn the hex code than try to read and and compare the two so i did. but the code i burned and read were different now i have no idea what should my next approach be i have searched everywhere desperately for help i have a final year project on pic and i even cant get the damn thing to work please please any help will be greatly appreciated btw im using mplab ide v 8.87
this is my simple code
#include<pic.h>
#include<htc.h>
//#include <htc.h>
//#include <xc.h>
//#FUSES HS
#define data PORTB
#define FOSC=4Mhz
#define _XTAL_FREQ 4e6 // 4MHz
#ifndef _XTAL_FREQ
#define _XTAL_FREQ 4MHZ /* Crystal frequency in MHz */
#endif
#define XTAL 4000000
#define RS RD0
#define EN RD1
#define PB PORTB;
__CONFIG(HS & WDTDIS & PWRTEN & BORDIS & LVPDIS);
void delay_ms(int x)
{
int i,j;
for(i=0;i<165;i++){
for(j=0;j<x;j++){
}
}
}
void main()
{
TRISB=0x00;
while(1){
PORTB=0x00;
delay_ms(100);
PORTB=0xFF;
delay_ms(100);
}
}
this is my simple code
#include<pic.h>
#include<htc.h>
//#include <htc.h>
//#include <xc.h>
//#FUSES HS
#define data PORTB
#define FOSC=4Mhz
#define _XTAL_FREQ 4e6 // 4MHz
#ifndef _XTAL_FREQ
#define _XTAL_FREQ 4MHZ /* Crystal frequency in MHz */
#endif
#define XTAL 4000000
#define RS RD0
#define EN RD1
#define PB PORTB;
__CONFIG(HS & WDTDIS & PWRTEN & BORDIS & LVPDIS);
void delay_ms(int x)
{
int i,j;
for(i=0;i<165;i++){
for(j=0;j<x;j++){
}
}
}
void main()
{
TRISB=0x00;
while(1){
PORTB=0x00;
delay_ms(100);
PORTB=0xFF;
delay_ms(100);
}
}