I write a code using Atmel ASF for SAM devices for LCD 2x16 with ST7032i controller. I've encounter an issue about reading and specifically "busy flag reading". How can i perform read instruction to get data?

LCD datasheet: http://www.farnell.com/datasheets/1811619.pdf page 14


As always, R/W is the last bit of the I2C slave address. From UM10204, section 3.1.10:

After the START condition (S), a slave address is sent. This address is seven bits long followed by an eighth bit which is a data direction bit (R/W) — a ‘zero’ indicates a transmission (WRITE), a ‘one’ indicates a request for data (READ) [...].

How to access BF is given right in the paragraph describing the flag:

BF can be read, when RS = Low and R/W = High (Read Instruction Operation), through DB7 port.


The controller that the LCD module uses has parallel and serial (I2C) buses. The module that uses the controller only brings out the I2C serial bus. Using the serial bus, it's not possible to do any read operations on that controller (see datasheet chapter 6, I2C Interface). So you'll just have to have sufficiently long delays in your code so that the controller is not busy when you write a new command to it. In practice, it's usually of no concern, since the I2C bus is so slow anyway, that I wouldn't see it possible to write commands to the controller too quickly using the I2C.

  • \$\begingroup\$ this mean that i cannot run read command to lcd? And how can i read busy flag? it's in the datasheet. It couldn't be there if there's no read instruction \$\endgroup\$ – MrBit Dec 12 '14 at 20:03
  • \$\begingroup\$ Unfortunately it seems so. This is very common in simple LCD modules. You cannot read from it. There is a read instruction but it's only accessible from the parallel bus, not from the serial bus. And the parallel bus pins are probably somewhere below the LCD glass, often buried inside a mass of black epoxy. \$\endgroup\$ – PkP Dec 12 '14 at 20:09
  • \$\begingroup\$ I think that, RS bit signed via Control Byte which sended after Acknowledge in Reading mode. \$\endgroup\$ – MrBit Dec 12 '14 at 20:17
  • \$\begingroup\$ I send [ADDRESS][R]_[A]_[CONTROL BYTE]. Control byte = 0 (Co=0, RS=0, and other bits 0) and in this point, lcd blocked, and needs reset after this. \$\endgroup\$ – MrBit Dec 12 '14 at 20:20
  • \$\begingroup\$ Hmm... what do you mean "blocked"? Do you get ACKs from the LCD when you write the bytes? \$\endgroup\$ – PkP Dec 12 '14 at 20:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.