Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

pic 16f690 reprogramed

Status
Not open for further replies.

be80be

Well-Known Member
I was playing with a 16f690 I reprogram it and the code i had in cblock didn't change from the first time I programed it. I never had that happen before.
Code:
Loop	
		movlw	0xff
		movwf	PORTC			;set all bits on
		nop
When i changed it to this it did the same thing it set all bits on then I blanked the chip and did it agin and it changed and worked like it should.
Code:
Loop	
		movlw	0x15
		movwf	PORTC			;set  bits 0-2-4
		nop
 
Last edited:

bananasiong

New Member
Hi,
What do you mean? Sending 0x00 to PORTC will make the outputs to be low, but not set all the bits.
 

be80be

Well-Known Member
I have 5 leds on portc 0to4 when I ran the code the first time it turned all 5 on I then reprogrammed the chip with
Code:
movlw	0x15
movwf	 PORTC
and all 5 came on agin so after about a hour playing with this I blanked the chip and reprogrammed it and it ran find just the 3 leds on like it should of and your right the first should of been 0xff and it was.I just posted the wrong part of the code sorry
 
Last edited:

nre-the-8th

New Member
Just a thought.

I read this the other day and thought it might be of some use with re-programming your pics.

Be aware that if the .HEX file already exists from a previous successful build and the build subsequently fails, the .HEX file in the working directory is the one from the last successful build. (this is a tip worth remembering before wasting hours trying to understand why the changes you make don't appear to work:)

Hope it's useful.
 
Status
Not open for further replies.
Top