Addafruit Alphanumeric Display

Questions on control of serial busses
basicchip
Posts: 1090
Joined: Fri Oct 19, 2012 2:39 am
Location: Weeki Watchee, FL
Contact:

Re: Addafruit Alphanumeric Display

Post by basicchip »

power connections shown in the help files Hardware Info section



danlee58
Posts: 210
Joined: Thu Jan 17, 2013 2:29 am

Re: Addafruit Alphanumeric Display

Post by danlee58 »

http://www.coridium.us/ARMhelp/scr/images/SUPERpwr.gif

This SuperPro board layout shows only one pin available for 5 Volts. I already use that for my Shield board & to connect to the Adafruit display.

I think that the best solution is to connect 5 Volts to an unused IO pin on the shield, where the LPC1756 output is tristate, and use that pin to jumper 5 volts to the SuperPro board. I can connect the resistors to that point & also to the SCL & SDA pins.

Another way is to Connect the 2 resistors to 5 volts on the shield, and connect one to the SDA pin, then feed the other to the unused IO pin, and jumper it to the SCL line on the SuperPro.

danlee58
Posts: 210
Joined: Thu Jan 17, 2013 2:29 am

Re: Addafruit Alphanumeric Display

Post by danlee58 »

I added 2.2k pull up resistors to the shield board & jumpered them to the SDA1 & SCL1 lines (P0.0 & P0.10). The levels are 5 volt levels. I'm still not having much luck getting acknowledgements from the display.

I am trying the I2COUT from cor_bitbang.c, but it seems to want ASCII characters. I need to sent 8 bit binary or hexadecimal bytes.

Do I have to convert hexadecimal to ASCII for every message? The Bytes are 0x21, 0xA0, 0x81 etc. Some will convert to ASCII characters, but many are obscure keyboard keys.

basicchip
Posts: 1090
Joined: Fri Oct 19, 2012 2:39 am
Location: Weeki Watchee, FL
Contact:

Re: Addafruit Alphanumeric Display

Post by basicchip »

The bit banged routines in both C and BASIC just use binary data (no encoding at all).

What you may be seeing is that there is no consistency in specifying what an i2c address is, even in Philips documents. Your first byte 0x21, if an address would imply 0x21 (7 bits) are shifted out followed by a 1/0 for read/write or as we treat it as an 8 bit quantity of 0x43 / 0x42 for read/write.

danlee58
Posts: 210
Joined: Thu Jan 17, 2013 2:29 am

Re: Addafruit Alphanumeric Display

Post by danlee58 »

char list[4] = {0x21, 0xA0, 0x81, 0xFF};

I2COUT (0, 1, 0xE0, 4, list);

The I2C Address is the 3rd element in the function. The 4 values in the list are commands & data for the display. Address E0 is 1110000, and the Write bit (0).

It seems to be running now, but I haven't seen anything on the display. I don't know if all the values in the list are correct. I need to debug a little more.

danlee58
Posts: 210
Joined: Thu Jan 17, 2013 2:29 am

Re: Addafruit Alphanumeric Display

Post by danlee58 »

I can't get anything on the display. I am questioning if I am really communicating with the display.

I changed the Address in the COUT function from 0xE0 to 0x70. 0xE0 should be the correct address, and 0x70 non-valid. I get no error indication from COUT.

I'll have to look at the COUT procedure to see what it does if there is no Acknowledge.

danlee58
Posts: 210
Joined: Thu Jan 17, 2013 2:29 am

Re: Addafruit Alphanumeric Display

Post by danlee58 »

i = INx(sda_pin); // check ACK here (save value in i, 0 was ACK'd
printf("%d\n", i);

This is the Acknowledge check in the I2C_Shift function. I added the printf call. The terminal shows the value of i is always -1.(FFFF FFFF). It should be 0. The I2C_Shift function doesn't report this failure.

basicchip
Posts: 1090
Joined: Fri Oct 19, 2012 2:39 am
Location: Weeki Watchee, FL
Contact:

Re: Addafruit Alphanumeric Display

Post by basicchip »

later in that same routine (i2c_shift) the ACK is detected by

return i==0; // was it ACK'd

If you don't see that, the version of cor_bitbang.c you are using is very old.

danlee58
Posts: 210
Joined: Thu Jan 17, 2013 2:29 am

Re: Addafruit Alphanumeric Display

Post by danlee58 »

In the COUT function itsOK is checked. If it's OK then it reads the List and shifts out the data, otherwise the function just sends a Stop bit, but nowhere is there any indication that the function did not receive an Acknowledge, and did not send the List data. The function just runs the same as if the data was transmitted.

My real problem is that I get no Acknowledge.


if (itsOK == 0) {
while (readList() > 0) {
printf("%c\n", 'C');
if (!i2c_shift(sda_pin, scl_pin, list_value)) { itsOK = 0; break; }
}
}

i2c_stop(sda_pin, scl_pin);

basicchip
Posts: 1090
Joined: Fri Oct 19, 2012 2:39 am
Location: Weeki Watchee, FL
Contact:

Re: Addafruit Alphanumeric Display

Post by basicchip »

I2COUT returns 1 if the data was sent successfully, or 0 if not. The last line is

return itsOK

So your upper level code has to check that.

If you are not getting ACKs it is because of one of the following--

Wrong pins specified
Pins not connected
SDA/SCL pins swapped
no pullups or insufficient on SDA/SCL (2K is usually a good value)
wrong address specified
target device not powered

Post Reply