12f683 help

General discussion on mikroBasic.
Post Reply
Author
Message
hcker2000
Posts: 192
Joined: 22 Feb 2006 08:45
Location: Ohio
Contact:

12f683 help

#1 Post by hcker2000 » 02 Dec 2007 00:21

Hey I am just trying to do some simple led flashing on the 12f683 but for some reason gpio.1 is not turning on. Here is my code.

Right now the leds on gpio.0 and .1 should come on and .0 does but .1 doesn't light up.

Code: Select all

program LED_Flicker

main:
TRISIO = 0 'Set all pins to output
ANSEL = 0 'Turn off analog stuff
ADCON0 = 0
gpio.0 = 1
gpio.1 = 1
gpio.2 = 0
while true
'code goes here
wend
end.

Charlie
Posts: 2744
Joined: 01 Dec 2004 22:29

#2 Post by Charlie » 02 Dec 2007 00:42

Try adding CMCON0 = 7 to turn off the comparitors.
Regards Charlie M.

hcker2000
Posts: 192
Joined: 22 Feb 2006 08:45
Location: Ohio
Contact:

#3 Post by hcker2000 » 02 Dec 2007 00:48

thanks that did it :)

dandav1
Posts: 1
Joined: 19 May 2014 04:29

Re: 12f683 help

#4 Post by dandav1 » 09 Jul 2015 00:48

Hi everyone

I am having some trouble understanding why this code doe NOT work on EasyPIC5


program Leds_on_683_with_push_button


main:
osccon = %01110111 'set osc to internal 8mhz
CMCON0 = 7 ' turn off comparitors
ansel = 0 ' make i/o digital

Trisio = %101001 'set up input and output
IF GPIO.0 = 1 then ' check if GPIO.5 = 1
GPIO.1 = 1 'If so then turn on output pins
GPIO.2 = 1
GPIO.4 = 1
'GPIO.0 = 1
else GPIO = 0 'if not then output pins are off
end if ' do it all over again
goto main


end.

User avatar
aleksa.jovanovic
Posts: 526
Joined: 30 Jun 2015 08:48

Re: 12f683 help

#5 Post by aleksa.jovanovic » 09 Jul 2015 14:49

Hi dandav1,

The code that you've sent works on EasyPIC5 with 12F683.
I've tried it myself. Did you turn on the LEDs and turn off any unnecessary switches off?

Upload the HEX in the zip file attached and see if you still have a problem.
If you do, I would kindly ask of you to take a picture of your configuration and upload it here.


Best regards,
Aleksa.
Attachments
test forum.rar
(224 Bytes) Downloaded 156 times

Post Reply

Return to “mikroBasic General”