I'm having the same problem with a 12F675 reading a pin
I'm using PicBasic, Microcode studio and MeL:abs Programmer , latest updates
I've been trying for a week with different combinations of peeks, pokes and button commands. It runs fine, but ignores my input to shorten the run loop.
Here is my latest try using he button command with peek and pokes commented out.
'************************************************* ***************
'* Name : Test.BAS *
'* Author : Gene Choin *
'* Notice : Copyright (c) 2009 *
'* : All Rights Reserved *
'************************************************* ***************
'* Date : 9/20/2009 2:13 *
'* Version : 1.0 *
'* Notes : TEST for 12F629 Input *
'* *
'************************************************* ***************
'TEST program for reading input on pin 1 (Physical pin 6 on 12F629 = GPIO1).
'pin1 has a 24K pull up resistor to 5V and switch to ground.
'If pin1 = 0, flash pin 4 and retest.
'If pin1 = 1. flash pin 5 also and then GOTO TEST
Symbol CMCON = $1f 'Alias $1f to CMCON
Poke CMCON, 7 'makes all digital I/O
'Variables
'Ports
Output 0 'Make GP0 the Strike output
Input 1 'Make GP1 the Run Sense in
Output 2 'Make GP2 the Filament Drive out
Input 3 'Make GP3 the MCLR in
Output 4 'Make GP4 the START LED out
Output 5 'Make GP5 the RUN LED out
'Begin Program
TEST:
pulsout 4,2000 'Marker - Pin 4 for 4 sec
High 4
Pause 4000
Low 4
Let B0 = 1 'clear B0
BUTTON 1,0,0,0,B0,0,Fil_hi 'If switch goes low, goto FilHi- skip High 5
High 5 'Marker - Pin 5 for 4 sec
pause 4000
Low 5
Fil_HI:
High 2
Pause 4000 'Marker - Pin 2 for 4 sec
Low 2
GOTO TEST
end
Bookmarks