i am designing a simple project using pic16f876a and hitech c complier (MPLAB ) . i want to send a value on port b.this is the daigram and the code m sending.please check the code and help me find out the mistake.i have defined pic16f876 and oscillator type crystal in mplab.
byee
for what i and j used for .? and what is the need of the infinite for loop ?
well i haven't used hitech c , but i think the code should set 0xAA on portb
There's no 'difference', but some compilers and assemblers are case sensitive, so one way might work and the other not work - you need to check your compiler to see if it's case sensitive.
I've never known a C compiler that cared about case in hex constants.
nit-picking aside, that program looks like it should work. the reason for the for loop is to prevent executing garbage when returning from main. he could just as well have done this
heh heh, maybe it's because there is no power or ground hooked up (missing from the schematic). Maybe the leds are in backwards. wrong crystal? maybe the chip isn't programmed. ...
Nothing wrong with your main code.
Most likely you have not set the config bits correctly.
Not having it hooked up right, osc not running, RESET pin held low, no Vdd & gnd, etc also possible.