Internal character ROM
Cobalt
Posts: 31
I have a graphic LCD that I've been able to interface to, but it doesn't have a built-in character table. No problem since the Propeller does! I want to be able to write from the charater map in the Prop's ROM to the LCD, but I have one little problem:
I don't know how to get the data from the ROM
I'm sure it is just very simple code, but I would like some help on how to access the ROM to send it to my LCD. Thanks.
I don't know how to get the data from the ROM
I'm sure it is just very simple code, but I would like some help on how to access the ROM to send it to my LCD. Thanks.
Comments
Graham
Let me see if I am reading this right:
VAR
long temp
PUB Main
temp := long[noparse][[/noparse]$8000]
This would put the long from $8000 (the start of the character ROM) into the long var "charlong" I take it? (I ask because I'm at school still, not in front of my stuff) I also assume that when I get a long from the ROM, it is a row of data from left to right... am I correct at this too?
Also, to clairify the character ROM design, the characters are kind of 'meshed' together into a 32x32 bit square (4 longs x 32)?
I read the section at the start of the manual (p. 32) with the character map, but it really didn't make 100% sence.
I need a "Propeller for Dummies" book!
What you have written looks right to me but it would provide you with the first row of the first two characters, each character pair is made up of 32 longs (which are 32bit each).
The long you read is just a number so its 01010101_01010101_01010101_01010101 or something
It says the left most pixel is the lowest bit so I assume that means that the lsb is the top left pixel of the first character (which is why the last diagram shows it flipped). The next bit is the top left of the other character and so it goes on. Considering the letters shown it goes:
I think the wording of the manual tends to be correct rather than helpful.
Graham
·
There is probably an easier way to do this, but here is·the formula·I used to extract the 'meshed' ROM data in·the VGA graphics driver.
·
The Character table is located at $8000
·
Y ranges from 0 to 31
X·ranges from 0 to 15 and is represented within a word but is interdigitated as a long (see below)
chr is the ASCII character value
·
·
The formula that I used is as follows....
·
X = long[noparse][[/noparse] $8000 + y*4·+ chr*$40 - (chr & 1)*$40 ]
···
convert·interdigitated long to non-interdigitated word:
···
X_Data returnes a non-interdigitated word value
·
·
·
·
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Beau Schwabe
IC Layout Engineer
Parallax, Inc.
Post Edited (Beau Schwabe (Parallax)) : 10/23/2006 7:01:53 PM GMT
Wow, ok, for starters I thank you for taking time to help me out on this, and I am really glad that you are trying. I have no doubt in my mind that this code works, but due to my lack of coding syntax abilities, I can honestly say that I understand about 70% of that.
I can tell that there are multiple variables that need to be defined somehow, but I'm not sure which ones.
X_Data, X_bit, MaskBit, X, and chr all ovbiously need to be delt with, and I know that 'chr' is the ASCII character I want, and that X_Data is the word value from the ROM. 'X' seems easy enough to get from the niffty little equation you provided. However, the X_bit and MaskBit both seem to just be temporary spots for the method. I want to be able to use this in its own PUB, such that I can call it as needed. I tried this, but it didn't seem to work out too well:
This way, I would just use 'chr' and 'X', and the GetChr method would modify X_Data to what I wanted. I'm not sure if this is a proper way of doing this, I'm quite certain that my code has wonderful errors!
Also, if I wanted to read only the first or second byte of the X_Data word, what would be the proper command, would "X_Data.byte[noparse][[/noparse]x]" work? (x = the byte)
Thank you!
You don't need to define any variables outside of the PUB.· By stating the variables within the PUB in this way...
...you are already defining chr, Y, MaskBit, X_Bit, and X·as variables.·
Here is·"tested" code that is a bit more compact.
When you call GetChr, you only need to specify the Y location (0-31) and the Character.·
To get the upper BYTE...
To get the lower BYTE...
..In both cases, you only need to define ByteVar.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Beau Schwabe
IC Layout Engineer
Parallax, Inc.
Post Edited (Beau Schwabe (Parallax)) : 10/24/2006 5:55:26 PM GMT
I'll try and post some results later tonight.
Again, thank you very much!