Hi Folks. I'm back to square one. Naturally, when I loaded my program it did not work, so I have to work in circuit, that requires a lot of switching chips around, and I'm thinking of getting a PICKIT2 programmer, and a set up like FUTZ has.
Anyway, I wrote a program to flash the LED, and it doesn't work, so I don't know why, since it does work on SIM, no problem. I'm using a 16F88. I left some of the set up files since I need them to run the complete program and want to write these test programs around them.
Code:LIST p=16F88 include "P16F88.inc" __config _CONFIG1, _WDT_OFF & _INTRC_IO & _MCLR_ON & _LVP_OFF errorlevel -302 Cblock 0x20 TIMER1, TIMER2, HBYTE, LBYTE, endc banksel TRISA ;bank 1 movlw 0x42 ;1MHz clock movwf OSCCON movlw 0x07 ;turn comparators off movwf CMCON movlw B'11111111' movwf TRISB movlw B'00000010' movwf ANSEL movwf TRISA movlw B'00000000' movwf OPTION_REG banksel PORTA clrf HBYTE clrf LBYTE clrf PORTA goto start delay movlw D'150' movwf TIMER1 delay2 movlw D'150' movwf TIMER2 decfsz TIMER2,F goto $-1 decfsz TIMER1,F goto delay2 return start movlw 0xA movwf LBYTE movlw 0x2 movwf HBYTE loop2 bsf PORTA,6 bsf PORTA,7 call delay call delay clrf PORTA call delay call delay decfsz LBYTE,F goto loop2 decfsz HBYTE,F goto loop2 end

Reply With Quote

You're finally coming to your senses. The sim is a fine tool for some things, but the breadboard is the only way to really know if something is going to work.

