I also have been using arduino for ages, and never seen anythibg like it. I'm having the same problem! I had it on the uno R3, but not on the uno R2. Instead of trying to solve it I bought an arduino mega 2560 R3 and guess: the same problem again!
I can program the board without problems, but if I unplug it from the USB and plug it back, it cannot communicate through the serial port (on the mega it works on Serial1 - I've attached a FTDI cable to it )
Of course I closed the serial program and opened it again. The rx and tx led's don't even blink
Any news about it? I'm inclined to say it's related to the (new) 16u2
It's almost Pin out B, but it does not have the CS1 and CS2 lines.
I read somewhere that this controller (st7920) is compatible with the ks0108 instructions [edit] [update:maybe it's not][/edit] , but I'm not sure how to make it work here. Maybe you have to select somewhere that your LCD has only one chip and NO CS...
I'll try to learn more about it, but maybe someone could help...
I've been using a display with the KS0108B controller without problems! If you want, send me the PDFs and I'll take a look, but I don't promise a fast response nor that I'll make it work, I'm not super skilled, but have done some code tranlations from pic to arduino.
I never worked with this display, but found some products that share the same controller:
SED 156x series Nokia 7110 96 x 65 monochr. NEC 21a 132 x 32 LPH7508 100 x 64 - display kit sold by pollin Hyundai HP12542R - display kit sold by pollin
This info was found here: http://serdisplib.sourceforge.net/ wich seems to be a library writen in C for displays, but I still don't know if it's for use on a PC or on a microcontroller. [edit]UPDATE: it's for linux[/edit]
I would google the display names above with the arduino word to see what comes up.
Yeah, I was thinking about it, and scroll the pages won't work for me, as I plan to use a auto scale for the graph.
Didn't realise it could be only writes, how to do that?
I made a test routine scroling the graph and drawed it using the filled rectangle function, it's pretty fast, but I cleared the screen every update and it caused the graph to flicker.
My idea now is to rewrite it to update each column of the graph at a time, scanning the whole graph every update (1 a second or 1 every 5 seconds maybe). My first impulse was to draw a black rectangle for the value and above it a white rectangle to clear some eventual old value printed over there. It should eliminate the flickering, I guess.
After I test it, will post the result if it works.
Other thing, I was reading the library and found some "fastWrite" functions, but I just took the .cpp file with me. Is it defined somewhere else? can I use it in my code for my I/O pins? Anyway, I'll google it after, but if you can give me the tip I'll appreciate it.
Bill I read that todotani was modifying the libraryto use a frame buffer with the arduino mega - I'm using a mega. The reply number is 124 I guess.
Yesterday I finally read one datasheet for the Lc7891 and my first impresion is that it has a text mode and a graphic mode. the fonts are just for the text mode. On the graphics mode it has a set pixel command that deals with individual pixels. Also read that the pixel are organized on horizontal bytes, what is different from the ks0108.
Are you working on a new version? I didn't get it right from your message - or you mean by NEW the current version 2?
Ok, no rotation then... I would use it for a temperature logger so the y-axis would have more definition (128 pixels high)
My display is made by FORDATA, it's model is FDCG12864G and I'm not sure, but it's pinout seems to be different from the types "A" and "B" - I just followed the pin names and it worked OK from the beggining - tho I had to increase the delay a bit - it was missing some pixels
You can see a datasheet here:http://www.soldafria.com.br/datasheet/FDCG12864G.pdf
I plan to scroll the graph, so this week I'll give a go on the frame buffer mod, but i saw it was made for a older version of the library, any news on that front?
I also found a display with a LC7981 controller, but didn't have the time to take a look on how it works. When I get to know, I'll share. Do you know if is it possible to adapt your library for that?
THANKS a lot for your good work and quick replies on this topic!!!
I'd love to see it integrated into the library! I just bought a LCD and the pixels are not square, so when I draw a circle I see an ellipse, so - to correct the aspect ratio, I'm using that function. Maube I'll code something for automatic aspect ratio correction...or maybe it's overkill...
I'd like to ask another question:
Is it possible to print the text rotated by 90 degrees?
I'm thinking about using it on portrait orientation (width = 64 and height = 128)
void PlotEllipse(long CX, long CY, long XRadius,long YRadius, int color) { // portted the algorithm found at // http://homepage.smc.edu/kennedy_john/belipse.pdf // by John Kennedy
long X, Y; long XChange, YChange; long EllipseError; long TwoASquare,TwoBSquare; long StoppingX, StoppingY; TwoASquare = 2*XRadius*XRadius; TwoBSquare = 2*YRadius*YRadius; X = XRadius; Y = 0; XChange = YRadius*YRadius*(1-2*XRadius); YChange = XRadius*XRadius; EllipseError = 0; StoppingX = TwoBSquare*XRadius; StoppingY = 0;
while ( StoppingX >=StoppingY ) //first set of points,y'>-1 { Plot4EllipsePoints(CX,CY,X,Y,color); Y++; StoppingY=StoppingY+ TwoASquare; EllipseError = EllipseError+ YChange; YChange=YChange+TwoASquare; if ((2*EllipseError + XChange) > 0 ) { X--; StoppingX=StoppingX- TwoBSquare; EllipseError=EllipseError+ XChange; XChange=XChange+TwoBSquare; } } //{ first point set is done; start the 2nd set of points }
Y = YRadius; X = 0; YChange = XRadius*XRadius*(1-2*YRadius); XChange = YRadius*YRadius; EllipseError = 0; StoppingY = TwoASquare*YRadius; StoppingX = 0; while ( StoppingY >=StoppingX ) //{2nd set of points, y'< -1} { Plot4EllipsePoints(CX,CY,X,Y,color); X++; StoppingX=StoppingX + TwoBSquare; EllipseError=EllipseError+ XChange; XChange=XChange+TwoBSquare; if ((2*EllipseError + YChange) > 0 ) { Y--; StoppingY=StoppingY- TwoASquare; EllipseError=EllipseError+ YChange; YChange=YChange+TwoASquare; } } }; //{procedure PlotEllipse}
void Plot4EllipsePoints(long CX,long CY, long X, long Y, int color){ GLCD.SetDot(CX+X, CY+Y, color); //{point in quadrant 1} GLCD.SetDot(CX-X, CY+Y, color); //{point in quadrant 2} GLCD.SetDot(CX-X, CY-Y, color); //{point in quadrant 3} GLCD.SetDot(CX+X, CY-Y, color); //{point in quadrant 4} }