1 / 11

PIC18 Peripherals

PIC18 Peripherals. PIC18F452/458 Peripherals –. Data ports – A 6-bit B 8-bit C 8-bit D 8-bit E 3-bit Timer/counter modules – 0 [8-bit], 1 [16-bit], 2 [8-bit], 3 [16-bit]. CCP/PWM modules [2] I 2C/SPI serial port USART [RS-232, RS-485] ADC [10-bit] with 10 way input multiplexer

brandy
Download Presentation

PIC18 Peripherals

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. PIC18 Peripherals

  2. PIC18F452/458 Peripherals – • Data ports – • A 6-bit • B 8-bit • C 8-bit • D 8-bit • E 3-bit • Timer/counter modules – 0 [8-bit], 1 [16-bit], 2 [8-bit], 3 [16-bit]

  3. CCP/PWM modules [2] • I2C/SPI serial port • USART [RS-232, RS-485] • ADC [10-bit] with 10 way input multiplexer • EEPROM [256 byte]

  4. PIC instruction set • PIC instruction set has a small no. of simple (RISC) instructions: • PIC16 series – 35 inst. coded into 14 bits • PIC18 series – 59 16… • PIC24 series – 71 24… Most instructions are executed in one instruction cycle that corresponds to 4 clock cycles. Hence, a PIC operating at 40 MHz clock frequency will have an instruction rate of 10 MIPS.

  5. Byte-oriented file register operations • Byte-oriented file register operations – ADDWF Add W and f  result in W or f CLRF clear f DECF decrement f MOVF Move contents of f to f or W

  6. Bit-oriented file register operations BCF clear bit in f BTFSC test bit in f; skip if clear

  7. Control instructions CALL call subroutine (funtion) RETURN return from subroutine (function) BRA branch unconditionally BNZ branch if not zero

  8. Literal instr. MOVLW move literal to W ADDLW add literal to W

  9. Status register • 8-bit status register – • N negative bit – result of arithmetic operation was negative • OV overflow bit – overflow occurred for signed arithmetic • Z zero bit • DC digit carry bit – carry out from 4th low order bit of result • C carry bit –carry out from MSB of result The bits of the status reg can be used for conditional branches, e.g., - BNZ branch if not zero - BOV branch if overflow

  10. CCS PIC compiler • Compiler – high-level language prog to machine instructions for the target processor • Cross-compiler – is a compiler that runs on a processor that is different from the target processor • E.g., CCS cross-compiler • Most embedded systems are now programmed using C/C++ lang.

  11. PCwith CCS compiler USBICD2 debugger  PIC system • Programs are edited and compiled to PIC machine instructions on a PC • PIC machine instructions are uploaded from PC to PIC system via the ICD2 debugger [e.g., microchip MPLAB ICD2] • Code is executed on the PIC system and can be debugged (break points, inspect variables, single step, etc.) using PC

More Related