Hi All
Been a whilst since I played with this stuff !
Above is all good and working except for the internal pullups.....I cannot get them to work.... Commenting the OPTION line out and putting a 10k resistor in place all is ok.
I suspect it is the order that the configuration is in....PORTA, PORTB, TRIS, OPTION, CMCON etc.
Any advice to the right order for above here welcome !
Thank You for reading
BR
Andy
Been a whilst since I played with this stuff !
Code:
' Name : WhiteLightClock.pbp
' Compiler : PICBASIC PRO Compiler 2.6
' Assembler : MPASM
' Target PIC : PIC16F627A
' Hardware : ProtoType
' Oscillator : 4 Megs Internal
' Keywords : I2CREAD, I2CWRITE
' Description : White Light on and off
' using the Dallas DS1307 I2C RTC.
PORTB.6=0 'Led off
TRISA=0 'Port A all outputs
TRISB.3=1 'Make RB3 input
'OPTION_REG.7=0 'Enable internal pull-ups
CMCON=7
' Alias pins
SDA Var PORTB.1
SCL Var PORTB.2
Led var PORTB.6 'White Light
Pir Var PORTB.3 ' Input Button
I suspect it is the order that the configuration is in....PORTA, PORTB, TRIS, OPTION, CMCON etc.
Any advice to the right order for above here welcome !
Thank You for reading
BR
Andy