Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
... (re 5x7 font needs space) ...
Yeah i know i was trying to create my own but as you can see im not that good at font creation
you know of a good 5x7 Font already made?
The issue is i scan fonts from top to bottom and left to right like ad would be:
11111100
10000010
10000001
10000001
10000010
10000100
11111000
...
#include <p18f2525.h>
#include "nokia7110.h"
#pragma config WDT = OFF, LVP = OFF, OSC = INTIO67, XINST = OFF
unsigned rom char banner[194] = { 96, 16,
255, 7, 13, 25, 49, 225, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 161, 161, 33, 33, 161, 161, 161, 161, 161, 33, 33, 161, 161, 161, 33, 33, 161, 161, 33, 161, 161, 33, 33, 161, 161, 161, 33, 33, 33, 161, 161, 161, 33, 33, 161, 161, 161, 161, 33, 161, 161, 161, 161, 161, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 35, 38, 44, 56, 240,
7, 12, 24, 48, 96, 127, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 95, 68, 68, 95, 64, 64, 64, 95, 64, 64, 64, 79, 80, 80, 80, 79, 64, 95, 64, 67, 64, 95, 64, 73, 82, 82, 84, 73, 64, 79, 80, 80, 80, 79, 64, 95, 68, 68, 64, 64, 64, 64, 95, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 127
};
void main(void);
void main(void){
OSCCON = 0x72; //8MHz clock
while(!OSCCONbits.IOFS); //Wait for osc stable
LCD_Init(); //Initialize the LCD
CLS(); //Clear the LCD
LCDImage(banner,0,0); //This image takes line 1 & 2 since its 16 Pixels Height
LCDString((rom unsigned char*)"Line 3",0,0,0,2,0);
LCDString((rom unsigned char*)"Line 4",0,0,0,3,0);
LCDString((rom unsigned char*)"Line 5",0,0,0,4,0);
LCDString((rom unsigned char*)"Line 6",0,0,0,5,0);
LCDString((rom unsigned char*)"Line 7",0,0,0,6,0);
LCDString((rom unsigned char*)"Line 8",0,0,0,7,0);
while(1){
}
}
/* ****************************************************************************
; *
; Filename: Nokia 7110 Library (C FILE)(Nokia7110.c) *
; Date: May 27, 2009 *
; File Version: 001 *
; *
; Author: Jason Lopez *
; Company: AtomSoft *
; *
;******************************************************************************
; Parts Needed:
; Nokia 7110 ( mines from: dipmicro.com )
; PIC Micro
*/
#include "nokia7110.h"
/************************************
Variables and Defines
*************************************/
unsigned char temp;
unsigned long speed;
unsigned rom char FontA[98][8] =
{
{ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }, // ASCII - 32
{ 0x00,0x00,0x00,0x5F,0x5F,0x00,0x00,0x00 }, // ASCII - 33
{ 0x00,0x00,0x03,0x07,0x00,0x07,0x03,0x00 }, // ASCII - 34
{ 0x00,0x10,0x74,0x1C,0x77,0x1C,0x17,0x04 }, // ASCII - 35
{ 0x00,0x24,0x2E,0x2A,0x7F,0x2A,0x3A,0x10 }, // ASCII - 36
{ 0x00,0x4C,0x6A,0x76,0x1A,0x6A,0x56,0x33 }, // ASCII - 37
{ 0x00,0x30,0x7A,0x4F,0x5D,0x37,0x7A,0x48 }, // ASCII - 38
{ 0x00,0x00,0x04,0x07,0x03,0x00,0x00,0x00 }, // ASCII - 39
{ 0x00,0x00,0x00,0x1C,0x3E,0x63,0x41,0x00 }, // ASCII - 40
{ 0x00,0x00,0x41,0x63,0x3E,0x1C,0x00,0x00 }, // ASCII - 41
{ 0x00,0x08,0x2A,0x3E,0x1C,0x3E,0x2A,0x08 }, // ASCII - 42
{ 0x00,0x08,0x08,0x3E,0x3E,0x08,0x08,0x00 }, // ASCII - 43
{ 0x00,0x00,0x00,0x60,0x60,0x00,0x00,0x00 }, // ASCII - 44
{ 0x00,0x08,0x08,0x08,0x08,0x08,0x08,0x00 }, // ASCII - 45
{ 0x00,0x00,0x00,0x60,0x60,0x00,0x00,0x00 }, // ASCII - 46
{ 0x00,0x60,0x30,0x18,0x0C,0x06,0x03,0x01 }, // ASCII - 47
{ 0x00,0x1C,0x3E,0x61,0x43,0x3E,0x1C,0x00 }, // ASCII - 48
{ 0x00,0x00,0x44,0x7F,0x7F,0x40,0x00,0x00 }, // ASCII - 49
{ 0x00,0x46,0x67,0x71,0x59,0x4F,0x66,0x00 }, // ASCII - 50
{ 0x00,0x22,0x63,0x49,0x4D,0x7F,0x32,0x00 }, // ASCII - 51
{ 0x00,0x18,0x1C,0x52,0x7F,0x7F,0x50,0x00 }, // ASCII - 52
{ 0x00,0x2F,0x6F,0x45,0x45,0x7D,0x39,0x00 }, // ASCII - 53
{ 0x00,0x3C,0x7E,0x4B,0x49,0x79,0x30,0x00 }, // ASCII - 54
{ 0x00,0x07,0x43,0x71,0x7D,0x0F,0x03,0x00 }, // ASCII - 55
{ 0x00,0x36,0x7F,0x4D,0x59,0x7F,0x36,0x00 }, // ASCII - 56
{ 0x00,0x06,0x4F,0x49,0x69,0x3F,0x1E,0x00 }, // ASCII - 57
{ 0x00,0x00,0x00,0x66,0x66,0x00,0x00,0x00 }, // ASCII - 58
{ 0x00,0x00,0x00,0x66,0x66,0x00,0x00,0x00 }, // ASCII - 59
{ 0x00,0x00,0x08,0x1C,0x36,0x63,0x41,0x00 }, // ASCII - 60
{ 0x00,0x14,0x14,0x14,0x14,0x14,0x14,0x00 }, // ASCII - 61
{ 0x00,0x00,0x41,0x63,0x36,0x1C,0x08,0x00 }, // ASCII - 62
{ 0x00,0x02,0x07,0x51,0x59,0x0F,0x06,0x00 }, // ASCII - 63
{ 0x00,0x3E,0x41,0x5D,0x55,0x5D,0x51,0x1E }, // ASCII - 64
{ 0x00,0x40,0x70,0x1D,0x17,0x1F,0x78,0x60 }, // ASCII - 65
{ 0x00,0x41,0x7F,0x7F,0x49,0x4F,0x7E,0x30 }, // ASCII - 66
{ 0x00,0x1C,0x3E,0x63,0x41,0x41,0x42,0x27 }, // ASCII - 67
{ 0x00,0x41,0x7F,0x7F,0x41,0x63,0x3E,0x1C }, // ASCII - 68
{ 0x00,0x41,0x7F,0x7F,0x49,0x5D,0x41,0x63 }, // ASCII - 69
{ 0x00,0x41,0x7F,0x7F,0x49,0x1D,0x01,0x03 }, // ASCII - 70
{ 0x00,0x1C,0x3E,0x63,0x41,0x51,0x72,0x77 }, // ASCII - 71
{ 0x00,0x7F,0x7F,0x08,0x08,0x7F,0x7F,0x00 }, // ASCII - 72
{ 0x00,0x00,0x41,0x7F,0x7F,0x41,0x00,0x00 }, // ASCII - 73
{ 0x00,0x30,0x70,0x41,0x41,0x7F,0x3F,0x01 }, // ASCII - 74
{ 0x00,0x7F,0x7F,0x08,0x1C,0x77,0x63,0x41 }, // ASCII - 75
{ 0x00,0x41,0x7F,0x7F,0x41,0x40,0x60,0x70 }, // ASCII - 76
{ 0x00,0x7F,0x7E,0x0C,0x18,0x0C,0x7E,0x7F }, // ASCII - 77
{ 0x00,0x7F,0x7E,0x0C,0x18,0x30,0x7F,0x7F }, // ASCII - 78
{ 0x00,0x1C,0x3E,0x63,0x41,0x63,0x3E,0x1C }, // ASCII - 79
{ 0x00,0x41,0x7F,0x7F,0x49,0x09,0x0F,0x06 }, // ASCII - 80
{ 0x00,0x1C,0x3E,0x63,0x51,0x63,0x3E,0x1C }, // ASCII - 81
{ 0x00,0x7F,0x7F,0x09,0x19,0x7F,0x66,0x40 }, // ASCII - 82
{ 0x00,0x66,0x6F,0x4D,0x59,0x7B,0x33,0x00 }, // ASCII - 83
{ 0x00,0x03,0x41,0x7F,0x7F,0x41,0x03,0x00 }, // ASCII - 84
{ 0x00,0x3F,0x7F,0x40,0x40,0x40,0x7F,0x3F }, // ASCII - 85
{ 0x00,0x03,0x0F,0x3D,0x70,0x1D,0x07,0x01 }, // ASCII - 86
{ 0x00,0x0F,0x7F,0x30,0x1C,0x30,0x7F,0x0F }, // ASCII - 87
{ 0x00,0x63,0x77,0x1C,0x1C,0x77,0x63,0x00 }, // ASCII - 88
{ 0x01,0x03,0x47,0x7C,0x78,0x47,0x03,0x01 }, // ASCII - 89
{ 0x00,0x67,0x73,0x59,0x4D,0x67,0x73,0x00 }, // ASCII - 90
{ 0x00,0x00,0x00,0x7F,0x7F,0x41,0x41,0x00 }, // ASCII - 91
{ 0x00,0x01,0x03,0x06,0x0C,0x18,0x30,0x60 }, // ASCII - 92
{ 0x00,0x00,0x41,0x41,0x7F,0x7F,0x00,0x00 }, // ASCII - 93
{ 0x00,0x00,0x04,0x06,0x03,0x06,0x04,0x00 }, // ASCII - 94
{ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }, // ASCII - 95
{ 0x00,0x00,0x01,0x03,0x06,0x04,0x00,0x00 }, // ASCII - 96
{ 0x00,0x68,0x6C,0x54,0x54,0x3C,0x78,0x40 }, // ASCII - 97
{ 0x00,0x41,0x7F,0x3F,0x6C,0x44,0x7C,0x38 }, // ASCII - 98
{ 0x00,0x38,0x7C,0x44,0x44,0x6C,0x2C,0x00 }, // ASCII - 99
{ 0x00,0x38,0x7C,0x44,0x49,0x3F,0x7F,0x40 }, // ASCII - 100
{ 0x00,0x38,0x7C,0x54,0x54,0x5C,0x58,0x00 }, // ASCII - 101
{ 0x00,0x00,0x48,0x7E,0x7F,0x49,0x0B,0x02 }, // ASCII - 102
{ 0x00,0x48,0x7C,0x34,0x34,0x2C,0x68,0x44 }, // ASCII - 103
{ 0x00,0x41,0x7F,0x7F,0x08,0x04,0x7C,0x78 }, // ASCII - 104
{ 0x00,0x00,0x44,0x7D,0x7D,0x40,0x00,0x00 }, // ASCII - 105
{ 0x00,0x60,0x60,0x04,0x7D,0x7D,0x00,0x00 }, // ASCII - 106
{ 0x00,0x41,0x7F,0x7F,0x10,0x78,0x6C,0x44 }, // ASCII - 107
{ 0x00,0x00,0x41,0x7F,0x7F,0x40,0x00,0x00 }, // ASCII - 108
{ 0x00,0x7C,0x7C,0x0C,0x78,0x0C,0x7C,0x78 }, // ASCII - 109
{ 0x00,0x44,0x7C,0x7C,0x08,0x04,0x7C,0x78 }, // ASCII - 110
{ 0x00,0x38,0x7C,0x44,0x44,0x7C,0x38,0x00 }, // ASCII - 111
{ 0x00,0x04,0x7C,0x78,0x24,0x24,0x3C,0x18 }, // ASCII - 112
{ 0x00,0x18,0x3C,0x24,0x24,0x78,0x7C,0x00 }, // ASCII - 113
{ 0x00,0x44,0x7C,0x78,0x4C,0x04,0x1C,0x18 }, // ASCII - 114
{ 0x00,0x48,0x5C,0x5C,0x74,0x74,0x24,0x00 }, // ASCII - 115
{ 0x00,0x00,0x04,0x3E,0x7F,0x44,0x24,0x00 }, // ASCII - 116
{ 0x00,0x3C,0x7C,0x40,0x40,0x3C,0x7C,0x40 }, // ASCII - 117
{ 0x00,0x04,0x1C,0x3C,0x60,0x30,0x1C,0x04 }, // ASCII - 118
{ 0x00,0x1C,0x7C,0x30,0x1C,0x30,0x7C,0x1C }, // ASCII - 119
{ 0x00,0x44,0x6C,0x3C,0x10,0x78,0x6C,0x44 }, // ASCII - 120
{ 0x00,0x44,0x4C,0x1C,0x70,0x64,0x1C,0x0C }, // ASCII - 121
{ 0x00,0x4C,0x64,0x74,0x5C,0x4C,0x64,0x00 }, // ASCII - 122
{ 0x00,0x08,0x08,0x3E,0x77,0x41,0x41,0x00 }, // ASCII - 123
{ 0x00,0x00,0x00,0x7F,0x7F,0x00,0x00,0x00 }, // ASCII - 124
{ 0x00,0x41,0x41,0x77,0x3E,0x08,0x08,0x00 }, // ASCII - 125
{ 0x00,0x02,0x01,0x01,0x03,0x02,0x02,0x01 }, // ASCII - 126
{ 0x00,0x60,0x78,0x4E,0x47,0x5E,0x78,0x60 }, // ASCII - 127
{ 0x18,0x3C,0x7E,0xDB,0x99,0x18,0x18,0x18 } //Custom Arrow // Now ASCII: 128
};
void LCD_Init(void){
LCDt = 0x00;
A0 = 0;
DelayMs(85); //Delay 85mS
LCD_Reset();
LCD_Send(0xA6,0); //Display: Normal
LCD_Send(0xA3,0); //LCD Bias Settings: 1/7
LCD_Send(0xA1,0); //ADC Selection: Reverse
LCD_Send(0xC0,0); //Common Output: Normal Direction
//LCD_Send(0xC8,0); //Common Output: Upside Down
LCD_Send(0x22,0); //Set the V5 output Voltage
LCD_Send(0x81,0); //Set Electronic Volume Register
LCD_Send(0x2E,0); //Power Controller Set: Booster circuit: ON/Voltage regulator circuit: ON/Voltage follower circuit: OFF
LCD_Send(0x2F,0); //Power Controller Set: Voltage follower circuit: ON
LCD_Send(0xE3,0); //Non-OPeration Command
LCD_Send(0x40,0); //Set the start line
LCD_Send(0xAF,0); //LCD On
LCD_Send(0xA5,0); //Display All Points: ON
DelayMs(170); //Delay 170mS
LCD_Send(0xA4,0); //Display All Points: NORMAL
}
void CLS(void){
unsigned char i,q;
unsigned char line;
line = 0xB0;
for(q=0;q<9;q++){
LCD_Send(line,0);
LCD_Send(17,0);
LCD_Send(2,0);
for(i=0;i<0x60;i++)
LCD_Send(0x00,1);
line++;
}
}
void SendByte(unsigned char data){
char x;
for(x=0;x<8;x++){
SCL = 0;
SDO=0;
if((data & 0x80) > 0) SDO = 1;
SCL = 1;
data <<= 1;
}
}
void LCD_Send(unsigned char cmd, unsigned char type){
A0 = type;
CS = 0;
SendByte(cmd);
CS = 1;
}
void LCD_Reset(void){
CS = 1;
DelayMs(85); //Delay 85mS
RST = 1;
DelayMs(85); //Delay 85mS
}
void LCDString(rom unsigned char *str,unsigned char fade, unsigned char typed, unsigned char style, unsigned char top,unsigned char left){
char x; char y;
char fontSize,orWith;
char MyData;
unsigned char leftH, leftL;
top += 0xB0;
left += 18;
leftH = (left >> 4) | 0x10 ;
leftL = left & 0x0F ;
LCD_Send(top,0); //Page 0 (0xBx (x = page))
LCD_Send(leftH,0); //Column Upper Nybble (0x1x) (x = upper Nybble)
LCD_Send(leftL,0); //Column Lower Nybble (0x0x) (x = upper Nybble)
switch(style){
case 'u': //underline
orWith = 0x80;
break;
case 's': //strikes
orWith = 0x10;
break;
case 0x00:
orWith = 0x00;
break;
}
while(*str != 0){
y = *str++;
y -= 0x20;
for(x=0;x<8;x++){
MyData = FontA[y][x] | orWith;
LCD_Send(MyData,1);
if(fade > 0)
Delay1KTCYx(fade);
}
if(typed > 0)
Delay10KTCYx(typed);
}
}
void LCDImage(rom unsigned char *image,char top, char left){
unsigned char widthLoop, heightLoop;
unsigned char leftH, leftL;
unsigned char width, height;
width = *image++;
height = *image++;
height /= 8;
top += 0xB0;
LCD_Send(top,0);
left += 18;
leftH = (left >> 4) | 0x10 ;
leftL = left & 0x0F ;
for(heightLoop=0;heightLoop<height;heightLoop++){
LCD_Send(top,0);
LCD_Send(leftH,0);
LCD_Send(leftL,0);
for(widthLoop=0;widthLoop<width;widthLoop++){
LCD_Send(*image++,1);
}
top++;
}
}
void DelayMs(unsigned int ms){
unsigned int x;
for(x=0;x<ms;x++){
if(Mhz == 20) Delay1KTCYx(5);
if(Mhz == 16) Delay1KTCYx(4);
if(Mhz == 12) Delay1KTCYx(3);
if(Mhz == 8) Delay1KTCYx(2);
if(Mhz == 4) Delay1KTCYx(1);
}
}
/* ****************************************************************************
; *
; Filename: Nokia 7110 Library (H FILE)(Nokia7110.h) *
; Date: May 27, 2009 *
; File Version: 001 *
; *
; Author: Jason Lopez *
; Company: AtomSoft *
; *
;******************************************************************************
; Parts Needed:
; Nokia 7110
; PIC Micro
*/
#ifndef _NOKIA7110_H
#define _NOKIA7110_H
#include <p18cxxx.h>
#include <delays.h>
#include <string.h>
void CLS(void);
void LCD_Init(void);
void LCD_Reset(void);
void LCD_Send(unsigned char cmd, unsigned char type);
void LCDImage(rom unsigned char *image,char left, char top);
void LCDString(rom unsigned char *str,unsigned char fade, unsigned char typed, unsigned char style, unsigned char top,unsigned char left);
void SendByte(unsigned char data);
void DelayMs(unsigned int ms);
#define LCDt TRISC //LCD TRIS
#define RST LATCbits.LATC0 //LCD Reset PIN
#define CS LATCbits.LATC1 //LCD CS PIN
#define A0 LATCbits.LATC2 //LCD A0 (D/C) PIN
#define SCL LATCbits.LATC3 //LCD SCL (clock) PIN
#define SDO LATCbits.LATC5 //LCD SDATA PIN
#define Mhz 8 //4,8,12,16,20 Available
#endif
Special Microcontroller Features:
• C Compiler Optimized Architecture:
- Optional extended instruction set designed to
optimize re-entrant code
• 100,000 Erase/Write Cycle Enhanced Flash
Program Memory Typical
• 1,000,000 Erase/Write Cycle Data EEPROM
Memory Typical
• Flash/Data EEPROM Retention: 100 Years Typical
• Self-Programmable under Software Control
• Priority Levels for Interrupts
• 8 x 8 Single-Cycle Hardware Multiplier
• Extended Watchdog Timer (WDT):
- Programmable period from 4 ms to 131s
• Single-Supply 5V In-Circuit Serial
Programming™ (ICSP™) via Two Pins
• In-Circuit Debug (ICD) via Two Pins
• Wide Operating Voltage Range: 2.0V to 5.5V
• Programmable Brown-out Reset (BOR) with
Software Enable Option
Rather then do anything fancy I am going to try to make a PCB that solders to the pins. It should work if the pin diameters are not too large. Have it convert to a standard 2 row pin header.The space between pins is 1mm.
The space bewteen rows is 3mm.
The 2 rows are staggered on centers.
The contacts protrude less than 1mm.