MEEPS - Software

J. Dunmire
The following table has links and summary descriptions of example software that is available for MEEPS (Modular Embedded Experimenter's PIC System). Unless otherwise noted, these programs assume that the crystal on the MEEPS CPU is 20MHz.
Jump to:

NOTE: You may find that line endings are a problem. The MPLAB tools, particularly the assembler and hex loader, will only work properly with files that have DOS style (CR/NL) line endings. The files below are served from a UNIX system and I have to take extra steps to reformat the files as DOS files. So if you have trouble with a file, check the line endings.

WARNING: MPLAB does a particularly poor job of informing you that a file does not have the expected line endings. MPLAB will appear to load an assembly source file with out problem, but when you run the assembler you will probably get an error on line 2.

The hex loader (File->Import) is even worse. It loads the file without any errors or warnings, but if you look at the program memory you will find that nothing was written to the program memory!



Processor
Title Description 18F 16F 12F Language
QwikBug
src hex web
QwikBug is a bootloader developed by students at Georgia Tech for use with the QwikFlash board described in the book Embedded Design with the PIC18F452 Microcontroller by John B. Peatman.

QwikBug is only available for the PIC18F processors. It includes support for breakpoints, single stepping, register dump, and a watch list. If you don't have access to an in-ciruit debugger or emulator (such as the Microchip MPLAP ICD2), then you will really appreciate the debug feature in this bootloader.

The debug features come with a price:

  • Pins RB6/PGD and RB5/PGC are not avaiable for application use.
  • The UART is configured for 38400 baud by QwikBug after any reset.
  • If the program interupt feature is enabled (J106 installed), then any serial data sent to MEEPS will force a jump into Qwikbug.

QwikBug runs on MEEPS without modification. The links to the left are therefore links to the download section of the Embedded Design with the PIC18F452 Microcontroller website.

Note: If MEEPS is constructed with a 20MHz crystal (for compatiblity with the bootloaders and applications listed below) then the UART will be set for 38400 baud and there will be only a 2 second startup delay.

Jumper settings:

J105 J106 J107 J108 J109 J110 J111
open closed don't care 1-2 or open 1-2 or open 1-2 1-2
Assembly
QwikLoader
src hex
This is a bootloader for the PIC16F877 that uses the UART. All you need is a terminal program (such as HyperTerm) to upload hex files to the PIC. This bootloader also supports hex file download (from the PIC), user version numbers (a great way to track what you have installed), and simple commands to view and write to EEPROM.

QwikLoader runs at 19200 baud (with a 20MHz crystal). It does not require user applications to be relocated. Default settings for PICCLITE and MPASM will produce programs that are compatible with QwikLoader.

QwikLoader is based on PICloader which was written by Rick Farmer. The latest version of PICloader, and associated documentation, are available at the PICloader web site.

Documentation for QwikLoader is included in the comments at the head of the source file. If you want to modify QwikLoader, you should also get a copy of the test files. The associated README file provides minimal documentation for the tests.

QwikLoader is distributed under the GNU Public License (GPL).

Jumper settings:

J105 J106 J107 J108 J109 J110 J111
open open closed 1-2 open 1-2 1-2
Assembly
WLoader
zip web
This is a bootloader for the PIC16F877. Written by Wouter van Ooijen, author of Jal and other tools for the PIC, and requires XWisp running on the host to send hex files to the PIC16F877.

This bootloader was used for the ECPE5 project in the spring of 2003.

WLoader does not use the UART on the PIC16F877.

Jumper settings:

J105 J106 J107 J108 J109 J110 J111
closed open closed 2-3 2-3 2-3 or open 2-3 or open
Assembly
dotMatrixTest
src hex
This is a simple test program to ripple the all of the LEDs in the dot maxtrix display on the DISPLAY board.
C18
leds+UART
src hex
This is a test program for the CPU section. It will ripple the 4 LEDs on the CPU section and sent the test "MEEPS CPU" out the serial port at 38400.
C18
printTemp
src hex
This is a simple program that simultaneously tests the serial port on the CPU and the DS1821 on the DISPLAY daughterboard. The temperature is read once per second and printed to the serial port (using the built-in UART) at 38400 baud.

This program requires f877_jlib, libDS1821v2, usart.jal, and convert_C2F.jal.

Jal
f877_jlib
src
This JAL library adds 16F877 specific procedures that are missing from jlib.jal (provided with JAL). jlib.jal is included by this library, so this library can be included in place of jlib.jal.
Jal
libDS1821v2
src
Functions to access the DS1821 temperature sensor. This is a JAL library and not a standalone program. Functions in this library are:
  • oneWire_init - initialize communications to DS1821
  • oneWire_write_byte - write a byte to the 1-wire bus
  • oneWire_read_byte -write a byte to the DS1821
  • ds1821_read_temp - reads temperature from the DS1821.
  • ds1821_read_temp_sm - state machine to read the temperature.
This library is hardcoded for a DS1821 connected to pin B5.
Jal
usart.jal
src
Functions to access the 16F877 USART. This is a JAL library and not a standalone program. Functions in this library are:
  • usart_config - setup the on-chip USART and I/O pins
  • putc - output a character
  • hex - translate a 4-bit value to a hex digit
This is not a complete I/O library and includes only routines that were needed to support printTemp.
Jal
convert_C2F.jal
src
This Jal 'library' consists of a single function that coverts degrees C to degrees F using only integer math. This is a JAL library and not a standalone program. The function is named 'c2f'.
Jal
level
src hex
This is a simple electronic level using the ADXL202 and the dot matrix display. LEDs D102 and D103 must be removed because the ADXL202 outputs will not sink enough current to pull the signals to a logic 0 value with the LEDs installed.

The resolution of this electronic level is very crude. This is really just demonstrates that the ADXL202 is working.

There are hard coded zero offset values in the program than will have to be modified to make this program work reasonably on your board.

PICCLITE

Processors

MEEPS supports multiple microcontrollers (processors). The CPU section can be built with either the PIC18F452 or the PIC16F877. The REMOTE section can use either the PIC18F1220/1320 or the PIC12F675. Though these processors share a common assembly language, their binary instructions differ.

PIC18F452

The PIC18F452 can run at clock frequencies up to 40MHz. It has 16k words of program storage, 256 bytes of EEPROM, and 1536 bytes or RAM. A full description is available at the Microchip web site.

PIC16F877

The PIC16F877 was used in the ECPE5 project. It has 8k words of program memory, 256 bytes of EEPROM, and 368 bytes of RAM. Note that there is an A version of this part. The A version will work on the MEEPS board, but it is not compatible with any of the bootloaders listed above.

PIC12F6xx

The PIC12F6xx processor is a small 8-pin surface mount part. It is available as the PIC12F675, with 4 ADC channels, or the PIC12F629, without ADC. Both versions have 1024 words of program memory, 128 bytes of EEPROM, and 64 bytes of RAM.

Due to the limited number of I/O pins and memory space a bootloader is not available for this part.

PIC18F1x20

The PIC18F1220 and PIC18F1320 are reduced pin count versions of the PIC18F452. The only difference between the PIC18F1220 and the PIC18F1320 is the program memory 2k and 4k words respectively. The PIC18F1x20 parts are binary compatible with the PIC18F452.

Languages

C18

C18 refers to the C cross compiler available from Microchip. It only produces code for the PIC18F processors. A 3 month demo version is available. For more details refer to the C18 web site.

PICCLITE

PICCLITE is a free verson of the PICC cross comiler from HI-TECH. The free version supports a limited list of process, but the PIC16F877 is one of them.

Assembly

Assembly refers to the PIC assembly language. Microchip provides a free assembler and an integrated development enviroment (IDE). They are available on the development tools section of the Microchip web site.

Jal

Jal is a language and compiler developed by Wouter van Ooijen. This compiler was used for the ECPE5 project.


$Date: 2008-10-21 19:17:34 $
$Revision: 1.8 $
$Source: /home/cvsroot/MEEPSTop/software/index.html,v $
Contact me by email: jedunmire at gmail.com