Addafruit Alphanumeric Display

Questions on control of serial busses
danlee58
Posts: 210
Joined: Thu Jan 17, 2013 2:29 am

Addafruit Alphanumeric Display

Post by danlee58 »

I purchased an Addafruit Alphanumeric Display. I would like to use that with my SuperPro to display some status characters. The display has an I2C interface. It has 5 pins on 0.1" centers labled:
SCL
SDA
GND
VCC
i2c

It's supposed to be Arduino compatible, but there are no compatible pins on the SuperPro(?).

How can I mount this device on a SuperPro? I can bit bang some pins for the data transfer.



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

Re: Addafruit Alphanumeric Display

Post by danlee58 »

I went onto the Addafruit site. VCC & Gnd are to be connected to the 5.0 Volts & Ground on the Host Board. The Vi2c pin goes to the 3.3 Volt pin. Then the SCL goes to the I2C clock pin, and the SDA goes to I2C data pin.

It looks like I can't simply plug it into the SuperPro board, but I'll have to run jumpers to the correct pins.

I'll look in the NXP manual to determine the I2C Clock & Data pins.

olzeke51
Posts: 396
Joined: Sat May 17, 2014 4:22 pm
Location: South Carolina

Re: Addafruit Alphanumeric Display

Post by olzeke51 »

not having your Adafruit partnumber, I am guessing you are doing the quad pack .
I originally thought they had it on a shield - but its good they didn't
AS the SuperPro doesn't follow the somewhat normal Arduino pinout.
BOTH I2C are there - the DA pins are on J10 and CL are on J12
1 refer to i2c1 pins P0-0=SDA1=J10-7 P0-1=SCL1=J12-7
2 refer to i2c2 pins P0-10=SDA2=J10-8 P0-11=SCL2=J12-8
'
don't forget the i2c terminating resistors - you only need 1 pair AFAIK
do they mention the 'speed' of the i2c chip ??
superPro_I2C.GIF
superPro_I2C.GIF (20.05 KiB) Viewed 20690 times

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

Re: Addafruit Alphanumeric Display

Post by danlee58 »

The Addafruit part number is 1907.

It looks like I will have to bit-bang. I have a custom shield that plugs into J10, so I have access to SD1 & SD2, but J12 is buried under the shield. I suppose that I could put the SuperPro board the top of the stack. Then I will have access to J12.

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

Re: Addafruit Alphanumeric Display

Post by danlee58 »

It looks like it will work with the SuperPro board on the top of the stack. I'll have to drill mounting holes in the custom shield board, because there were no mounting holes. It was supposed to sit on the top of the SuperPro board. The SuperPro was supposed to be mounted with stanoffs.

This Addafruit display is an afterthought. The original design uses discrete LEDs for status. The Addafruit Alphanumeric Display is a better option, and it frees some I/O, since it only uses two pins. It simplifies the Interconnect wiring & I can also save one LED driver IC.

I'll assemble the device, and try to integrate the Alphanumeric Display.

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

Re: Addafruit Alphanumeric Display

Post by danlee58 »

I have assembled the device. I downloaded the original code, and it seems OK, but I didn't try it in its application. Then I connected the Addafruit display, and modified the code to write 'A' to the display. I have been working the I2C code, but I don't get any display. The IC on the back of the Addafruit board is HT16K33. I'll look at the data sheet on that device, if I can find one.

Here is some of my code:

PCB_PINSEL0 = PCB_PINSEL0 | 0x0000000F; //Selects SDA1 on P0.0, SCL1 on P0.1

SCB_PCONP = 0x03C8925E; //Select Power for UART 2&3, TIMER 2&3, GPIO, ADC, RTC, PWM1, UART1, UART0, Timer0&1, I2C1.

PCLK_I2C1 is default to 00.

char A = 0x41;
char B = 0x42;
I2C_I21CONSET = 0x40; //Enable Master Mode
I2C_I21CONSET = 0x20; //Send the Start bit
I2C_I21ADR = 0xE1; //Load the 7 bit Address(E0) & Write bit
I2C_I21CONCLR = 0x20; //Clear the Start bit
while (I2C_I21STAT != 0x18){ //Wait for the Acknowledge bit
printf("%c\n", B );
}

I2C_I21DAT = 0x21; //Send the Data bit
while (I2C_I21STAT != 0x28){ //Wait for the Acknowledge bit
printf("%c\n", A );
}

I2C_I21CONSET = 0x10; //Send the Stop bit

printf("%c\n", A );

It never gets out of the first while loop. The Status Register is always 0x08. That tells me that the Slave device does not send an acknowledge, or the SuperPro never sends the Address/Write.

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

Re: Addafruit Alphanumeric Display

Post by danlee58 »

I have been able to get an 0x18 Acknowledge for the Address/Write, but I get an 0x38 for the Data send. That indicates that Bus Arbitration has been lost.

Here is my current procedure:

char A = 0x41;
char B = 0x42;

I2C_I21CONCLR = 0x08; //Clear the S1 bit in the SC1 Control Register
I2C_I21CONSET = 0x20; //Send the Start bit
I2C_I21CONCLR = 0x20; //Clear the Start bit
I2C_I21DAT = 0xE0; //Load the 7 bit Address(E0) & Write bit
I2C_I21CONCLR = 0x08; //Clear the SI bit
while (I2C_I21STAT != 0x18){ //Wait for the Acknowledge bit
printf("%X\n", B );
}
I2C_I21DAT = 0x21; //Send the Oscilator On bit
I2C_I21CONCLR = 0x08; //Clear the SI bit
while (I2C_I21STAT != 0x28){ //Wait for the Acknowledge bit
B = I2C_I21STAT;
printf("%c\n", A );
}
I2C_I21CONCLR = 0x08; //Clear the S1 bit in the SC1 Control Register
I2C_I21CONSET = 0x10; //Send the Stop bit

I am using P0.0 $ P0.1 for SDA & SCL. I don't have pull ups on these lines. Do I need pull ups?

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

Re: Addafruit Alphanumeric Display

Post by danlee58 »

Where can I connect the Pull up Resistors to get 5.0 or 3.3 Volts for SDA1 & SCL1?

I'll connect two 2.2K 1/8 watt to those points on the bottom of the SuperPro board.

BTW, SDA1 (P0.0) is connected to the Base of a Darlington in a 2103 driver pack. I can eliminate that by removing the male pin on the shield board that contains the 2103 driver.

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

Re: Addafruit Alphanumeric Display

Post by danlee58 »

I put the Adafruit code inside the Main program while loop, and took out the status polling, so the routine would run over and over. I put my ancient scope on the SCL & SDA lines. The Clock goes from 0 to about 2.5 Volts, and the Data is about 3.0 Volts most of the time, but goes to ground. I didn't view them at the same time, but I assume that the data & clock are aligned.

The Adafruit display operates on 5 Volts, but 3 volts should be high enough for a Logic 1.

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

Re: Addafruit Alphanumeric Display

Post by danlee58 »

I checked the Holtek 16K33 data sheet. A high level is 0.7 x VDD. With a VDD of 5 volts, that means I need to pull the SCL & SDA lines to 5 Volts, so I get High levels above 3.5 Volts. My current highs are 3 volts or less.

I need to find a 5 Volt source on the SuperPro board to connect my 2.2K Ohm resistors, so I can pull up the SCL & SDA lines.

danlee58

Post Reply