Page 1 of 1
Creating a virtual ARM7 Processor
Posted: Tue Apr 15, 2008 11:10 pm
by markl22
I am working with the GLK240128-25 Graphic LCD for a school project and we have an ARM7 32 bit processor. I am in charge of programming the LCD and we are still trying to debug our board to get our processor working. I am wondering if anyone has a GUI or command line program that mimics the communication between my LCD and an ARM7.
I need to start designing GUI menus and text by using the hex commands defined in the documentation but I don't believe you can do that by using MOGD#. I was thinking about writing something in either C or C# but can someone give me some documentation, insight, or help with my issue?
I am using the RS-232 Serial connection to communicate over the I2C bus lines, but this is an example of what I want to do as a simple function:
DrawButton(x1, y1, x2, y2) {
Draw a box in location x1, y1, x2, y2
Draw text within that box
}
So I'm guessing this would be sent from the processor's memory to the LCD with Hex codes like:
0x70 0x45 1, 2, 4, 5
0x70 0x42 BLAH
NOTE: I know those are not the right hex codes.
Posted: Wed Apr 16, 2008 8:12 am
by Ray
Are you programming the arm7 using C? If you are just hook up the LCD to your PC instead of the arm and write two functions SendChar and ReadChar on the PC side.
Then start implementing stuff as
Code: Select all
void SetPixel(unsigned char x, unsigned char y)
{
SendChar(254);
SendChar(112);
SendChar(x);
SendChar(y);
}
void DrawLine(unsigned char x1,unsigned char y1,unsigned char x2,unsigned char y2)
{
SendChar(254);
SendChar(108);
SendChar(x1);
SendChar(y1);
SendChar(x2);
SendChar(y2);
}
And build up your code to drive your GUI on the pc , once the actual ARM7 is working replace the implementations of the SendChar and ReadChar functions with its ARM7 counterparts and you should be up running in a matter of minutes.
Posted: Wed Apr 16, 2008 10:41 am
by markl22
Yes, the ARM7 will be programmed in C. So when you say to implement a sendchar and readchar function, I'm assuming there is an I2C library that I can use that will send data out of the Serial port on my computer?
Posted: Wed Apr 16, 2008 10:53 am
by Ray
The serial port on your PC is an rs232 port now I have heard stories of people bitbanging i2c out of it I have never seen a library for it or some actual documentation on how they did it (if they did it at all)
Since you seem to be on a deadline its probably faster to put the GLK into rs232 mode and just hook it up directly to your PC and put it back into either I2C or TTL mode (whatever you prefer) when you hook back up to the ARM.
Posted: Tue Apr 22, 2008 4:14 pm
by markl22
I downloaded a RS232 COM port program that allows me to send commands over the serial port, but it requires everything to be converted into HEX. I tried to google some ways to use C to communicate over the serial port but I couldn't find anything. Can anyone send me some source code, links, or give me some tips to help jump start my programming?
Posted: Tue Apr 22, 2008 4:35 pm
by Ray
Take a look at
this thread
Posted: Tue Apr 22, 2008 7:13 pm
by markl22
I've never used VC++ before and when I tried to build those projects, they failed with errors I didn't really understand. I imagine that there are some missing include libraries or I need the full version of Visual C++. There isn't a simple way to do this in C, Java, or Python? Those are the languages I know the best, but since all I need to do is write a series of hex codes it really doesn't matter what language I use.
Posted: Wed Apr 23, 2008 3:26 pm
by Ray
The sample code I linked to is really as easy as it gets, atleast in C if you just want an application to enter some commands and send it off to the display i can suggest
uProject
Posted: Wed Apr 23, 2008 3:32 pm
by markl22
We got our processor up and running and we're communicating over I2C. Sorry for asking so many questions but thanks for all your help.