Hey all
I'm working on code for my first PIC project. I'm using the PIC 16F737, and I'd like to use the internal oscillator at 4MHz. To do this, I need to load bits 6-4 with 110. I've worked out this as a means to do it, but I'm not sure it will work, since I'm setting the frequency with several commands and changing the contents of the w register before the frequency is set:
movlw 0x01 ;load W with 1
movwf ircf2 ;set int osc 110=4Mhz
movwf ircf1
movlw 0x00 ;load W with 0
movwf ircf0
Is there a more elegant way to accomplish this? Also, can you load only 3 bits of a register, or do you always have to use an 8 bit pattern?
Thanks
I'm working on code for my first PIC project. I'm using the PIC 16F737, and I'd like to use the internal oscillator at 4MHz. To do this, I need to load bits 6-4 with 110. I've worked out this as a means to do it, but I'm not sure it will work, since I'm setting the frequency with several commands and changing the contents of the w register before the frequency is set:
movlw 0x01 ;load W with 1
movwf ircf2 ;set int osc 110=4Mhz
movwf ircf1
movlw 0x00 ;load W with 0
movwf ircf0
Is there a more elegant way to accomplish this? Also, can you load only 3 bits of a register, or do you always have to use an 8 bit pattern?
Thanks