# Newhaven Display Forum

## Newhaven Products => OLEDs => Topic started by: Bluesboy on August 25, 2015, 10:32:01 PM

Title: Calculation of Font Addresses Multi‐Font Displays Help!
Post by: Bluesboy on August 25, 2015, 10:32:01 PM

Display type: NHD-2.7-12864UMY3
useage: Serial SPImode

From the Font Tables and Application Guide http://www.newhavendisplay.com/app_notes/MultiFont.pdf
section 2.1 ASCII font table

and section 4.  Calculation of Font Addresses
4.1. 5x7 ASCII

I need help figuring out the what are the the ASCIICODE used in the Address function
if(ASCIICODE >= 0x20 && ASCIICODE <= 0xFF)
Address = (ASCIICODE – 0x20) *8;

example for an "A" character
is the ASCIICODE=hex 21 (from  section 2.1 ASCII font table)? or 12?
or is it =hex 41 (from a standard ASCII table)

also there is an example given in Section 5 to calculate, retrieve and display for a 32 byte Chinese character
is there an example for a simple 8 byte 5x7 ASCII? or I must rewrite to suit?

Thank you very much in advance.

Title: Re: Calculation of Font Addresses Multi‐Font Displays Help!
Post by: Saurabh_B on August 26, 2015, 09:03:02 AM
Hi,

To get the A the hex value should be 21.

There isn't a set example for the standard 5x7 fonts, you would have to rewrite the data for the language you would like to use the 4.1 calculation. So for the letter A just replace all the ASCIICODE sections with 0x21.

Parameters:
ASCIICODE: 8bit ASCII character code

if(ASCIICODE >= 0x20 && ASCIICODE <= 0xFF)
Address = (ASCIICODE – 0x20) *8;
Title: Re: Calculation of Font Addresses Multi‐Font Displays Help!
Post by: Bluesboy on September 02, 2015, 09:53:14 PM
Thank you so much...
I just what to straight out a few things with the Multi Font so I'm not going in circles!

BTW the way I have the main graphic side working and can send checker board and rectangles clear the screen etc

The procedure is as follows and please correct me if I'm wrong
Based on the Chinese example..as shown on on page 30 section 5
but I'm first trying 5x7 ASCII just for the letter "A" or 0x21 from  Font table 2.1
and
-Send string to address calculation function running  in MPU(i.e ATmel XMEGA)
and obtain address I end up with address=8 (I hope?)
-then I send a 24 byte address to the MF chip SPI (mode0) SPI_OUT data= 0x0B,0x00,0x00,0x08,0xFF (read command, 3 bytes, first two are dummy cause my address is just 0x08, than the 0xFF dummy) but the documents section 6 (page 31) say dummy byte is FF but in section 12.2 (page 31) Communication Protocol dummy byte stated to be a 0x00??
-now I switch to SPI mode3 to RX 32 bytes?? or just 8 bytes
-so if I can save or store that all (but my SPI code isn't work) but if I could than I send back out the Graphic display side
using the data command but not sure what routine.

I guess I need some help on that...almost there as I figured how to "init" the display so far.
Thank you in advance
Dave
Title: Re: Calculation of Font Addresses Multi‐Font Displays Help!
Post by: Bluesboy on September 08, 2015, 06:18:58 AM
Anyone?
Title: Re: Calculation of Font Addresses Multi‐Font Displays Help!
Post by: Saurabh_B on September 08, 2015, 09:45:34 AM
Hi,

I am looking into this, but your logic seems fine. I would stick to using the dummy variable that is in the Multi-Font display spec.
Title: Re: Calculation of Font Addresses Multi‐Font Displays Help!
Post by: Bluesboy on September 08, 2015, 12:43:05 PM
Thank you,
I have the (NHD-2.7-12864UMY3) hooked up to a LOGIC Analyser to view the SPI signals.
Using the the SERIAL Protocol SPI with a ATMEL XMEGA.

I do have the initialization C code functions working and can send graphics (Data and Command)
which I'll clean up very soon and make available to the forum.

Thanks again for any support
Title: Re: Calculation of Font Addresses Multi‐Font Displays Help!
Post by: Saurabh_B on September 11, 2015, 10:54:16 AM
Hi, Here is some information if it can help at all:

• The dummy Variable is 0xFF
• You would want to save the information coming back from the MF Chip into an 8X8 Array. The MF chip will give you 8 sets of bytes. With the bytes, B0-B7 will be the font information.
• The bits will be vertical, so you could display the information one of 2 ways, either using the bit that corresponds with the line you are currently writing and go horizontally, or go through each bit and write vertically