-
pic 12F683 question
Hello,
Tanks to tell me why GPIO pins 5, 4 and 1 has no reaction with this instructions.
' µp used : 12F683
include "modedefs.bas"
DEFINE LOADER_USED 1 '
define OSCAL_2K 1 ' define oscal for 2 k devices
DEFINE OSC 4 ' Oscillator speed in MHz: 3(3.58) 4 8 10 12 16 20 24 25 32 33 40
'----------------------------------------------------------------------
ANSEL=0
TRISIO =0
start:
low 5
low 4
low 2
low 1
low 0
pause 1000
high 5 ' no reaction
high 4 ' no reaction
high 2 'ok
high 1 no reaction
high 0 'ok
pause 1000
goto start
-
Try
Code:
HIGH GPIO.5
PAUSE 1000
LOW GPIO.5
PAUSE 1000
-
Rtfm ...
Ok,
The answer is on page 24 & 30 of the manual ( v 2.60 ...)
instead of
Code:
include "modedefs.bas"
use
Code:
include "bs2defs.bas"
Alain
-
12F683 pins
Thanks for the answer.
But there is no evolution when i use
HIGH GPIO.5
PAUSE 1000
LOW GPIO.5
PAUSE 1000
GPIO 4 and 5 still inactive
A other suggestion ?
Regards.
Bouif2
-
Frozen pins
I tested and the
use of "include "bs2defs.bas"" did not bring live to the pins.
Some other idea.?
-
Now that I look at the data sheet I see GPIO.4 is analog.
So add
Near the beginning of your code. That will make all pins digital.
Other than that I do not see a problem.
How are your configs set and how is it wired?
-
Ansel = 0
Thanks Dave for your anwer.
But " ANSEL = 0 " did not bring a amelioration.
Regards.
Bouif2
-
Yes ...
a ( working ...) typical 12F683 INTOSC Header ...
Code:
@ __config _INTRC_OSC_NOCLKOUT &_FCMEN_OFF &_IESO_OFF & _WDT_ON &_PWRTE_ON & _MCLRE_OFF & _CP_OFF
OSCCON = %01110111 ' Internal Clock 8 Mhz
CMCON0 = 7
VRCON = 0
ADCON0 = 0
ANSEL = 0
and NO "Define Osccal" to write ...
You have [no]some[/no] LOTS OF good reading to do, this evening ... BEFORE sleeping.
Alain