Raymond Genovese
- Joined Mar 5, 2016
- 1,653
I'm glad that you are staying with the project and staying with the board. Still, you strike me as being a bit condescending in the sense that you *seem* to have decided that I (and others here) simply do not know enough to be of any help to you. Remember, when you make a public request for help, you are likely to get a variety of responses and only some might be of any help. But, enough of that.Thank you - I am sure that you are trying to help, but you are concentrating on aspects of the problem which are in fact not helpful to me. You may rest assured that I have wired it correctly. Since you ask about it - I am using the 5v supply option in which VLCD is connected to +5V. But if you think about it you will probably agree with me that an error in this area would not cause my problem - which is absence of ACK. Checking the connections was my first reaction on finding that there is a problem. Checking the software likewise - the scope display seems to show that this is faultless (though if anyone can find a fault in it, that would be most helpful). When one undertakes a project of this kind there are often uncertainties which can only be resolved by experiment. Interpretation of the datasheet comments on ACK and BUSY is one which has troubled me. I think I have worked out that ACK-low also implies NOTBUSY (though this might be wrong). Waiting for ACK, and using no other indication of NOTBUSY seems to be a feature of the sample software, and I have replicated this in my own GETACK subroutine. Perhaps you can comment on that. I hope you will understand that haranguing me over the absence of a schematic showing that I joined the SCK output to the SCK input, VDD to +5v etc is to approach the problem at the wrong level to be helpful to me; I am asking readers to assume that I have checked that kind of thing. An example of something that seemed useful was the query that someone else raised about the need for an open-drain output and pullup on SCK; that seemed worth thinking about, but on reflection I cannot see how that would make it work. I am now awaiting the delivery of a replacement LCD, and that, I feel is likely to move the matter on, one way or another. But I would also very much like to meet someone who has sorted all this out successfully, and who can share his or her experience with me.
This morning, I dug up the two LCDs that I had mentioned previously. These are not the same LCD as you have, but they are the same ST7032i that yours has. It took me a good three hours to get one up to the point where I could test it out. Much of that time was spent with the pain of the 1.27 mm pins (see below), which I managed to solder onto one half of a 28-pin SOP-4 board. I can also state that at $3.24, they are over-priced and as cheap an LCD as I have ever seen. In fact, I have to glue the back light back on as it is flopping around.

Nevertheless, after messing around a bit with the usual vagaries of bad datasheets, I got to here:

So, I now meet your requirement as being someone who got one of these to work - as long as we stretch the definition to mean simply an LCD that uses an ST7032 controller and an I2C interface.
To go back to your picture comparing your screen with another (with both powered) to make a determination of whether your 7032 screen is bricked. I think I responded in your first thread that I did not think that the comparison was a good way to make that determination. I am staying with that answer. Whether you have the back light on or not, when you power up, you will not see the cells (the matrices for characters) unless the contrast is high enough. The contrast is controlled by a register that can take the value of 0-63 (for a 3.3v interface, something like 35-40 is about right). The power up value appears to be 0 or not connected or otherwise useless. A proper initialization set the contrast registered as the datasheet shows. I think @ericgibbs already brought this up.
As far as the reset. I have tested the power-up reset (connecting rst high) and, in this case, it works fine. The 40ms delay (which has already been mentioned) is likely a good idea to follow. If using power up reset or if using GPIO driven reset, the delay should be respected. When I brought this up in your first thread it was because I thought it was a reasonable possibility and very easy to test.
I understand your concern about not getting an ACK, but I don't think you are "there" yet. What I mean is that your traces are clearly showing that you are not getting an ACK, but that does not mean that you have a bricked LCD.
I took a brief look at your code, I believe that your lcdinit is wrong and that you do not understand the possible interfaces that are available on the ST7032i and your LCD.
Your initialization routine below:
Code:
;initialise the lcd
lcdinit
;normal state of lcd interface is: lower part of PB input, E = R/W = RS = 0, Bank 0 selected
movlf 8,lcdcar ;small screen byte counter
call funset ;set up 4-bit bus
movlw h'28' ;function set- '2 line' display enables last 8 print positions
clrf lcdrs ;request register 0
call lcdwrite
movlw h'28' ;function set- '2 line' display enables last 8 print positions
clrf lcdrs ;request register 0
call lcdwrite
movlw h'c' ;display on, no cursor or blink
clrf lcdrs ;request register 0
call lcdwrite
movlw h'6' ;cursor direction right
clrf lcdrs ;request register 0
call lcdwrite
call cls ;clear the display, clear lcdcount
return
In this regard, it is not surprising that you do not get an I2C ACK since the I2C interface has not been properly initialized - at least that is how it seems to me.
Your initialization code should follow the instructions in the datasheet (version 1.4 available here ) on page 33-34. The 8051 code example is very clear and should be easy to port.
Since I have no real use for this LCD, I was thinking/hoping that a previously written set of routines that I wrote for the ST7036i can be utilized with a new initialization and a few modifications. At least, then I could have an LCD ready for breadboard use. If i do that successfully, I will be happy to share the initialization code.
One other point. Again, I did not look at your code very closely but it looks like you think that you can also read a READY status from the 7032 (other than the I2C ACK) (you also referred to this issue in one of your posts). Good luck with that because I don't think you can do it with the I2C interface.
In version 1.4 and earlier (e.g. 1.2) of the datasheet it was spelled out rather elegantly...
I2C interface
It just only could write Data or Instruction to ST7032 by the IIC Interface.
It could not read Data or Instruction from ST7032 (except Acknowledge signal).
cheers
Last edited by a moderator:
