Binary to Decimal Test Routine

shows the output of 16 bit binary to decimal conversion on a dot matrix LCD
 

Table of Contents [Toc]

Concept
Specifications
Project Resources
   Available Microchip PIC Assembler Source Code
 

Concept   [Toc] [Top]

This test application demonstrates the usage of the LCD assembler module files m_lcdv16.asm and m_lcdb16.asm on a PIC 16F84. These module files are suitable for displaying decimal and binary information on a dot matrix LCD. Together with the module file m_lcd.asm, they work with LCD controllers such as Hitachi HD44780 (PDF data sheet, 389 kB), Samsung KS0073 (PDF data sheet, 673 kB), and compatibles.

The program initializes the LCD display to 4 bit transfer mode, clears two 8 bit registers (LO, HI) for the 16 bit counter, and displays every counter step as decimal and binary value on the LCD display.

Shows the implementation and functionality of the modules m_wait.asm, m_lcd.asm, m_lcdv16.asm and m_lcdb16.asm on the PIC16F84. For the Samsung KS0073 controller type, the constant 'LCDTYPE' must be set to 0x1 to include also the extended function set features for configuration. If this does not help, see also the FAQ section concerning LCD communication issues.
 

LCD display
shows the use of the binary to decimal conversion module (m_lcdv16asm) and the bitstream visualization module (m_lcdb16.asm)

 

PCB test board for PIC16C84/PIC16F84
with attached dot matrix LCD display on PortB

 

Specifications   [Toc] [Top]

Processor: Microchip PIC 16F84
Clock Frequency: 4 MHz crystal (XT mode)
Throughput: 1 MIPS
Code Size of entire Program: approx. 203 instruction words
LCD Transmission Mode: 4 Bit on D4 - D7 (MSB), uses high nibble of the LCD port
LCD Connections: 7 wires (4 Data, 3 Command)
Total LCD Connections: 10 wires (4 Data, 3 Command, 1 Vdd, 1 GND, 1 Contrast)
Required Hardware: HD44780 compatible dot matrix LCD (2x16, 2x20 or 2x40 characters)

 

Project Resources   [Toc] [Top]

Available Microchip PIC Assembler Source Code   [Toc] [Top]

Main File HEX Files
Download assembler source code:
counter.asm

Download Hex File:
counter.hex

Specifications:
- used module m_lcd.asm for building HEX-file with portB as LCD port
LCD port connections:
 B0: not used, still available for INTB
 B1: D4
 B2: D5
 B3: D6
 B4: D7
 B5: E
 B6: R/W
 B7: RS

The above program needs additional include files (modules) to get successfully assembled: m_bank.asm, m_wait.asm, m_lcd.asm, m_lcdb16.asm

 

Last updated: 05.01.2005

[Toc] [Top]


If you see only this page in your browser window,
click here
to get the entire site.