| ??? 09/21/11 11:35 Read: times | #183830 - code Responding to: ???'s previous message | 
| Sure. I post the code here.I exactly define flickering means like something that is not continuosly displays.Like ,like starts twinkles at night.Their lights are not consistant.Same way when I display something on VFD it displays completly i.e when I send code for 0 it displays 0 at defined address.but it is not consistent.I have datasheet but it is physical copy so that I can't show you.The Intention of controlling the GRID voltage is to pass current for display.If you make continuosly high to GRID it will demage.If you continuously make it low display doesn't glow.So you have to make high & low the GRID line to make display on.
 
#include <c:c51incstdio.h>
#include <c:c51increg52.h>
#include <c:c51incintrins.h>
#define uchar unsigned char
#define uint unsigned int
#define ulong unsigned long int
#define CS      P24
#define CLK     P25
#define DATA    P26
#define GRID    P20
uchar   ms100,
        datareg,
        data_buffer1,
        vfdcounter;
uint    ms10;
bit     firsttime;
int     init_vfd(),        
        write_vfd1(),
        data2vfd(),
        display();
init_vfd()
{
CS = 0;
data_buffer1 = 0x05;    //9 digit & 13 segment selection
data2vfd();
CS = 1;
}
write_vfd1()
{
CS = 0;
data_buffer1 = 0x44;    //fix address type
data2vfd();
CS = 1;
_nop_();
_nop_();
CS = 0;
data_buffer1 = 0xc0;   //dispaly address 0
data2vfd();
data_buffer1 = datareg; //actual data to write
data2vfd();
CS = 1;
_nop_();
_nop_();
CS = 0;
data_buffer1 = 0x8f;    //display on & pulsewidth = 14/16
data2vfd();             
CS = 1;
}
data2vfd()
{
vfdcounter = 0x08;
while(vfdcounter != 0)
        {        
        CLK = 0;
        DATA = data_buffer1 & 0x01;
        CLK = 1;
        --vfdcounter;
        data_buffer1 = data_buffer1 >> 1;       //left shift
        }
}                                   
void main(void)
{
SP = 0xa0;
TMOD = 0x01;    //0000 0001
TR0 = 1;
TH0 = 0xec;
TL0 = 0x78;
P0 = 0xff;
P1 = 0xff;
P2 = 0xff;
P3 = 0xff;
init_vfd();
P37 = 0;                        //Not the part of VFD program
firsttime = 1;
IE = 0x82;
for(;;);        
}
timecalc() interrupt 1 using 1
{
TH0 = 0xfc;
TL0 = 0x17;
GRID = 1;
++ms100;
if(ms100 == 15)
        {
        GRID = 0;
        ms100 = 0;
        display();
        }
}
display()
{
if(firsttime)
        {
        datareg = 0x3f; //code for 0
        write_vfd1();
        firsttime = 0;
        }
}
 | 
| Topic | Author | Date | 
| How to control Grid voltage of VFD | 01/01/70 00:00 | |
| what You mean? | 01/01/70 00:00 | |
| bought as module or built by you? | 01/01/70 00:00 | |
| voltage is steady | 01/01/70 00:00 | |
| RE: "I purchase it from market" | 01/01/70 00:00 | |
| I have | 01/01/70 00:00 | |
| how | 01/01/70 00:00 | |
| code | 01/01/70 00:00 | |
| GO OUT FROM INTERRUPT | 01/01/70 00:00 | |
| filament power ? | 01/01/70 00:00 | |
| ISR changed, FILAMENT IS... | 01/01/70 00:00 | |
| Link about VFD | 01/01/70 00:00 | |
| what i should read there? | 01/01/70 00:00 | |
| Same problem with modified code | 01/01/70 00:00 | |
| Work on hardware | 01/01/70 00:00 | |
| show pictures | 01/01/70 00:00 | |
| DC connection | 01/01/70 00:00 | |
| Near to solution | 01/01/70 00:00 | |
| just a thought | 01/01/70 00:00 | |
| Thanks | 01/01/70 00:00 | |
| Modified program | 01/01/70 00:00 | |
| make report | 01/01/70 00:00 | |
| about Filament | 01/01/70 00:00 | |
| RE:about filament | 01/01/70 00:00 | |
| PWM   | 01/01/70 00:00 | 



