
The STATUS register (0x03 and 0x83) is shared by BOTH Bank0 and Bank1 respectively. Note 6: one must be in the correct bank to change register data, bits, etc. Note 5: defined names from the include file ARE case sensitive! So using "oscon" etc. Otherwise one would have to define the label themselves (OSCON EQU 0x8F) or simply use "MOVWF 0x8F". Look at the bank table in figure 3 and notice "OSCON" (or oscillator control register) is in Bank 1 location Ox8F.

Note 4: the include file in the template defines names to a number. I don't know about OCTAL - the compiler doesn't seem to care when I tried 0777. 255 for decimal b'11111111' or 0b11111111 for binary, or 0xff or 0xFF for hexadecimal. The compiler doesn't care what number base one uses so 255 can be d'255' or. Note 3: the PIC series uses mainly 8-bit registers that can hold a number form 0-255 decimal. One could use say "movlw" or "MOVlw", etc. Note 2: commands such MOVLW, MOVWF, and BANKSEL are NOT case sensitive. Use lots of comments to make notes to yourself! Note 1: anything after " " is a comment and ignored. MOVLW b'01100001' 4MHz Clk, IntOsc, SysClk via IntOsc Note that I'm using MPLAB v8.92 compiler which changes labels and code one types into machine code (a HEX file) programmed into the PIC. Look at this code that will setup the internal clock in the template. The p12f683.inc file defines names based on the register/bank labels. 2 by setting and clearing bits in the associated register. They control the hardware and other functions. PIC12F683 registers are accessed in two banks. Build H-Bridge Motor Control Without Fireworks.

Digispark ATtiny85 with MCP23016 GPIO Expander.PICAXE Micorcontroller Controls Motor Speed - Direction.

PICAXE Operates H-Bridge Motor Controller.Microchip PIC16F628A Basic H-Bridge Motor Control.

