http://www.melabs.com/resources/samples.htm#proCode:' Example program from manual to blink an LED connected to PORTB.0 about once a second loop: High 0 ' Turn on LED connected to PORTB.0 Pause 500 ' Delay for .5 seconds Low 0 ' Turn off LED connected to PORTB.0 Pause 500 ' Delay for .5 seconds Goto loop ' Go back to loop and blink LED forever End
Hope this helps..
"It will never happen here!" just happened here.
My thoughts and prayers for Sandy Hook victims and families.
I know its tough, but count to ten, take deep breaths and read Mels most http://www.picbasic.co.uk/forum/show...99&postcount=1
If you look at his code, there is some logic in his thinking, he has made an attempt to write a program, which doesn't work, and thus came here seeking assistance...
Hi,
First of all let's leave guns and knives outside ...
Won't you think a little ( real ! ) SCHEME would be compulsory, here ???
just to verify how and what to inputs and outputs are linked ...
"my two cents"
Alain
************************************************** ***********************
Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
************************************************** ***********************
IF there is the word "Problem" in your question ...
certainly the answer is " RTFM " or " RTFDataSheet " !!!
*****************************************
I need to disable writing to external eeprom few secconds after power is applyed. So, GPIO.2 pin is connected to the WP pin of eeprom, and GPIO.0 pin have +5V when eeprom have +5V. Between VCC and MCLR is 4K7.
I know this is very simply for most of you, but this is my first program, and it has practical purpose.
Regards
Last edited by rele; - 27th July 2008 at 13:12.
I think the point that skimask was trying to get over, is that for a 1st program, the main goal is to get the chip to flash a LED correctly, then go on to develope that.
A golden rule here is to look at the datasheet, and then set the pic up accordingly. Often these small chips don't have their pins set to digital i/o by default, so need the config set accordingly.
Once you have a bit of code that blinks an LED, then introduce inputs and modify the code to get the result you want.
Hi,
NOOOOOO ... nothing is simple !!!
We still do not know what is connected to your Pic I/Os ...
Just remember if hardware is False ... software can't work as expected !!! ... and vice versa.
We must know everything of your project, if you want us to give a serious answer.
Now, for some fun ...
You ask for help...Ok, but you do not tell us even if it works ... How do you verify GPIO.2 works ( or doesn't work ! ) properly ???
How do you drive GPIO.0 ???
For the day,We do not use the crystal ball on this Forum ... so, you must do your "part of the work" of debugging, and tell us what's on your side ...
Alain
************************************************** ***********************
Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
************************************************** ***********************
IF there is the word "Problem" in your question ...
certainly the answer is " RTFM " or " RTFDataSheet " !!!
*****************************************
Pin1 - +5V
Pin2 - N/C
Pin3 - N/C
Pin4 - +5V thru 4K7
Pin5 - Output pin
Pin6 - N/C
Pin7 - Input pin
Pin8 - GND
Output pin is connected directly to WP pin of external eeprom. Input pin is connected directly to VCC pin of external eeprom. Purpose of program is to disable writing to external eeprom for 3 secconds after power is applyed to eeprom.
I verify condition of GPIO.2 with logic probe.
Regards
Bookmarks