Pages: [1]   Go Down
Author Topic: Request: M66004 VFD Driver Library  (Read 769 times)
0 Members and 1 Guest are viewing this topic.
0
Offline Offline
Newbie
*
Karma: 0
Posts: 17
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I'm looking for a library for the Mitsubishi M66004 16-character VFD driver.  This driver uses what looks like a pseudo SPI/I2C serial interface that I don't think is compatible with the built-in hardware.  If anyone has already created a library for this chip, or if you are looking for a challenge and want to undertake this endeavor, it would be most appreciated.   smiley

Datasheet:  http://www.datasheetcatalog.org/datasheet/MitsubishiElectricCorporation/mXssttr.pdf
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 7
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I second this. I have a couple of these displays laying around that I would love to include in some projects, but don't quite have the knowledge to implement my own library yet.

Thanks!
Logged

Phoenix, Arizona USA
Offline Offline
Faraday Member
**
Karma: 39
Posts: 5551
Where's the beer?
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
I'm looking for a library for the Mitsubishi M66004 16-character VFD driver.  This driver uses what looks like a pseudo SPI/I2C serial interface that I don't think is compatible with the built-in hardware.
 

I didn't do an in-depth comparison, but it doesn't immediately strike me as "incompatible" with SPI/I2C; worst case scenario is that you would have to simply bit-bang it.

Quote
If anyone has already created a library for this chip, or if you are looking for a challenge and want to undertake this endeavor, it would be most appreciated.

In order to create such a library, one would need the VFD w/ the driver chip - perhaps you might be able to tell us where you got the VFD and chip in question?

Quote
I have a couple of these displays laying around that I would love to include in some projects, but don't quite have the knowledge to implement my own library yet.

If you can bit-bang data to a 595 shift register (not saying you have), then you can probably write some functions to control this chip, at least to the point of getting something to display. Beyond that, its just some experimenting, then building the actual library code (which may be left to others).

Right now, though, I think what we most need is a source for these displays - without that, both of you are basically "on your own"...

 smiley
Logged

I will not respond to Arduino help PM's from random forum users; if you have such a question, start a new topic thread.

0
Offline Offline
Newbie
*
Karma: 0
Posts: 1
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi there. Well I know that this topic is a little bit old, but however. I've found an old display from a XEROX laser printer, that has the M66004 driver. I only use Microchip PICs for my projects, but I believe that it could help you.
In first case, this .c source got everything you can need to make this works. In my code, the PIC "bitbangs" the driver with the data. Maybe SPI can work (because data transmision is very similar). Anyways, I just wanted to know if it works, and it does smiley-grin.
The example is writted in C18, and I'm using a 18F4550 pic. Output ports and TRI-STATES can be changed in #defines statements.
Ok, the example itselfs uses a 16 digits display and changes the dimmer oscillator while it displays the current dimmer power. It displays it on the position that the digit its. (I mean, dimmer configuration is 5, then the digit 5 will display "5").
I've added all the configurations possibles for anything that could be changed in the driver. All of those configurations are on the #define area.

I believe that it has some bugs, but at least this is something.
Code:
/** I N C L U D E S **********************************************************/
#include <p18F4550.h>
#include <delays.h>
#include <stdlib.h>
#include <adc.h>
#include <usart.h>
#include <i2c.h>
#include <xlcd.h>

#pragma config PLLDIV   = 5         // (20 MHz crystal on PICDEM FS USB board)
#pragma config CPUDIV   = OSC1_PLL2  
#pragma config USBDIV   = 2         // Clock source from 96MHz PLL/2
#pragma config FOSC     = HSPLL_HS
#pragma config FCMEN    = OFF
#pragma config IESO     = OFF
#pragma config PWRT     = OFF
#pragma config BOR      = ON
#pragma config BORV     = 3
#pragma config VREGEN   = ON      //USB Voltage Regulator
#pragma config WDT      = OFF
#pragma config WDTPS    = 32768
#pragma config MCLRE    = OFF
#pragma config LPT1OSC  = OFF
#pragma config PBADEN   = OFF
//      #pragma config CCP2MX   = ON
#pragma config STVREN   = ON
#pragma config LVP      = OFF
//      #pragma config ICPRT    = OFF       // Dedicated In-Circuit Debug/Programming
#pragma config XINST    = OFF       // Extended Instruction Set
#pragma config CP0      = OFF
#pragma config CP1      = OFF
//      #pragma config CP2      = OFF
//      #pragma config CP3      = OFF
#pragma config CPB      = OFF
//      #pragma config CPD      = OFF
#pragma config WRT0     = OFF
#pragma config WRT1     = OFF
//      #pragma config WRT2     = OFF
//      #pragma config WRT3     = OFF
#pragma config WRTB     = OFF       // Boot Block Write Protection
#pragma config WRTC     = OFF
//      #pragma config WRTD     = OFF
#pragma config EBTR0    = OFF
#pragma config EBTR1    = OFF
//      #pragma config EBTR2    = OFF
//      #pragma config EBTR3    = OFF
#pragma config EBTRB    = OFF


/** V A R I A B L E S ********************************************************/
#pragma udata

/** P R I V A T E  P R O T O T Y P E S ***************************************/

/** V E C T O R  R E M A P P I N G *******************************************/

extern void _startup (void);        // See c018i.c in your C18 compiler dir
#pragma code _RESET_INTERRUPT_VECTOR = 0x000800
void _reset (void)
{
      _asm goto _startup _endasm
}
#pragma code

#pragma code _HIGH_INTERRUPT_VECTOR = 0x000808
void _high_ISR (void)
{
      ;
}

#pragma code _LOW_INTERRUPT_VECTOR = 0x000818
void _low_ISR (void)
{
      ;
}
#pragma code


/** D E C L A R A T I O N S **************************************************/
#pragma code

#define VFD_CS_TRIS             TRISBbits.TRISB7
#define VFD_SCK_TRIS            TRISBbits.TRISB6
#define VFD_SDATA_TRIS            TRISBbits.TRISB5
#define VFD_CS                        LATBbits.LATB7
#define VFD_SCK                        LATBbits.LATB6
#define VFD_SDATA                  LATBbits.LATB5

#define ASCII_SPACE                  0x20      // to clear digits

// = Display digit length settings =
//  Use it with vfd_bbbyte()
#define VFD_DISP_9                  0x0            // 9 digits vfd
#define VFD_DISP_10                  0x1            // 10 digits vfd
#define VFD_DISP_11                  0x2            // 11 digits vfd
#define VFD_DISP_12                  0x3            // 12 digits vfd
#define VFD_DISP_13                  0x4            // 13 digits vfd
#define VFD_DISP_14                  0x5            // 14 digits vfd
#define VFD_DISP_15                  0x6            // 15 digits vfd
#define VFD_DISP_16                  0x7            // 16 digits vfd

// = Dimmer value settings =
// Use it with vfd_bbbyte()
#define VFD_DIMMER_1_16            0x8            // dimmer low
#define VFD_DIMMER_2_16            0x9
#define VFD_DIMMER_4_16            0xA
#define VFD_DIMMER_6_16            0xB
#define VFD_DIMMER_8_16            0xC
#define VFD_DIMMER_10_16      0xD
#define VFD_DIMMER_12_16      0xE
#define VFD_DIMMER_14_16      0xF            // dimmer high

// = One-digit display frequency settings =
// Use it with vfd_bbbyte()
#define VFD_TDSP_HIGH            0xF6      // 128/fOSC
#define VFD_TDSP_LOW            0xF7      // 256/fOSC

// = Auto Increment settings =
// Use it with vfd_bbbyte()
#define VFD_AUTOINC_ON            0xF5      // digit position autoincrement enabled
#define VFD_AUTOINC_OFF            0xF4      // digit position autoincrement disabled

// = All-digit display ON/OFF =
// Use it with vfd_bbbyte()
#define VFD_DIGITS_OFF            0xF0      // all digits are off
#define VFD_DIGITS_NORMAL      0xF1      // digits will be on if its a character in
#define VFD_DIGITS_ON            0xF3      // all digits are on always

// = Cursor ON/OFF =
// Use it with vfd_set_cursor()
#define VFD_CURSOR_OFF            0x80      // Seg35 off
#define VFD_CURSOR_ON            0x10      // Seg35 on

// = RAM characters =
// Internally used on vfd_set_ram()
#define VFD_WRITERAM            0xFC

// = Outputs =
// Internally used on vfd_set_output()
#define VFD_SETOUT                  0xF8      


void huguedelay(void)
{
      Delay10KTCYx(255);
      Delay10KTCYx(255);
      Delay10KTCYx(255);
      Delay10KTCYx(255);
      Delay10KTCYx(255);
      Delay10KTCYx(255);
}

void vfd_busy_delay(void) { Nop(); Nop(); Nop(); Nop(); Nop(); Nop(); Nop(); Nop(); }
void vfd_clock(void) { VFD_SCK = 0; vfd_busy_delay(); VFD_SCK = 1; }
void vfd_zero(void) { VFD_CS = VFD_SCK = VFD_SDATA = 1; }

void vfd_bbbyte(char data)
{
      VFD_CS = 0;      
      VFD_SDATA = (data & 0b10000000)>>7;      vfd_clock();
      VFD_SDATA = (data & 0b01000000)>>6;      vfd_clock();
      VFD_SDATA = (data & 0b00100000)>>5;      vfd_clock();
      VFD_SDATA = (data & 0b00010000)>>4;      vfd_clock();
      VFD_SDATA = (data & 0b00001000)>>3;      vfd_clock();
      VFD_SDATA = (data & 0b00000100)>>2;      vfd_clock();
      VFD_SDATA = (data & 0b00000010)>>1;      vfd_clock();
      VFD_SDATA = (data & 0b00000001);      vfd_clock();      
      VFD_CS = 1;
      vfd_busy_delay();
      vfd_busy_delay();
}

void vfd_set_ram(char pos, char l1, char l2, char l3, char l4, char l5)
{
      vfd_bbbyte(VFD_WRITERAM);
      vfd_bbbyte(pos);
      vfd_bbbyte(l1);
      vfd_bbbyte(l2);
      vfd_bbbyte(l3);
      vfd_bbbyte(l4);
      vfd_bbbyte(l5);
}

void vfd_set_cursor(char x, char data) { vfd_bbbyte(data | x); }
void vfd_set_output(char p0, char p1) { vfd_bbbyte(VFD_SETOUT | p0 | (p1>>1)); }

void vfd_goto(char x) { vfd_bbbyte(x | 0b11100000); }
void vfd_putc(char data) { vfd_bbbyte(data); }
void vfd_puts(char *data) { do { vfd_putc(*data); } while( *data++ ); }
void vfd_putrs(const rom char *data) { do { vfd_putc(*data); } while( *data++ ); }


void main(void)
{
      unsigned char j;

      vfd_zero();
      TRISBbits.TRISB7 = 0;
      TRISBbits.TRISB6 = 0;
      TRISBbits.TRISB5 = 0;


      huguedelay();


      vfd_bbbyte(VFD_DISP_16);            // digit len
      vfd_bbbyte(VFD_DIMMER_1_16);      // dimmer
      vfd_bbbyte(VFD_TDSP_HIGH);            // digit frec
      vfd_bbbyte(VFD_DIGITS_NORMAL);      // digits normal
      vfd_bbbyte(VFD_AUTOINC_ON);      // auto increment
      
      vfd_goto(0);
      vfd_putrs("This is a testxy");
      huguedelay();
      huguedelay();
      vfd_bbbyte(VFD_AUTOINC_OFF);          // no auto increment

      while(1){
            for (j=0;j<8;j++){
                  huguedelay();
                  vfd_bbbyte(j | 0x08);      // set dimmer as j changes
                  vfd_putc(ASCII_SPACE);      // clear previous digit
                  vfd_goto(j);                  // goto digit j
                  vfd_putc(j+0x30);            // write ascii number of current number (0 is ascii 0x30)
            }      
      }

}

PD: Sorry for my bad english smiley-grin
« Last Edit: November 16, 2010, 10:41:19 pm by cocus » Logged

Pages: [1]   Go Up
Jump to: