+ Post New Thread
Results 1 to 1 of 1
- 19th December 2011, 06:22 #1
- Join Date
- Dec 2011
- 0 / 0
PIC 18F4550 code on microC pro, simulation on Proteus not working!
Hello every one, I have been facing a problem regarding my code for PIC for quite a few days now,
I am new to PIC programming in microC since i have only worked on 8051 microcontrollers and keil,
I would really appreciate it if some one can kindly tell me what am I doing wrong in the code given below!
// code to switch on LED when push button at pin RA0 is pressed and off when it is released
sbit LED at RB0_bit;
sbit LED_Direction at TRISB0_bit;
sbit SW at RA0_bit;
sbit SW_Direction at TRISA0_bit;
CMCON = 0x07;
LED_Direction = 0; // setting pin B0 as output
SW_Direction= 1 ; // setting pin A0 as input
TRISD= 0; // setting port D as output
PORTD = 0xff;
PORTD = 0x0f;
its a simple code to switch on and Off an LED when button is pressed but its not simulating in proteus!
thank you in advance
here is the proteus design
Last edited by Uptech19; 19th December 2011 at 06:33.
- 19th December 2011, 06:22