Rikard Bosnjakovic wrote: > On 3/7/07, michael brown wrote: > >> Read about them, you need to know this stuff. They're just like >> option switches, you turn them on or off. You'll see that the >> CLKOUT stuff passes the Fosc/4 clock out a port pin making it >> unusable to you. The ER thingy is also tying up one of your port >> pins thinking that you have an external R/C connected to act as the >> clock. You could try this for your CONFIG word settings: > > Thanks for your input. I've now read through about the configuration > bits and port setups even more. Yet I seem to miss something, because > PORTA won't change values when I try to. > > __CONFIG _CP_OFF & _WDT_OFF & _BODEN_OFF & _PWRTE_ON & > _INTOSC_OSC_NOCLKOUT & _MCLRE_OFF & _LVP_OFF > > start > clrf PORTA > clrf PORTB > > ; reset and initialize ports > bsf STATUS, RP0 ; select bank1 for > configuration of TRISA/TRISB > bcf STATUS, RP1 > > movlw b'00000111' > movwf CMCON ; turn off the > comparator function for PORTA CMCON is in BANK0 on the 16F628 > movlw b'11111000' ; RA[3:7] inputs > movwf TRISA ; RA[0:2] outputs > > movlw b'00000000' ; RB[0:5] outputs > movwf TRISB ; RB[6:7] unusable > (timer crystal) > bcf STATUS, RP0 You need to move the CMCON stuff to right here > ; none of these below works, PORTA is still 0 > movlw 1 > movwf PORTA > movlw 2 > movwf PORTA > movlw 3 > movwf PORTA > movlw 4 > movwf PORTA > movlw 5 > movwf PORTA > movlw 6 > movwf PORTA > movlw 7 > movwf PORTA > movlw 8 > movwf PORTA The 8 shouldn't work and the 9 below should result in only a 1 since you only have three output bits. > movlw 9 > movwf PORTA > > Have I missed something obvious? Because I really can't understand > what's going on. Try the CMCON stuff, it'll work wonders. ;-) -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist