'The following simple program was developed in an effort to isolate the problem I
'am having using the 16F677 or 690 for a project I am working on.

'The program seems to ignore the PEEK command. The program continues to loop
'through the commands, generating a square wave, regardless of the state of the
'input on RA5. I believe I have enabled, or disabled, all registers that could
'possibly be involved. I have not shown the list of equates to save space.

I appologize for the length.

TravisM

POKE INTCON, 0
POKE OPTION_REG, %00000111
poke trisA, %11111111 'set port A as inputs
poke trisb, %11010000 'set all pins to output
poke trisC, %00010000 'set port C pin 7 as output, the rest as inputs
POKE OSCCON, %01100111 'set for 4Mhz, internal osc
poke ADCON0, %10000000 'NOTE!!! ADC NOT ENABLED!!!set for rt justified, AN0 analog input, but ADC disabled (bit 0)
Poke ADCON1, %00010000 'Set Fosc/8
poke ANSEL, %00000000 'SET all analog select pins TO DIGITAL I/O
POKE ANSELH, %00000000 'SET ALL OF THE ANALOG SELECT HIGH REGISTERS TO DIGITAL I/O
POKE SSPCON, %00010000 'NOTE!! Temp. disables SPI mode
POKE WPUB, %11110000 'ENABLE PORT B WEAK PULL-UPs
POKE IOCB, 0 ' DISABLE INTERUPT ON CHANGE
POKE WPUA, %00110111 'ENABLE WEAK PULL-UPs
POKE IOCA, 0 'DISABLE INTERUPT ON CHANGE


Manual:

peek portA, b0 'Hold RA5 low to test code/chip operation
if bit5 = 0 then ONE
goto Manual 'Loop until RA5 goes low

ONE:
poke portC, %00000000 'This loop will produce a square wave on pin RC5
'as long as RA5 is low
pause 10

poke portC, %00100000

pause 10

goto Manual 'Keep looping until RA5 is hi

END