[Return to Home Page]

ECE 445 Wiki : Topics : Microcontrollers

[Login]


Microcontrollers


Guide to Picking an Embedded Platform

Picking An Embedded Platform

Kashev Dalmia - v1.0.0, updated 12/6/2013


16F887 PIC Datasheet Use this sheet to figure out how the PICs we give out in lab work. (Starting Fall 2011.)
16F877A PIC Datasheet (Before Fall 2011.)


Microcontroller Troubleshooting

  • Connect decoupling capacitors between Vcc (Vdd) and Vee (Vss). Read about why.

  • Always make sure you click “Build all” in MPLAB before trying to program the PIC.

  • If having any sort of problems with your chip(s), check the soldering on ground connections. This is the source of more problems than you might realize.

  • Connect MCLR to VCC through a pull-up resistor whenever powering up the PIC.

  • Is the device selected in MPLAB same as the one you're using? (PIC16F887)

  • Use a PicSTART Plus if having trouble with the ICD2/3; it is not as convenient as the ICD, but will sometimes work when the ICD doesn't

    • make sure the PIC is sitting completely in it
    • have you clicked “Build All” recently?
    • if it successfully programmed it will give you an address range in MPLAB

Margaret Boehle, 19 December 2011
(future semester students, please add to this!)


General How-To

  • You do not HAVE to use an external oscillator or crystal with the PIC16F887 if you do not have specific timing requirements. The maximum speed the internal oscillator can run at is 8 MHz though, so if you need faster computations, you should use an external oscillator. Select INTOSC either with #FUSES or by setting the bit in MPLAB.

  • Old How-To.

  • VERY useful guide is available through the MikroElektronika web-site. Chapter 3 is all about the PIC16F887.

  • PIC-C Compiler Reference Manual for writing the code.

  • Check out Scott's Beginner's Guide below.

Margaret Boehle, 19 December 2011


PIC16F877A Beginner's Guide, troubleshooting, functions

by Scott Chen (12/04/2011)


About the ICD3 Programmer

The ICD3 Programmer allows you to program and debug your PIC directly from your breadboard/PCB board. For a Quick introduction and reference on its pinout, visit

http://ww1.microchip.com/downloads/en/DeviceDoc/DS-51765C.pdf

http://www.youtube.com/watch?v=j8RXbZ2gOSY&NR=1

http://www.youtube.com/watch?v=GoyTYoFZ8dk

Ariel Moctezuma (2011-04-04)


Serial/RS232 communications with the PIC16F877A

Many projects involve some sort of serial communication between the PIC and other devices, multiple PICs, etc. Unfortunately information on how to go about this is not as easy to find as one would want. After many long days of coding, we found a way to both read and write from a PIC in a manner that also allowed us to manipulate the data read in.

http://courses.engr.illinois.edu/ece445/wiki/?n=Topics.Microcontrollers?action=download&upname=PIC16RS232guide2.pdf

Ali Azeem and Peter Hu (2011-04-13)


Helpful information for programming the PIC16F877A:

PIC - Reference - The reference manual from ECE 395 website.
PIC16F877 Programming Tips - Tips for timers, PWM, interrupts, and more.

Kuo Hao Chen (2010-11-20)


Tips for using the PIC16F877A

If you have never programmed a microcontroller before, Arica and I suggest taking a look at this tutorial we found on the University of Pittsburgh website:

http://www.pitt.edu/~sorc/robotics/Lukas%20PIC%20Tutorial.doc

It gives you an overview of the PIC ports, and sample code to program your pic with. Also we recommend trying to compile your code using PCW compiler if your code won't compile using the MPLAB IDE. Then go back to the MPLAB IDE to program your PIC using the PICstart KIT.

Shawn Adderly (2010-09-20)


HCS12 New updated version of the old Motrola HC12 Think PIC on steroids

Wm. Eisenhower (2008-09-03)


Wired PIC to PIC Communication : How to set up a simple microcontroller communications system.

Projects involving multiple microcontrollers may need each PIC to communicate with the others - you can do this using only 1 pin per PIC!

Praveen Bommannavar, 23 June 2006


PIC CCS C Interrupts : an interrupt HOW-TO by Nicholas Modrzejewski.

PIC interrupts with the CCS C compiler are incredibly easy, here we examine the required elements to handle interrupts and give an example interrupt driven program.

Nicholas Modrzejewski, 31 March 2006


Compiler Error: Unable to write *.PJT

If you get this error you have to set a flag on the compiler

Go to Project->Build Options->Project->CCS C Compiler->Use Alternate Settings and type -J at the end of the line. This will prevent the PJT from being written.

Jason Skowronski, February 21, 2006


Motorola HC12 - Motorola HC12 Microcontroller HOWTO adopted from old ECE 445 Web site.

Alex Spektor, February 15, 2006
Wm. Eisenhower (2009-09-03)- Mostly useless to design with as key files have been lost.


Alex Spektor, February 8, 2006


ADC HOWTO - Analog to Digital Conversion HOWTO adopted from old ECE 445 Web site.

Alex Spektor, February 8, 2006


Interfacing HOWTO - RS-232, SPI, and I2C HOWTO adopted from old ECE 445 Web site.

Alex Spektor, February 8, 2006

Rewritten by Zhangxiaowen "Andy" Gong, May 4, 2012


Microcontroller FAQ - Partly broken microcontroller tutorial. This should be transferred to the Wiki, so please help.

Alex Spektor, February 8, 2006


Mini-ICSP ICSP connectors are little connectors that let you reprogram a PIC while it is in a circuit, with no need to take it out. Also good for PICs already soldered into a PCB.

Jason Skowronski, 26 January 2006


PicInterrupts : a tutorial by Kyle Cline on interrupts.

In many application you have a choice between polling or interrupts. The former is easier, but inefficient and the latter is harder but eats less bandwidth.

Scott Carney, 17 January 2006


PicProgramming : HOW-TO adopted from the old ECE 445 Web site.

Alex Spektor, 17 January 2006


ASM Programming : Some tips and tricks if you want to attempt assembly programming on the PIC.

David Hruska, 13 December 2007


PIC CCS Interfacing With An LCD : LCD Driver for interfacing your LCD module with your PIC microcontroller.

David Wu, 01 December 2008


uMMC-100-a3 Data Module with PIC : Helpful tips for using the uMMC with a PIC microcontroller.

Fredrick South, 07 May 2010


Synchronization Among Interrupts and the Event Loop in Embedded Programming : A tutorial on how interrupts and main loop communicate.

Zhangxiaowen "Andy" Gong, May 4, 2012


Interrupts using HI-TECH compiler : Explanation of how to write an interrupt using the HI-TECH compiler. The sample code shown also implements a delay_ms function.

Naren Velez, May 6, 2012


BeagleBoard and BeagleBoard-xm:

Arch Linux is one of the lightest and easiest to use Linux distributions for OMAP boards. They also have a great wiki to set up the desktop environment and other necessary applications that your project may require.

http://archlinuxarm.org/platforms/armv7/beagleboard-xm

http://archlinuxarm.org/support/guides/system

https://wiki.archlinux.org/

GPIO(General Purpose Input Output):

There are I/O pins on the board. There only certain activated pins for the basic Arch Linux u-boot (although you can recompile the u-boot to activate all 28 pins). You can use GPIO168(pin 22) as an output or pins 7,9,11 pins as input.

http://bbfordummies.blogspot.com/2009/07/1.html

S-Video:

To get the desktop environment to work through the BeagleBoard's S-video connection, you must create an xorg.conf file or create a .conf file inside the xorg.conf.d directory. Be sure to include the s-video driver: omapfb.

Parth Narielwala, May 8, 2012


DC Signal from PWM : A tutorial on how to filter microcontroller produced pulse-width modulation signals (PWM) to get a steady DC signal.

Alex Fishbeck - v1.0.0, updated 12/18/2013


Beagleboard-xm

OS installation, two main choices: Angstorm, recommend to download from http://www.angstrom-distribution.org/demo/beagleboard/ Ubuntu, recommend to download from https://wiki.ubuntu.com/ARM/OmapDesktopInstall Follow the instructions and install to SD card.

Configure putty on windows to communicate with Beagleboard-xm through serial port:

  • on Windows:
  • open Device Manager (right-click on “My Computer”, choose “Manage”, then click on “Device Manager” in the left-side tree of the window that opens).
  • expand the “Ports” section, you should see a “USB-to-Serial” device in the list.
  • at the end of the name should be “COM#”, take note of the number.
  • Configure putty:
  • download putty.exe from here: http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html
  • launch putty and configure a new session:

(&#61607);

Connection Type: Serial (&#61607); Serial Line: COM# (replace # with the number you noted from Device Manager) (&#61607); Speed: 115200

  • click “Open” and you will get a console window
  • apply power to the BBXM, login as root, no password needed

http://theksmith.com/technology/beagleboard-xm-getting-started/

  • Bash command for GPIO:
    Open pin7 on expansion header, which corresponds to GPIO137:
		echo 137 > /sys/class/gpio/export
  • set port to be input:
    echo "in" > /sys/class/gpio/gpio$GPIO/direction
	*read port value:
at /sys/class/gpio/gpio$GPIO/value


PmWiki can't process your request

Cannot acquire lockfile

We are sorry for any inconvenience.