527
HTTP/1.1 200 OK
Date: Sat, 18 Jun 2005 20:18:58 GMT
Server: Apache/1.3.26 (Unix) Debian GNU/Linux mod_perl/1.26 mod_ssl/2.8.9 OpenSSL/0.9.6g PHP/4.1.2
Last-Modified: Thu, 07 Sep 2000 23:35:32 GMT
ETag: "95c9b6-527-39b82644"
Accept-Ranges: bytes
Content-Length: 1319
Keep-Alive: timeout=15, max=99
Connection: Keep-Alive
Content-Type: text/x-csrc

// File LCD14543.C Jonathan W. Valvano
// LCD interface using MC14543 from Chapter 8
#include <hc12.h>
unsigned int umin(unsigned int x, unsigned int y){
  if(x<y) return x; else return y;}
void LCDOutDigit(unsigned char position, unsigned char data) {
// position is 0x80, 0x40, 0x20, or 0x10  and data is the BCD digit
        PORTH = 0x0F & data;  // set BCD digit on the A-D inputs of the MC14543B
        PORTH|= position;     // toggle one of the LD inputs high
        PORTH = 0x0F & data;} // LD=0, latch digit into MC14543B


void LCDOutNum(unsigned int data) {unsigned int digit,num,i;
unsigned char pos;
      num=umin(data,9999); // data should be unsigned from 0 to 9999
      pos=0x10;   // position of first digit (ones)
      for(i=0;i<4;i++){
          digit=num%10; num=num/10; // next BCD digit 0 to 9
          LCDOutDigit(pos,digit); pos=pos<<1;}}

void LCDOut (unsigned char *pt) {unsigned int i;  unsigned char mask;

0

