mandar_mahajan
Full Member level 2
lcd blackplane
Hello All,
I am facing a serious problem & therefore wanted an immidiate help.
I am driving a 9 segment * 4 backplane with 89lpc936 & a shift register.
My supply voltage for controller is 3V & have kept 1.5v for backplanes.
My problem is that,
when I am putting the data for not glowing any digit as per the attach waveform(attach file), I am getting the dimming effect of the all segments which is unwanted. I am not able to understand how to eliminate this?
Following is the code for the same:
#define MOSI P2_2
#define SPI_CLK P2_5
#define STROBE P2_6
#define MASTER_RESET P2_7
#define BP0 P0_0
#define BP1 P0_1
#define BP2 P0_2
#define BP3 P0_3
THIS CODE IS IN ISR OF 2.5mSEC
gptimer++;
gptimer &= 0x07;
if(gptimer < 8)
{
P0M1 = 0xf0; // QUASI BIDIRECIONAL(PORT BIT 0_0.1,2,3)
}
else
P0M1 = 0xff;
if(gptimer == 0)
{
BP0 = 1;
P0M1 = 0xfe; // PORT PIN 0_1,2,3 IN TRI-STATE.
load_seg_data(0xff);
}
if(gptimer == 1)
{
P0M1 = 0xfd; // PORT PIN 0_0,2,3 IN TRI-STATE.
BP1 = 1;
load_seg_data(0xff);
}
if(gptimer == 2)
{
P0M1 = 0xfb; // PORT PIN 0_0,1,3 IN TRI-STATE.
BP2 = 1;
load_seg_data(0xff);
}
if(gptimer == 3)
{
P0M1 = 0xf7; // PORT PIN 0_0,1,2 IN TRI-STATE.
BP3 = 1;
load_seg_data(0xff);
}
if(gptimer == 4)
{
P0M1 = 0xfe;
BP0 = 0;
load_seg_data(0x00);
}
if(gptimer == 5)
{
P0M1 = 0xfd;
BP1 = 0;
load_seg_data(0x00);
}
if(gptimer == 6)
{
P0M1 = 0xfb;
BP2 = 0;
load_seg_data(0x00);
}
if(gptimer == 7)
{
P0M1 = 0xf7;
BP3 = 0;
load_seg_data(0x00);
}
//-----------------------------------//
void load_seg_data(unsigned char value)
{
unsigned char ch;
for(ch = 0; ch < 8; ch++)
{
if(value & 0x80) //
MOSI = 1;
else
MOSI = 0;
SPI_CLK = 1;
SPI_CLK = 0;
value <<= 1;
}
STROBE = 1;
STROBE = 0;
}
REGARDS
MANDAR
Hello All,
I am facing a serious problem & therefore wanted an immidiate help.
I am driving a 9 segment * 4 backplane with 89lpc936 & a shift register.
My supply voltage for controller is 3V & have kept 1.5v for backplanes.
My problem is that,
when I am putting the data for not glowing any digit as per the attach waveform(attach file), I am getting the dimming effect of the all segments which is unwanted. I am not able to understand how to eliminate this?
Following is the code for the same:
#define MOSI P2_2
#define SPI_CLK P2_5
#define STROBE P2_6
#define MASTER_RESET P2_7
#define BP0 P0_0
#define BP1 P0_1
#define BP2 P0_2
#define BP3 P0_3
THIS CODE IS IN ISR OF 2.5mSEC
gptimer++;
gptimer &= 0x07;
if(gptimer < 8)
{
P0M1 = 0xf0; // QUASI BIDIRECIONAL(PORT BIT 0_0.1,2,3)
}
else
P0M1 = 0xff;
if(gptimer == 0)
{
BP0 = 1;
P0M1 = 0xfe; // PORT PIN 0_1,2,3 IN TRI-STATE.
load_seg_data(0xff);
}
if(gptimer == 1)
{
P0M1 = 0xfd; // PORT PIN 0_0,2,3 IN TRI-STATE.
BP1 = 1;
load_seg_data(0xff);
}
if(gptimer == 2)
{
P0M1 = 0xfb; // PORT PIN 0_0,1,3 IN TRI-STATE.
BP2 = 1;
load_seg_data(0xff);
}
if(gptimer == 3)
{
P0M1 = 0xf7; // PORT PIN 0_0,1,2 IN TRI-STATE.
BP3 = 1;
load_seg_data(0xff);
}
if(gptimer == 4)
{
P0M1 = 0xfe;
BP0 = 0;
load_seg_data(0x00);
}
if(gptimer == 5)
{
P0M1 = 0xfd;
BP1 = 0;
load_seg_data(0x00);
}
if(gptimer == 6)
{
P0M1 = 0xfb;
BP2 = 0;
load_seg_data(0x00);
}
if(gptimer == 7)
{
P0M1 = 0xf7;
BP3 = 0;
load_seg_data(0x00);
}
//-----------------------------------//
void load_seg_data(unsigned char value)
{
unsigned char ch;
for(ch = 0; ch < 8; ch++)
{
if(value & 0x80) //
MOSI = 1;
else
MOSI = 0;
SPI_CLK = 1;
SPI_CLK = 0;
value <<= 1;
}
STROBE = 1;
STROBE = 0;
}
REGARDS
MANDAR