![](templates/subSilver/images/CCSLogo.jpg) |
![CCS C Software and Maintenance Offers](templates/subSilver/images/forumAd6.jpg) |
View previous topic :: View next topic |
Author |
Message |
kmp84
Joined: 02 Feb 2010 Posts: 345
|
PCF8576 lcd driver |
Posted: Mon Oct 31, 2022 11:16 pm |
|
|
Hello,
Can anyone help with driver for PCF8576 lcd?
I have 7 seg. Lcd display (2x6) dig. With 3 chip working in static mode. |
|
![](templates/subSilver/images/spacer.gif) |
Ttelmah
Joined: 11 Mar 2010 Posts: 19369
|
|
Posted: Tue Nov 01, 2022 2:23 am |
|
|
Basic driving of the chip is not hard.
However everything after this depends on your LCD and connections.
Multiplex setup. Which chip generates the backplane. Which segment
connects to which pin. LCD drive mode. Bias, etc. etc.
You are going to have to set all of these yourself. Completely dependant
on the wiring and nature of the LCD. |
|
![](templates/subSilver/images/spacer.gif) |
kmp84
Joined: 02 Feb 2010 Posts: 345
|
|
Posted: Tue Nov 01, 2022 6:57 am |
|
|
You have point exact problem:)
I have basic driver for run this chip , but connection to segments are bit mixed up. 1/2 dig. Is connected to first chip and 1/2 to third chip. Digit 1 to 12 are not sequentially with address and different coding.
How to make map and coding digits?
Best Wishes! |
|
![](templates/subSilver/images/spacer.gif) |
Ttelmah
Joined: 11 Mar 2010 Posts: 19369
|
|
Posted: Tue Nov 01, 2022 7:42 am |
|
|
The normal way would be to setup an array of values defining the bits
involved.
I'd suggest sitting down and writing a slow test program that
cycles through each output bit in turn, perhaps displaying the bit number
via serial, while it turns on each bit in turn. You can then record the bit
numbers for each segment in each digit. With these known, you can then
generate a bitmap for each digit and value. |
|
![](templates/subSilver/images/spacer.gif) |
kmp84
Joined: 02 Feb 2010 Posts: 345
|
|
Posted: Tue Nov 01, 2022 8:24 am |
|
|
Hi mr.TT,
For now I wrote small test program that first make initialization and then go from 1 to 19 and write 0xff that switch ON all segments of all 12 digits. I'll decode dig. 0-9 it's OK. But one dig. has, for example 4 bits for i2c add. 0 and 4 bits for add. 6. How to make bitmap? Some example of this kind of bitmap?
Thank you, |
|
![](templates/subSilver/images/spacer.gif) |
Ttelmah
Joined: 11 Mar 2010 Posts: 19369
|
|
Posted: Wed Nov 02, 2022 2:13 am |
|
|
Because of the design here, you would need to do it as a two dimensional
array. One dimension the digits, and the other the 0-9 for the numeric values
for each digit. |
|
![](templates/subSilver/images/spacer.gif) |
kmp84
Joined: 02 Feb 2010 Posts: 345
|
|
Posted: Wed Nov 02, 2022 2:29 am |
|
|
Ttelmah wrote: | Because of the design here, you would need to do it as a two dimensional
array. One dimension the digits, and the other the 0-9 for the numeric values
for each digit. |
Yes. I thinking about this but it will produce so many combination.
Ok, I’ll try.
Thank you! |
|
![](templates/subSilver/images/spacer.gif) |
Ttelmah
Joined: 11 Mar 2010 Posts: 19369
|
|
Posted: Wed Nov 02, 2022 2:41 am |
|
|
Like all things there are other ways of doing this. For instance you could
have an array of all the 'a' segments, another of the 'b's etc.
Then for each digit just have which segments have to be on (perhaps
as an int1 array, for each number.
So for digit 1, if you want to output '2', you look in the segment array
and find you need a, b, g, e, d. So you look in the a segment array to
find which bit this is, same for the b, then other bits.
Takes less space but involves a bit more work in the decoding. |
|
![](templates/subSilver/images/spacer.gif) |
kmp84
Joined: 02 Feb 2010 Posts: 345
|
|
Posted: Wed Nov 16, 2022 2:10 pm |
|
|
Hello,
I forgot to post simple test example, just for start using PCF8575 LCD Driver. One PCF8575 IC manage x40 segments in static mode.
Code: |
#include <16F1459.h>
#fuses INTRC_IO,NOPLLEN,NOPROTECT,MCLR,PUT,NOWDT // CLKOUT -> Enable clk/4 out on PIN_A4
#use delay(int=16MHz, clock=24MHz)
#USE RS232(DEBUGGER,rcv=PIN_B6,xmit=PIN_B6,stream=STREAM_SERIAL_INPUT)
#use i2c(Master,sda=PIN_A5,scl=PIN_A4)
#define LCD_SLAVEADR 0b01110000 // 0x70, SA0-GND // PCF8576CT
#define LCD_OFF 0b11010001 // Mode Set: C,1,0,LP,En,B,M1,M0
#define LCD_ON 0b11001001 // Mode Set: C,1,0,LP,En,B,M1,M0
#define LCD_DPTRSEL 0b10000000 // DP select C,0,P5,P4,P3,P2,P1,P0
#define LCD_BANKSEL 0b11111000 // Bank Select C,1,1,1,1,0,I,O
#define LCD_BLINKOFF 0b11110000 // Blink OFF C,1,1,1,0,A,BF,1BF
#define LCD_BLINK2HZ 0b11110001 // Blink 2Hz C,1,1,1,0,A,BF,1BF
#define LCD_BLINK1HZ 0b11110010 // Blink 1Hz C,1,1,1,0,A,BF,1BF
#define LCD_BLINK05HZ 0b11110011 // Blink 0.5Hz C,1,1,1,0,A,BF,1BF
#define LCD_DEVSEL_L1 0b11100000 // Device Sel: C,1,1,0,0,A2,A1,A0
#define LCD_DEVSEL_L2 0b11100010 // Device Sel: C,1,1,0,0,A2,A1,A0
#define LCD_DEVSEL_L3 0b11100100 // Device Sel: C,1,1,0,0,A2,A1,A0
/* Clear All digits(Segments) */
void InitEP600Lcd(unsigned int8 Size){
unsigned int8 i;
int8 status; // Status = 0 if got an ACK
i2c_start(); // i2c Start
status = i2c_write(LCD_SLAVEADR); // w-0x7C
status = i2c_write(LCD_OFF); // w-
status = i2c_write(LCD_DPTRSEL); // w-
status = i2c_write(LCD_BANKSEL); // w-
status = i2c_write(LCD_BLINKOFF); // w-
status = i2c_write(LCD_ON); // w-
status = i2c_write(LCD_DEVSEL_L1&0x7F); // w- First subadr. a0,a1,a2 = 0; and clr. bit7=C(Last cmd!)
for(i=0; i<Size; i++){ //
status = i2c_write(0); // w- RAM data..
delay_ms(300);
}
i2c_stop(); // i2c Stop
}
/* Switch ON All digit (Segments) */
void SetAllSegments(unsigned int8 Size){
unsigned int8 i;
i2c_start(); // i2c Start
i2c_write(LCD_SLAVEADR); // w-0x7C
i2c_write(LCD_DPTRSEL); // w-
i2c_write(LCD_DEVSEL_L1&0x7F); // w- First subadr. a0,a1,a2 = 0; and clr. bit7=C(Last cmd!)
for(i=0; i<Size; i++){
i2c_write(0xff); // w- RAM data..
}
i2c_stop(); // i2c Stop
}
#zero_ram
void main(void){
delay_ms(100); //StartUp Delay.
setup_adc(ADC_OFF); //Stop ADC.
setup_adc_ports(NO_ANALOGS); //Disable Adc-channels.
setup_comparator(NC_NC_NC_NC); //Disable Comparator module.
printf("\n\rLCD Display PCF8576CT Demo\n\r");
InitEP600Lcd(24); // Init PCF8566-LCD. and Clear all Segment(digits)
delay_ms(2000);
SetAllSegments(24); // Switch ON All Segments (digits)
for(;;){
// User Code ...
}
}
|
|
|
![](templates/subSilver/images/spacer.gif) |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|