Author Topic: How to control a vintage 16x2 VFD?  (Read 2044 times)

0 Members and 1 Guest are viewing this topic.

Offline singlarrysongTopic starter

  • Contributor
  • Posts: 34
How to control a vintage 16x2 VFD?
« on: April 29, 2015, 03:32:45 pm »
I just bought a VFD from eBay, and i cant actually control it.

I had follow the datasheet provide by the seller, however im still did not manage to control it. I tried to pop the data to a LCD control code(as standard ASCII) and it still nothing happen.

here is my code
--------------------------------------------------------------------------------
#include <htc.h>
#include <pic.h>

__CONFIG (0x0FAC);
__CONFIG (0x1CFF);

#define _XTAL_FREQ 16000000 //for __delay_ purpose

void main(void)
{
   OSCCON = 0b01111010; //16MHz Fosc, Int Osc module
   TRISA = 0b00000001;
   ANSA0 = 0;
   TRISB = 0xFF;   //data uses
   
   PORTA = 0b00000010;
   __delay_ms(1);
   PORTB = 0x0F; //show cursor
   __delay_us(1);
   RA1 = 1;   //enable write
   __delay_us(300);
   RA1 = 0;
   __delay_ms(1);
   PORTB = 0x7F;
   RA1 = 1;
   __delay_us(300);
   RA1 = 0;
   for(;;)
   {
   }
}
-----------------------------------------------------------------------
after fail on standard LCD control program, i decide to give a try on the cursor and full print to the screen, however it is again fail


here is the datasheet and eBay link for the item

http://www.jdosher.pwp.blueyonder.co.uk/16x2vfd_7_IEE-03601-16x2-datasheet.pdf

http://www.ebay.co.uk/itm/16x2-Vacuum-Flourescent-Display-5-volt-with-data-5x7-dot-matrix-8-bit-parallel-/381216029301?pt=LH_DefaultDomain_3&hash=item58c23efa75
 

Offline Andy Watson

  • Super Contributor
  • ***
  • Posts: 2154
Re: How to control a vintage 16x2 VFD?
« Reply #1 on: April 29, 2015, 04:05:48 pm »
   TRISB = 0xFF;   //data uses

You appear to have set PORT B as an input - and it remains so throughout the rest of the program. Controlling the VFD appears to be as simple as squirting ascii codes at  it. Cursor positioning is done by "escape sequences".
 

Offline jeroen74

  • Frequent Contributor
  • **
  • Posts: 396
  • Country: nl
Re: How to control a vintage 16x2 VFD?
« Reply #2 on: April 29, 2015, 07:12:35 pm »
TRISx:

1=(I)nput 0=(O)utput
 

Offline singlarrysongTopic starter

  • Contributor
  • Posts: 34
Re: How to control a vintage 16x2 VFD?
« Reply #3 on: April 29, 2015, 07:17:15 pm »
Yea i saw that. A careless mistake
I'll give a reply if success
now had showing something
 

Offline singlarrysongTopic starter

  • Contributor
  • Posts: 34
Re: How to control a vintage 16x2 VFD?
« Reply #4 on: April 29, 2015, 07:53:20 pm »
Success finally. But was limited to this code


#include <htc.h>
#include <pic.h>

__CONFIG (0x0FAC); //see "Config" > "Configuration bits" for detail
__CONFIG (0x1CFF); //as above

#define _XTAL_FREQ 16000000 //for __delay_ purpose

void main(void)
{
   OSCCON = 0b01111010; //16MHz Fosc, Int Osc module
   
   TRISA = 0x00;
   PORTA = 0;
   TRISB = 0x00;
   __delay_ms(1000);
   PORTB = 0x7F;
   RA0 = 1;
   __delay_us(250);
   PORTB = 0;
   RA0 = 0;
   
   for(;;)
   {
   }
}
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf