Discussion in "Project Help" started by    PsySc0rpi0n    Nov 27, 2014.
Tue Feb 17 2015, 05:29 am
#51
Another issue!!!

To write a custom char into CGRAM, I need first to send the command 0x40 so that the custom char is written into 1st position of CGRAM.
Then we just need to send, code by code for each of the 8 lines of each position in CGRAM.

But is it possible to write directly into any other position rather than the 1st??? For instance, I already used all 8 available custom chars and I can discard last 2 positions and write there 2 new ones.
I'm trying to do this by first send the command 0x46, then send the 8 codes for that position, then I send the command for the last position 0x47 and lastly I send the 8 codes for last position but it is not writing what I want where I want...

The code is attached.
Attachment



Edited;
Also solved!


[ Edited Tue Feb 17 2015, 06:22 pm ]
Tue Feb 17 2015, 07:10 pm
#52
Anyone with a similar problem should read Ajay's tutorial
http://www.8051projects.net/lcd-interfacing/lcd-custom-character.php
Basically CGRAM characters start at addresses 8 bytes apart.
The command for the first is 0x40 ,for the second is 0x48,
and for the last is 0x78.


[ Edited Tue Feb 17 2015, 07:17 pm ]
Thu Feb 19 2015, 11:52 pm
#53
As mentioned by Phil, CGRAM location starts from 0x40 to 0x7F. so your first character starts with 0x40.
The CGRAM addresses for each character are mention in a table on this page:
http://www.8051projects.net/lcd-interfacing/lcd-custom-character.php

Just add 0x40 to get the address of character you know to create.
Fri Feb 20 2015, 02:40 pm
#54
I've already read that tutorial and almost all other tutos from that section. It helped me a lot but some issues that were not covered in those tutos.

Anyway, now I'm trying to find a way to create motion by moving my chars 1 bit to the right or to the left using bitshifting but I still couldn't work out a way yet! Any tips are welcome!

Thanks
Psy
Wed Feb 25 2015, 10:06 am
#55

I've already read that tutorial and almost all other tutos from that section. It helped me a lot but some issues that were not covered in those tutos.

PsySc0rpi0n


I would really like to know about this

Anyway, now I'm trying to find a way to create motion by moving my chars 1 bit to the right or to the left using bitshifting but I still couldn't work out a way yet! Any tips are welcome!

PsySc0rpi0n


There is no better way than creating a buffer, manipulate it and then write to CGRAM. This way you can keep track of data you're modifying. The only thing to keep in mind is you can only have 8 characters. If you can provide some idea on what kind of movement you want, is it related to only 1 character or all 8 then I can provide better solution.
Wed Feb 25 2015, 02:54 pm
#56


I've already read that tutorial and almost all other tutos from that section. It helped me a lot but some issues that were not covered in those tutos.

PsySc0rpi0n


I would really like to know about this

ajay_bhargav



Details as real timings to make the code work in real hardware or even the fact that the CGRAM chars are automatically updated in DDRAM if they are changed in CGRAM. And some other details I can't remember now!

[quote]

Anyway, now I'm trying to find a way to create motion by moving my chars 1 bit to the right or to the left using bitshifting but I still couldn't work out a way yet! Any tips are welcome!

PsySc0rpi0n




There is no better way than creating a buffer, manipulate it and then write to CGRAM. This way you can keep track of data you're modifying. The only thing to keep in mind is you can only have 8 characters. If you can provide some idea on what kind of movement you want, is it related to only 1 character or all 8 then I can provide better solution.

ajay_bhargav



I'm talking about to slide any char to the right or to the left in the LCD but bit by bit and not char by char.
And yes, chars that are made by multimple single CGRAM chars. If only 8 are available, well, so be it!
Wed Feb 25 2015, 07:32 pm
#57
You will need a 64 bytes buffer that will be written to CGRAM for 8 characters. now usually you will start from location 0 when writing normally to CGRAM. when shifting one bit or say pixel then dump buffer starting from 1 to 63 and then rollover till 0.. then start from 2 till 63 and then 0, 1.. and so on. Hope you get the idea now.

Now exiting thing here is you dont have to write to DDRAM all those 8 characters every time. Once the character is displayed on DDRAM, and if CGRAM content is changed, it will be reflected on DDRAM automatically. So once you have displayed CGRAM characters, you only have to modify CGRAM content to give a moving look.

Get Social

Information

Powered by e107 Forum System

Downloads

Comments

Robertrip
Fri Apr 26 2024, 11:20 am
ArnoldDiant
Fri Apr 26 2024, 03:53 am
RodneyKnorb
Thu Apr 25 2024, 07:08 pm
Williamjef
Thu Apr 25 2024, 02:08 pm
SamuelSmise
Thu Apr 25 2024, 09:56 am
DustinErele
Thu Apr 25 2024, 08:44 am
ztaletpzca
Wed Apr 24 2024, 11:19 pm
IrardlPex
Wed Apr 24 2024, 08:42 pm