They are I also went though and converted 00000001 then 00000010 and so on to hex, plugged it into the test file with the deadend still in place, then tested the appropriate pins for voltage. Each one came on properly. Is this leaning more towards a hardware problem? I have plugged in 3 of my 4 screen and all of them did the same thing....nothing.
I'm a bit confused about what is working and not working in the last half an hour. Just to add, try Lcd_Write_Com($FF,$FF) which should find any pins that are not going high. If you say one of the pins is not going high, disconnect it from the propeller. That should determine if it is the propeller or the display.
These are the pins that went high on the display : 21 (DB0), 23 (DB2), 26 (DB5), and 27 (DB6).
should be high, low, high,low,low,high,high,high. So same as what you say except DB7 high as well
After a second or two, a few of the pins would go low, then come back to high
That definitely does not sound right. If the prop is hanging the volts should be rock solid. Do you have bypass caps on the propeller? Caps around the voltage regulators?
Almost worth putting 8 leds on P0-P7 so you can see the data going out...
The pins would go high then low again when using just the repeat, not the Deadend function. I just did as advised with the $FF, $FF and all pins were high.
That couldn't hurt, for debugging. Remember you're accessing the display in 16 bit mode the aurdino code won't work properly. look at the command table in http://www.allshore.com/pdf/IlitekILI9340.pdf
for the value to change
Here is something that is written on Itead's website on the page to purchase that display :
ITDB02 default use the 8bit mode , and if you need the 16 bit mode, you can tear the LCD screen down form the board , and move the R2 resistor to R1 to change the data mode. It’s a hard job , and easy to destroy the screen, so if you need a 16bit mode , you had better tell us before shipping , we will set the data mode for you. When you use the 8bit mode , the DB8-DB15 is used ,please remember to pull the DB0-DB7 to GND.
The pins would go high then low again when using just the repeat
repeat should still hang the propeller. The exception would be if you had other cogs running and changing the pins but there are no other cogs running.
I wonder about the stability of the prop. 22uF near the power pins and two 0.uF caps in the appropriate places one above and one below the pins?
A test for stability - add a new deadend. Pick another free pin and attach a 1k resistor and led
Might be able to change in software? http://www.allshore.com/pdf/IlitekILI9340.pdf page 196. set rim = 0, colmode = 101 (65k) rgb interface 16 bit mode? wait, I think thats the wrong datasheet. I'll find it
*edit*
looks like http://www.adafruit.com/datasheets/ILI9325.pdf is the right datasheeet,
I have no clue...Tried to find it. On my screen there is a register that overrides hardware setting.
I think these displays can do all sorts of modes, serial, 8 bit, 16 bit, and I think there are even others.
Of all these, I believe the 16 bit is the simplest, but we probably should explore 8 bit down the track as it does use less propeller pins.
However, that is going off on a tangent. There is something not right about values on propeller pins changing when the propeller has entered an endless repeat loop.
I figured out what was causing the high low problem.... Apparently, I had some kind of sticky residue on the tip of the positive lead of my meter. I think one of my kids got a hold of it after eating candy...
I just pulled the screen from one of my boards and sure enough, the resistor is on R2 meaning the display is in 8 bit mode. So what is the difference in speed, quality of 8 bit? Can I use the prop to run the display in 8 bit? I am not looking to have full blown graphics on this screen. It is for an automotive environment so it does not need to be extremely fancy.
I think these displays can do all sorts of modes, serial, 8 bit, 16 bit, and I think there are even others.
Of all these, I believe the 16 bit is the simplest, but we probably should explore 8 bit down the track as it does use less propeller pins.
However, that is going off on a tangent. There is something not right about values on propeller pins changing when the propeller has entered an endless repeat loop.
If you have access to a TV it could be helpful to add the three TV resistors and a TV display object and use that for debugging. At least you can see if the propeller has gone haywire.
I would imagine 8 bit mode to be a bit slow. I know running 16 bit mode, a full blank screen draw IN ASM is about a second.. 12 in spin.. So speed would be the MAIN issue. There is MOST likely a register to set 16 bit mode that will override the hardware. I looked through the datasheet but couldn't find it. sorry
I will see if I can move the resistor. That is the smallest resistor I have ever seen and it is on a flexible PCB. This will test my soldering abilities for sure!
Nope, no change When the screen actually comes on, is it supposed to be a different color than black? I know the back light makes it look a grayish color.
EDIT :
So 8 bit mode would actually take longer to do different things on the display? How do all these mp3 players, cell phones, and other touch screen devices run their displays so fast? All I am really looking for is to display an image of my logo on the bootup of the display which will be loaded into the SD card, once loaded, it will communicate with my other prop which is the main brain that does other things too, then it will show real time information which is sent from the main prop to show the user a few different things like speed, gear, throttle, rpm, and maybe a couple more things. The touch screen is so the user can enter into the programming menu to set their up their product the way they like it. The menu system will be a screen which will show one updatable item at a time with a right arrow, left arrow, and a Save button. Once the user clicks save, it will send information back to the main brain to save to the eeprom. Basically, it is just like a monitor on a computer for the main brain of my product with touch capabilities to avoid buttons and keep it small.
Just did and it is still good. I am about 99.8% sure it is because the resistor R2 is not on R1 on the back of the ribbon cable from the display to the board. If 8 bit would work for me, I would love to try it out! Speed is a nice thing to have though. My cellphone is a stupid phone with a touchscreen and the display on it runs pretty quick. Got to keep up with technology
I tried your example to draw a larger box and still nothing
I connected 9 LED's (that's all I have for some reason) to the data pins and they came on just fine without flickering. This is using the $FF, $FF. I also added another LED to pin 36 (P27) and added the blink code you posted. The LED blinked just fine and the other pins stayed high the entire time. I also checked them with my cleaned tip on my meter Everything was stable.
Or you can just try my code since it sets pins 0-7as ground. I would like to think there is a register setting for 16 bit mode. I scanned the datasheet and couldn't find it, but it doesn't mean it's not there. If you keep these pins connected, you can try different settings once you get the display to work.
Ron, page 10 describes hardware settings. I am thinking there should be a software setting, but I could be wrong. Page 48 describes 8 bit transfers, which are apparently MSB first. This means my first example should work.
*edited*
After two more scans of the datasheet there is apparently no register to set interface mode
Looks like you re-wired the data bus? LCD data 0-7 to gnd, lcd 8-15 to prop pins 0 -7? Did you move reset line? write? read? cs? rs? double check all the pins with leds. I'm doing this right now trying to get my hardware working
Comments
I just checked all the hex values between my code and that code and all match. This is getting strange
should be high, low, high,low,low,high,high,high. So same as what you say except DB7 high as well
That definitely does not sound right. If the prop is hanging the volts should be rock solid. Do you have bypass caps on the propeller? Caps around the voltage regulators?
Almost worth putting 8 leds on P0-P7 so you can see the data going out...
http://www.allshore.com/pdf/IlitekILI9340.pdf
for the value to change
I bet my problem has something to do with this.
repeat should still hang the propeller. The exception would be if you had other cogs running and changing the pins but there are no other cogs running.
I wonder about the stability of the prop. 22uF near the power pins and two 0.uF caps in the appropriate places one above and one below the pins?
A test for stability - add a new deadend. Pick another free pin and attach a 1k resistor and led
PUB DeadendFlash repeat outa[mypin] := 0 delay.pause1ms(500) outa[mypin] :=1 delay.pause1ms(500)Which should flash the led. If the prop is unstable, that led will stop flashing after a few seconds.
If the led keeps flashing, but your other pins keep changing, well that would be very strange...
*edit*
looks like http://www.adafruit.com/datasheets/ILI9325.pdf is the right datasheeet,
I have no clue...Tried to find it. On my screen there is a register that overrides hardware setting.
void LCD_Writ_Bus(char VH,char VL) { unsigned char i,temp,data; data=VH; for(i=0;i<8;i++) { temp=(data&0x01); if(temp) digitalWrite(i,HIGH); else digitalWrite(i,LOW); data=data>>1; } digitalWrite(LCD_WR,LOW); digitalWrite(LCD_WR,HIGH); data=VL; for(i=0;i<8;i++) { temp=(data&0x01); if(temp) digitalWrite(i,HIGH); else digitalWrite(i,LOW); data=data>>1; } digitalWrite(LCD_WR,LOW); digitalWrite(LCD_WR,HIGH); }I think these displays can do all sorts of modes, serial, 8 bit, 16 bit, and I think there are even others.
Of all these, I believe the 16 bit is the simplest, but we probably should explore 8 bit down the track as it does use less propeller pins.
However, that is going off on a tangent. There is something not right about values on propeller pins changing when the propeller has entered an endless repeat loop.
I just pulled the screen from one of my boards and sure enough, the resistor is on R2 meaning the display is in 8 bit mode. So what is the difference in speed, quality of 8 bit? Can I use the prop to run the display in 8 bit? I am not looking to have full blown graphics on this screen. It is for an automotive environment so it does not need to be extremely fancy.
void LCD_Writ_Bus(char VH,char VL) { unsigned char i,temp,data; data=VH; for(i=0;i<8;i++) { temp=(data&0x01); if(temp) digitalWrite(i,HIGH); else digitalWrite(i,LOW); data=data>>1; } digitalWrite(LCD_WR,LOW); digitalWrite(LCD_WR,HIGH); data=VL; for(i=0;i<8;i++) { temp=(data&0x01); if(temp) digitalWrite(i,HIGH); else digitalWrite(i,LOW); data=data>>1; } digitalWrite(LCD_WR,LOW); digitalWrite(LCD_WR,HIGH); }I think these displays can do all sorts of modes, serial, 8 bit, 16 bit, and I think there are even others.
Of all these, I believe the 16 bit is the simplest, but we probably should explore 8 bit down the track as it does use less propeller pins.
However, that is going off on a tangent. There is something not right about values on propeller pins changing when the propeller has entered an endless repeat loop.
If you have access to a TV it could be helpful to add the three TV resistors and a TV display object and use that for debugging. At least you can see if the propeller has gone haywire.
PRI LCD_Writ_Bus(VH,VL) OUTA[7..0] := VL OUTA[15..8] := VH WriteLow ' write pin low WriteHigh ' toggle write pintoPRI LCD_Writ_Bus(VH,VL) OUTA[7..0] := VH WriteLow ' write pin low WriteHigh ' toggle write pin OUTA[7..0] := VL WriteLow ' write pin low WriteHigh ' toggle write pinor maybe vl then vh?EDIT :
So 8 bit mode would actually take longer to do different things on the display? How do all these mp3 players, cell phones, and other touch screen devices run their displays so fast? All I am really looking for is to display an image of my logo on the bootup of the display which will be loaded into the SD card, once loaded, it will communicate with my other prop which is the main brain that does other things too, then it will show real time information which is sent from the main prop to show the user a few different things like speed, gear, throttle, rpm, and maybe a couple more things. The touch screen is so the user can enter into the programming menu to set their up their product the way they like it. The menu system will be a screen which will show one updatable item at a time with a right arrow, left arrow, and a Save button. Once the user clicks save, it will send information back to the main brain to save to the eeprom. Basically, it is just like a monitor on a computer for the main brain of my product with touch capabilities to avoid buttons and keep it small.
Can you double check that E5 value and DB7 from earlier? If just one of those 16 lines is not getting through it won't work.
I'd stick with 16 bit as this is what others here have working.
Re the display, the first time I drew a pixel I missed it so maybe draw a bigger box
Draw(10,10,19,19) repeat 100 ' draws a box 10x10 pixels in white. Pixel($FF,FF)Also it would be very helpful just to prove this prop is stable and there are no power supply issues. How did the flashing led experiment go?
PUB ColorTest(Color) | idxr, idxc ' Lcd_Write_Com (REG_SETGDDRxADDRESSCOUNTER) 'Lcd_Write_Data(0) ' Lcd_Write_Com (REG_SETGDDRyADDRESSCOUNTER) ' Lcd_Write_Data(0) repeat idxr from 0 to 16 ' repeat idxc from 0 to 320 Lcd_Write_Com(REG_RAMDATAWRITE) Lcd_Write_Data(Color) returnI tried your example to draw a larger box and still nothing
I connected 9 LED's (that's all I have for some reason) to the data pins and they came on just fine without flickering. This is using the $FF, $FF. I also added another LED to pin 36 (P27) and added the blink code you posted. The LED blinked just fine and the other pins stayed high the entire time. I also checked them with my cleaned tip on my meter
PRI LCD_Writ_Bus(VH,VL) OUTA[15..8] := VH OUTA[7..0] := 0 WriteLow ' write pin low WriteHigh ' toggle write pin OUTA[15..8] := VL OUTA[7..0] := 0 WriteLow ' write pin low WriteHigh ' toggle write pinor possibly?PRI LCD_Writ_Bus(VH,VL) OUTA[15..8] := VL OUTA[7..0] := 0 WriteLow ' write pin low WriteHigh ' toggle write pin OUTA[15..8] := VH OUTA[7..0] := 0 WriteLow ' write pin low WriteHigh ' toggle write pinIt appears this is a different display to what we have, and they have hardwired it to 8 bit mode. No wonder things are not working!
Well, as you say, is it low byte first or high byte first? Try one then the other - as per average joe's code above.
If it doesn't work then I guess we need to find out for sure about 8 bit mode.
If this works, it would save 8 propeller pins.
Ron
*edited*
After two more scans of the datasheet there is apparently no register to set interface mode
' SSD1289 P0 - P15 pins ' ' Methods: ' .Start = start the driver ' .Draw = start drawing at x1,y1 and continue until x2,y2 ' .Pixel = a pixel in 2 bytes RRRRRGGG GGGBBBBB CON _clkmode = xtal1 + pll16x ' use crystal x 16 _xinfreq = 5_000_000 CS = 24 RS = 16 RD = 25 LCD_WR = 17 LCD_RST = 23 OBJ wait : "timing" ' thanks to parallax VAR byte lcd_data_high, lcd_data_low ' status of all the display pins PUB Start_SSD1289 ''init pins EnableDisplayPins ' enable pins 0 to 15 ResetHigh wait.pause1ms(5) ResetLow wait.pause1ms(5) ResetHigh ChipSelectHigh ReadHigh WriteHigh wait.pause1ms(5) ChipSelectLow Lcd_Write_Com($00,$E5) 'Lcd_Write_Com($FF,$FF) 'Deadend Lcd_Write_Data($78,$F0) ' set SRAM internal timing Lcd_Write_Com($00,$01) Lcd_Write_Data($01,$00) ' set SS and SM bit Lcd_Write_Com($00,$02) Lcd_Write_Data($07,$00) ' set 1 line inversion Lcd_Write_Com($00,$03) Lcd_Write_Data($10,$30) ' set GRAM write direction and BGR=1. Lcd_Write_Com($00,$04) Lcd_Write_Data($00,$00) ' Resize register Lcd_Write_Com($00,$08) Lcd_Write_Data($02,$07) ' set the back porch and front porch Lcd_Write_Com($00,$09) Lcd_Write_Data($00,$00) ' set non-display area refresh cycle ISC[3:0] Lcd_Write_Com($00,$0A) Lcd_Write_Data($00,$00) ' FMARK function Lcd_Write_Com($00,$0C) Lcd_Write_Data($00,$00) ' RGB interface setting Lcd_Write_Com($00,$0D) Lcd_Write_Data($00,$00) ' Frame marker Position Lcd_Write_Com($00,$0F) Lcd_Write_Data($00,$00) ' RGB interface polarity ' *************Power On sequence ****************// Lcd_Write_Com($00,$10) Lcd_Write_Data($00,$00) ' SAP, BT[3:0], AP, DSTB, SLP, STB Lcd_Write_Com($00,$11) Lcd_Write_Data($00,$07) ' DC1[2:0], DC0[2:0], VC[2:0] Lcd_Write_Com($00,$12) Lcd_Write_Data($00,$00) ' VREG1OUT voltage Lcd_Write_Com($00,$13) Lcd_Write_Data($00,$00) ' VDV[4:0] for VCOM amplitude Lcd_Write_Com($00,$07) Lcd_Write_Data($00,$01) wait.pause1ms(50) ' Dis-charge capacitor power voltage Lcd_Write_Com($00,$10) Lcd_Write_Data($10,$90) ' 1490//SAP, BT[3:0], AP, DSTB, SLP, STB Lcd_Write_Com($00,$11) Lcd_Write_Data($02,$27) ' DC1[2:0], DC0[2:0], VC[2:0] wait.pause1ms(50) ' delay Lcd_Write_Com($00,$12) Lcd_Write_Data($00,$1F) '001C// Internal reference voltage= Vci; wait.pause1ms(50) ' delay Lcd_Write_Com($00,$13) Lcd_Write_Data($15,$00) '$1000//1400 Set VDV[4:0] for VCOM amplitude 1A00 Lcd_Write_Com($00,$29) Lcd_Write_Data($00,$27) '$0012 //001a Set VCM[5:0] for VCOMH //$0025 0034 Lcd_Write_Com($00,$2B) Lcd_Write_Data($00,$0D) ' Set Frame Rate 000C wait.pause1ms(50) ' delay Lcd_Write_Com($00,$20) Lcd_Write_Data($00,$00) ' GRAM horizontal Address Lcd_Write_Com($00,$21) Lcd_Write_Data($00,$00) ' GRAM Vertical Address ' ----------- Adjust the Gamma Curve ----------// Lcd_Write_Com($00,$30) Lcd_Write_Data($00,$00) Lcd_Write_Com($00,$31) Lcd_Write_Data($07,$07) Lcd_Write_Com($00,$32) Lcd_Write_Data($03,$07) Lcd_Write_Com($00,$35) Lcd_Write_Data($02,$00) Lcd_Write_Com($00,$36) Lcd_Write_Data($00,$08) '//0207 Lcd_Write_Com($00,$37) Lcd_Write_Data($00,$04) '//0306 Lcd_Write_Com($00,$38) Lcd_Write_Data($00,$00) '//0102 Lcd_Write_Com($00,$39) Lcd_Write_Data($07,$07) '//0707 Lcd_Write_Com($00,$3C) Lcd_Write_Data($00,$02) '//0702 Lcd_Write_Com($00,$3D) Lcd_Write_Data($1D,$04) '//1604 ' ------------------ Set GRAM area ---------------// Lcd_Write_Com($00,$50) Lcd_Write_Data($00,$00) ' Horizontal GRAM Start Address Lcd_Write_Com($00,$51) Lcd_Write_Data($00,$EF) ' Horizontal GRAM End Address Lcd_Write_Com($00,$52) Lcd_Write_Data($00,$00) ' Vertical GRAM Start Address Lcd_Write_Com($00,$53) Lcd_Write_Data($01,$3F) ' Vertical GRAM Start Address Lcd_Write_Com($00,$60) Lcd_Write_Data($A7,$00) ' Gate Scan Line Lcd_Write_Com($00,$61) Lcd_Write_Data($00,$01) ' NDL,VLE, REV Lcd_Write_Com($00,$6A) Lcd_Write_Data($00,$00) ' set scrolling line ' -------------- Partial Display Control ---------/ Lcd_Write_Com($00,$80) Lcd_Write_Data($00,$00) Lcd_Write_Com($00,$81) Lcd_Write_Data($00,$00) Lcd_Write_Com($00,$82) Lcd_Write_Data($00,$00) Lcd_Write_Com($00,$83) Lcd_Write_Data($00,$00) Lcd_Write_Com($00,$84) Lcd_Write_Data($00,$00) Lcd_Write_Com($00,$85) Lcd_Write_Data($00,$00) ' //-------------- Panel Control -------------------// Lcd_Write_Com($00,$90) Lcd_Write_Data($00,$10) Lcd_Write_Com($00,$92) Lcd_Write_Data($06,$00) Lcd_Write_Com($00,$07) Lcd_Write_Data($01,$33) ' 262K color and display ON Draw(10,10,19,19) repeat 100 ' draws a box 10x10 pixels in white. Pixel($FF,$FF) Pub Deadend repeat repeat PUB Draw(x1, y1, x2, y2) ' sets the pixel to x1,y1 and then fills the next (x2-x1)*(y2-y1) pixels Lcd_Write_Com($00,$20) Lcd_Write_Data(x1>>8,x1) Lcd_Write_Com($00,$21) Lcd_Write_Data(y1>>8,y1) Lcd_Write_Com($00,$50) Lcd_Write_Data(x1>>8,x1) Lcd_Write_Com($00,$52) Lcd_Write_Data(y1>>8,y1) Lcd_Write_Com($00,$51) Lcd_Write_Data(x2>>8,x2) Lcd_Write_Com($00,$53) Lcd_Write_Data(y2>>8,y2) Lcd_Write_Com($00,$22) PUB Pixel(VH,VL) ' send out a pixel, high byte then low byte Lcd_Write_Data(VH,VL) '********************** private methods ********************* 'PRI LCD_Writ_Bus(VH,VL) ' OUTA[7..0] := VL ' OUTA[15..8] := VH ' WriteLow ' write pin low ' WriteHigh ' toggle write pin PRI LCD_Writ_Bus(VH,VL) OUTA[7..0] := VH WriteLow ' write pin low WriteHigh ' toggle write pin OUTA[7..0] := VL WriteLow ' write pin low WriteHigh PRI Lcd_Write_Com(VH,VL) RSLow LCD_Writ_Bus(VH,VL) PRI Lcd_Write_Data(VH,VL) RSHigh LCD_Writ_Bus(VH,VL) PRI EnableDisplayPins DIRA:=%00000011_11100011_11111111_11111111 ' , Reset, WR, RS and 16 data lines active PRI TristateDisplayPins ' tristate all pins - DIRA:=%00000011_11100010_00000000_00000000 PRI ChipSelectLow outa[CS] := 0 PRI ChipSelectHigh outa[CS] := 1 PRI ReadLow OUTA[RD] := 0 ' send to the latch PRI ReadHigh OUTA[RD] := 1 PRI RSLow ' RS pin outa[RS] := 0 PRI RSHigh outa[RS] := 1 ' PRI WriteLow outa[LCD_WR] := 0 ' PRI WriteHigh outa[LCD_WR] := 1 PRI ResetLow outa[LCD_RST] := 0 ' PRI ResetHigh outa[LCD_RST] := 1I have tried switching the VL and the VH in the LCD_Writ_Bus function but no change.