Electronic Projects, forums and more.

Go Back   Electronic Circuits Projects Diagrams Free > Electronics Categories > Micro Controllers


Micro Controllers Discuss all aspects of micro controllers - building them, coding them, etc. All controllers are welcome - PIC, BASIC, Z8 Encore!, etc.

Reply
 
Tools
Old 23rd June 2009, 02:22 PM   #76
Default

looks like it is writing to the lcd, except that it does so every other page. what if you hardwire y=0 or y=1 in the clearscreen() and see what happens.

by the way, y should go to 127 (columns), not 64 (rows).
millwood is offline  
Old 23rd June 2009, 02:25 PM   #77
Default

i write to both sides at the same time so i only need to write to half the amount of times:
Code:
	ClrPin(GLCD_CS1);
	ClrPin(GLCD_CS2);

	for(y=0;y<8;y++)		//page loop
	{
		GLCD_Write_Cmd((0xB8 + y));
		for(x=0;x<64;x++){	//y loop
			GLCD_Write_Data(FILL);
		}
	}
AtomSoft is offline  
Old 23rd June 2009, 02:37 PM   #78
Default

Wow this is funny.. i think its a OSC type issue:

Code:
		GLCD_Write_Cmd(0xB8);
		for(x=0;x<64;x++){	//y loop
			GLCD_Write_Data(FILL);
		}
If i put the 0xB8 in manually it works. if i used B9 it works on line 2. It works but when i put 2 side by side like:

Code:
		GLCD_Write_Cmd(0xB8);
		for(x=0;x<64;x++){	//y loop
			GLCD_Write_Data(FILL);
		}
		GLCD_Write_Cmd(0xB9);
		for(x=0;x<64;x++){	//y loop
			GLCD_Write_Data(FILL);
		}
It doesnt work for line 2... any thoughts?
AtomSoft is offline  
Old 23rd June 2009, 03:16 PM   #79
Default

because you used ADC and the column counter is automatically incrementing.

you will need to reset the column counter by pulling it back to column 0 after you go to a new page.
millwood is offline  
Old 23rd June 2009, 03:30 PM   #80
Default

GOD DAMN GENIUS!!!! thanks lol great work man. That was driving me crazy. I think i lost 2 hairs lol
AtomSoft is offline  
Old 23rd June 2009, 05:45 PM   #81
Default

hey i got another GLCD issue. I know im a pain in the butt.... but when using proteus is it supposed to show like this? I have used the equevilent code on a PIC and it works but for this proteus it doesnt seem to show it right:
Code:
void PutMsg(unsigned char left, unsigned char tLine, unsigned char *msg){
unsigned char side;
screen_left = left;
screen_line = tLine;

		if(screen_left > 64){
			screen_left -= 64;
			SetPin(GLCD_CS1);
			ClrPin(GLCD_CS2);
			side = 1;
		}else{
			SetPin(GLCD_CS2);
			ClrPin(GLCD_CS1);
			side = 0;
		}

		GLCD_Write_Cmd(0xB8+screen_line);
		GLCD_Write_Cmd(0x40+screen_left);

	while(*msg){
		if(screen_left > 63){
			screen_left=0;
			if(side == 0){
				SetPin(GLCD_CS1);
				ClrPin(GLCD_CS2);
				side = 1;		
				GLCD_Write_Cmd(0xB8+screen_line);
				GLCD_Write_Cmd(0x40);
			} else {
				screen_line+=1;
				SetPin(GLCD_CS2);
				ClrPin(GLCD_CS1);
				side = 0;
				GLCD_Write_Cmd(0xB8+screen_line);				
				GLCD_Write_Cmd(0x40);
			}
		}

		PutChar(*msg++);
		screen_left += 8;
		
	}
		
}


If i change the 63 to a 95 it works fine but there are only 64 pixels on each CSx am i right? so this would have to count to 64
Attached Thumbnails
ARM Cortex-text.jpg  
AtomSoft is offline  
Old 23rd June 2009, 06:10 PM   #82
Default

you will have to consult the datasheet for your display for that. for some of them, you just pull down both cs0/cs1 and tread both halves as one continuous page from 0 - 127.

try that to see if it works.
millwood is offline  
Old 23rd June 2009, 06:55 PM   #83
Default

I currently work with the LM3S8962 microcontroller for my research group, so I may be able to help if you have questions. However, my work has been with adding support to the operating system (such as I2C recently), the firmware I work on already has the hard stuff done for me (the NVIC seemed really goofy to work with at first haha). Our group bought a really cheap LM3S9B92 eval board but unfortunately OpenOCD is not working for me for it.
__________________
www.salgat.net

Last edited by Salgat; 23rd June 2009 at 06:56 PM.
Salgat is offline  
Old 23rd June 2009, 07:42 PM   #84
Default

I have a couple LM3S811 on my Digikey order sheet, but all the transceivers I want are currently out of stock, so I'm holding the order until they get something in. I just plan to play with them a bit. My initial optimism is a little worn on these things. 128k and 256k parts are pretty close to ARM7 prices on Digikey.
__________________
Mark Higgins
DirtyLude is online now  
Old 23rd June 2009, 07:48 PM   #85
Default

There are 128 Pixels on the screen but split in half

CS1 (side LEFT)
CS2 (side RIGHT)

Those lines are active low. If i set both low then i am writing to both at 1 time. There is no way to set it to write to 0 - 127 pixels. Its 0-63(left) then 0-63(right) which is what my code does.

The image above shows 8 Characters on left and right. Each character is 8x8 Pixels. Now if there are 8 on the left 8x8CHAR * 8 times = 64 Pixels for 8 chars. Since there are eight on each side and a huge gap in the middle im thinking its a proteus issue.
AtomSoft is offline  
Old 23rd June 2009, 09:26 PM   #86
Default

hey guys i just noticed with uVision when you create a project it makes a startup.s file. As default this enables the PLL which in turn amps the 10mhz crystal into 40MHz. Maybe im moving too fast through code. The LCD can go about 300kHz.

So the delays should be more like:
Code:
void Delay_uS(unsigned long time){
	unsigned long x,y;
	for(x=0;x<time;x++){
		for(y=0;y<10;y++){
			;
		}
	}
}
void Delay_mS(unsigned long time){
	unsigned long x;
	for(x=0;x<time;x++){
		Delay_uS(1000);
	}
}
AtomSoft is offline  
Old 23rd June 2009, 09:32 PM   #87
Default

jason, the font looks like 5+1 font (5 columns of letters + 1 empty column). so 6*8=48, and you are short of 64-48=16 columns, which may be that gap.
millwood is offline  
Old 23rd June 2009, 09:49 PM   #88
Default

lol you was close....
its 7 bytes long but the loop ends then it adds a 0x00.
It has special code for font 0x55 is supposed not print. Like if the loop encounters a 0x55 in the loop it doesn't put it on screen. I guess i was retarded back then lol... so i edit the code and not its GREAT!

Code:
void PutChar(unsigned char data){
unsigned char i,d;
	if(data >= 0x20){
		data -= 0x20;
		for(i=0;i<7;i++){
			d=Font[data][i];
			if(d == 0x55)
				GLCD_Write_Data(0x00);
			else
				GLCD_Write_Data(~d);
		}
	}
		GLCD_Write_Data(0x00);		//Noir sur Blanc
}
I will edit the font to show only the 8x7 and remove the blank 0x00
Attached Thumbnails
ARM Cortex-font.jpg  

Last edited by AtomSoft; 23rd June 2009 at 09:49 PM.
AtomSoft is offline  
Old 23rd June 2009, 10:03 PM   #89
Default

char '\' is a control sequence in C. to print it, you have to print it twice.
millwood is offline  
Old 23rd June 2009, 11:18 PM   #90
Default

This GLCD Stuff is killing me lol im going to start from scratch but this time im going to learn about the LPC2106 OSC. And try my best to get timing down pack.

I know how to control pins, create ports and get input from a Pin/Port so now i need to know how the PLL and stuff fits in with that startup.s file

Last edited by AtomSoft; 23rd June 2009 at 11:18 PM.
AtomSoft is offline  
Reply

Tags
arm, cortex

Thread Tools
Display Modes


Similar
Title Starter Forum Replies Latest
ARM Cortex Microcontrollers? dknguyen Micro Controllers 0 10th February 2009 12:37 AM
ARM Cortex-M3 DSP dknguyen Micro Controllers 1 2nd February 2009 04:47 PM



All times are GMT. The time now is 11:39 PM.


Electronic Circuits  |  Learning Electronics
eXTReMe Tracker