PIC18F45K20-E/P Microchip Technology, PIC18F45K20-E/P Datasheet - Page 36

32KB, Flash, 1536bytes-RAM, 36I/O, 8-bit Family,nanowatt XLP 40 PDIP .600in TUBE

PIC18F45K20-E/P

Manufacturer Part Number
PIC18F45K20-E/P
Description
32KB, Flash, 1536bytes-RAM, 36I/O, 8-bit Family,nanowatt XLP 40 PDIP .600in TUBE
Manufacturer
Microchip Technology
Series
PIC® XLP™ 18Fr

Specifications of PIC18F45K20-E/P

Core Processor
PIC
Core Size
8-Bit
Speed
48MHz
Connectivity
I²C, SPI, UART/USART
Peripherals
Brown-out Detect/Reset, HLVD, POR, PWM, WDT
Number Of I /o
35
Program Memory Size
32KB (16K x 16)
Program Memory Type
FLASH
Eeprom Size
256 x 8
Ram Size
1.5K x 8
Voltage - Supply (vcc/vdd)
1.8 V ~ 3.6 V
Data Converters
A/D 14x10b
Oscillator Type
Internal
Operating Temperature
-40°C ~ 125°C
Package / Case
40-DIP (0.600", 15.24mm)
Lead Free Status / RoHS Status
Lead free / RoHS Compliant
For Use With
DM240313 - BOARD DEMO 8BIT XLPAC164112 - VOLTAGE LIMITER MPLAB ICD2 VPPDM164124 - KIT STARTER FOR PIC18F4XK20
Lead Free Status / RoHS Status
Lead free / RoHS Compliant

Available stocks

Company
Part Number
Manufacturer
Quantity
Price
Part Number:
PIC18F45K20-E/PT
Manufacturer:
Microchip Technology
Quantity:
10 000
PICkit™ 3 Debug Express
FIGURE 3-23:
DS41370C-page 32
In the PIC18F45K20, the RB0 pin is shared with analog input AN12. Such pins must
be configured as either digital or analog inputs. This is important because RB0 will be
used as a digital input pin to read the state of the switch in register PORTB. If RB0 is
configured as an analog input, it will always read ‘0’ and not the actual state of the
switch. Pins are configured as analog or digital in the SFRs ANSEL and ANSELH.
ANSELH: ANALOG REGISTER 1
We clear ANSELH to set all pins to digital functionality: ANSELH = 0x00;
Now we can use RB0 as a digital input, so the TRISB bit is set to configure it as an
input: TRISBbits.TRISB0 = 1;
3.4.3.3
This program uses a simpler method of rotating the LEDs than Lesson 3, which used
the look-up table for demonstration purposes. 04 Switch Input.c uses a single set
bit in the LED_Display variable which is written to LATD and shifted each time the
display is updated. The bit will eventually be shifted out of the Most Significant bit of
LED_Display, so the code checks for this, and sets LED_Display to ‘1’ again.
For more information on I/O port pins, see Section 10 “I/O Ports” of the PIC18F45K20
Data Sheet (DS41303).
3.4.4
Build the Lesson 4 project and program the code into the demo board using the PICkit
3 Programmer.
Press the Demo Board Switch button to rotate the LEDs. The LEDs will advance once
for each button press.
ROTATING THE LEDS
Build and Program the Lesson 4 Code
© 2009 Microchip Technology Inc.

Related parts for PIC18F45K20-E/P