Lets start with the configs.
In the PBP directory there is a *.inc file for every chip, this is where the chip is configured. It can also be done in code space.
http://www.picbasic.co.uk/forum/showthread.php?t=543
For now look at the *.inc file
Code:
;****************************************************************
;* 12F675.INC *
;* *
;* By : Leonard Zerman, Jeff Schmoyer *
;* Notice : Copyright (c) 2005 microEngineering Labs, Inc. *
;* All Rights Reserved *
;* Date : 08/31/05 *
;* Version : 2.46a *
;* Notes : *
;****************************************************************
NOLIST
ifdef PM_USED
LIST
include 'M12F675.INC' ; PM header
device pic12F675, intrc_osc_noclkout, wdt_on, mclr_on, protect_off
XALL
NOLIST
else
LIST
LIST p = 12F675, r = dec, w = -302
INCLUDE "P12F675.INC" ; MPASM Header
__config _INTRC_OSC_NOCLKOUT & _WDT_ON & _MCLRE_ON & _CP_OFF
NOLIST
endif
LIST
The above shows internal OSC, watch dog timer is on, MCLRE is on and code protect is off.
For now change MCLRE_ON to MCLRE_OFF. do the lower case one if you are using PM for the assembler and the upper case one if you are using MPASM for the assembler.
The chip you are using has built in ADCs, something new from the Basic Stamp. If the pin is to be used as a digital then the ADC needs to be turned off.
This thread is labeled PORTA... but the same applies for GPIO.
http://www.picbasic.co.uk/forum/showthread.php?t=561
In my opinion is will be a bad habit to stick with the Basic Stamp idea of a pin being 0 or 1 or 2. Better to get in the habit of calling the pins by the name or assigning on to it.
PBP defaults to 4MHz but it is good practice to define the speed in code space.
So make the change to the *.inc file and give this a try.
Code:
'16F675
DEFINE OSC 4
ANSEL=%00000000
CMCON=7
LOOP:
HIGH GPIO.0
PAUSE 250
LOW GPIO.0
PAUSE 250
GOTO LOOP
END
Bookmarks