PDA

View Full Version : Weird problem with 12F629



martarse
- 26th May 2005, 00:17
Hello,

Here is the code I want to make it working :
define OSC 3
trisio = %001
firstline:
if (GPIO.0 = 0) then
high GPIO.2
else
low GPIO.2
endif
goto firstline
end

It's a very simple program that works with 16f84a (if I change GPIO for PORTx) but do not works with a 12f629...

In fact my real program is more complex than this one but the pattern is the same. A switch control an action on 2 output pins instead of only one for this program.

That program is suposed to turn on a LED(GP2) with a ground applied to port GP0 and turn off the LED(GP2) if a 5V is applied on the GP0.

Let me know is someone find some problem?? I've already try many way...but the program seems to be very simple...and probably there are something that I've forget to do.

thanks

Martin

martarse
- 26th May 2005, 02:58
I've read in the PBP Manual...the new version (2004)...my version was from 2002...that for pic micro with comparator (like the 12f629) we have to add a line to the program header.

CMCON = 7

This line is used to inform the Picmicro to use GPIO comparator pins as a digital pin.

Everything works good for now!

thanks! hihi!

Hope this will help!

byebye

mister_e
- 26th May 2005, 03:08
Salut Martin!

always great to know somebody find it by himslef :)

this link (http://www.picbasic.co.uk/forum/showthread.php?t=1287) could be kind of interest for some.

martarse
- 26th May 2005, 03:31
allo Steve,

Thanks for this link.

charudatt
- 28th May 2005, 07:15
Thank you for the URL's

Rentron is even my favourite site. Learnt a lot from both the sites.

regards