Strange SetBit behaviour

Beta Testing discussion on mikroBasic.
Post Reply
Author
Message
cgagner
Posts: 57
Joined: 01 Jan 2006 19:56
Location: Saint Bruno de Montarville, Qc Canada

Strange SetBit behaviour

#1 Post by cgagner » 26 Oct 2008 13:56

I have tested this with version 7.2 and I have same results. Am I missing something obvious?
Pic = 12F629

Code: Select all

program TestSetbit
' MikroBasic 7.3 beta.
' Config = default.
' I have two leds connected to gpio.0 and gpio.1.
' You can't have both leds to flash if you unrem both "SetBit"
' REMing one SetBit... will make the other work.
' if you use gpio = 3 then both leds will flash.
main:
trisio.0 = 0
trisio.1 = 0

while 1
'gpio = 3
setbit(gpio,0)
setbit(gpio,1)
delay_ms(1000)

ClearBit(gpio,0)
ClearBit(gpio,1)
delay_ms(1000)
wend
end.

yo2lio
Posts: 1878
Joined: 19 Sep 2006 12:57
Location: Romania, Arad City
Contact:

#2 Post by yo2lio » 26 Oct 2008 17:58

You must turn off the COMPARATOR :

Code: Select all

CMCON = 7
Best regards, Florin Andrei Medrea.

http://www.microelemente.ro/
http://www.microelemente.ro/produse-si-servicii/
http://www.microelemente.ro/custom-software/

mail : florin@microelemente.ro

cgagner
Posts: 57
Joined: 01 Jan 2006 19:56
Location: Saint Bruno de Montarville, Qc Canada

#3 Post by cgagner » 26 Oct 2008 21:32

Many thanks. It is working good now.
Claude

Post Reply

Return to “mikroBasic Beta Testing”