How to get started with microcontrollers

Hello, my name is Adrian and together with a few of my colleagues we’ll present you a multitude of code example to get you started.

In all our examples we will be using the following hardware / software:

 

Microcontroller:                         PIC16F917

Programmer:                              PicKit2

Programming language:            C

Programming software:             MikroC PRO for PIC

Simulation software:                  Proteus

 

In this article I will be presenting the hardware/software needed to get you started:

 

 

PIC16F917 microcontroller

 

Datasheet:  PIC16F917

Features

  • Up to 96 LCD segments
  • Internal 32kHz to 8MHz oscillator
  • Low-power nanoWatt Technology
  • 25mA Source/Sink current I/O
  • Two 8-bit Timer (TMR0/TMR2)
  • One 16-bit Timer (TMR1)
  • Extended Watchdog Timer (EWDT)
  • Wide Operating Voltage (2.0V – 5.5V)
  • Brown-Out Reset (BOR) with Software Control
  • In Circuit Serial Programming (ICSP)
  • Programmable Low Voltage Detect (PLVD)
  • Wake on change
  • I2C, SPI, AUSART
 

Program Memory Type

Flash

Program Memory (KB)

14

CPU Speed (MIPS)

5

RAM Bytes

352

Data EEPROM (bytes)

256

Digital Communication Peripherals

1-A/E/USART, 1-SSP(SPI/I2C)

Capture/Compare/PWM Peripherals

2 CCP

Timers

2 x 8-bit, 1 x 16-bit

ADC

8 ch, 10-bit

Comparators

2

Segment LCD (pixels)

96

Temperature Range (C)

-40 to 125

Operating Voltage Range (V)

2 to 5.5

Pin Count

40

 

Programmer description - PicKit2

 

The programmer we chose is the perfect one for a beginner / intermediate and it has a reasonable price.

Click for PICkit 2 Overview Presentation
The PICkit™ 2 Development Programmer/Debugger (PG164120) is a low-cost development tool with an easy to use interface for programming and debugging Microchip’s Flash families of microcontrollers. The full featured Windows® programming interface supports baseline (PIC10F, PIC12F5xx, PIC16F5xx), midrange (PIC12F6xx, PIC16F), PIC18F, PIC24, dsPIC30, dsPIC33, and PIC32 families of 8-bit, 16-bit, and 32-bit microcontrollers, and many Microchip Serial EEPROM products. With Microchip’s powerful MPLAB Integrated Development Environment (IDE) the PICkit™ 2 enables in-circuit debugging on most PIC® microcontrollers. In-Circuit-Debugging runs, halts and single steps the program while the PIC microcontroller is embedded in the application. When halted at a breakpoint, the file registers can be examined and modified.

PicKit2 programmer

You can buy it from farnell.com at a price of $34.99  (link)

Download Datasheet: PicKit2