Autor Tema: Control de display VFD utilizando c18 y bus i80  (Leído 3577 veces)

0 Usuarios y 1 Visitante están viendo este tema.

Desconectado ablanco93

  • PIC10
  • *
  • Mensajes: 15
Control de display VFD utilizando c18 y bus i80
« en: 29 de Junio de 2010, 11:56:51 »
Me gustaría controlar un VFD (vaccumm fluoresent display) utilizando un pic18 o un pic24 con c18, c24 (me gustaría empezar por el 18 :P). :D . El problema que tengo es, que debe de ser con bus i80 el cual maneja diferentes señales de control: M68= E, R/W ; i80= WR, RD . La verdad que no he encontrado nada de informacion sobre el protocolo, yo creo que se debe de poner en bajo el bit WR y mandar datos y ya, pero tambien me gustaria saber como inicializar un VFD con i80, ya que en todos lados encuentro como inicializar un VFD con M68 y segun yo, deben de ser cosas diferentes. Me gustaria crear una libreria ya especifica para un VFD utilizando i80 ya que eso no existe, yo creo que le ayudara a mucha gente ya que es algo que no hay.
Gracias por su tiempo.

Desconectado Nocturno

  • Administrador
  • DsPIC33
  • *******
  • Mensajes: 18286
    • MicroPIC
Re: Control de display VFD utilizando c18 y bus i80
« Respuesta #1 en: 29 de Junio de 2010, 12:20:34 »
¿Tienes la datasheet del VFD?

Desconectado ablanco93

  • PIC10
  • *
  • Mensajes: 15
Re: Control de display VFD utilizando c18 y bus i80
« Respuesta #2 en: 29 de Junio de 2010, 12:38:29 »
Gracias por tu interes. El VFD que utilizare es el: : CU16025-UW6J  de la empresa NORITAKE. Te adjunto el PDF  del VFD (es el PDF resumen por que el completo no me permite adjuntarlo esta muy grande   y ni zipado se puede :s) Gracias por tu tiempo.

Desconectado Nocturno

  • Administrador
  • DsPIC33
  • *******
  • Mensajes: 18286
    • MicroPIC
Re: Control de display VFD utilizando c18 y bus i80
« Respuesta #3 en: 29 de Junio de 2010, 13:04:58 »
Pues te lo he pedido por si se parecía en algo a uno que usé una vez, pero me temo que no.

He buscado por ahí, y me ha aparecido este link, donde dice que se puede utilizar la librería de Microchip con el driver del SSD1926 que parece ser compatible:
http://www.microchip.com/forums/tm.aspx?high=&m=486742&mpage=1#487660

Desconectado ablanco93

  • PIC10
  • *
  • Mensajes: 15
Re: Control de display VFD utilizando c18 y bus i80
« Respuesta #4 en: 29 de Junio de 2010, 13:39:57 »
Muchas gracias por tu pronta respuesta nocturno :) . La verdad que hay mucha informacion por ahi verdad? mira te dejo un link de un usuario que controlo un VFD pero utilizando M68 a ver si te sirve de algo.

http://www.socosoftware.com/M68Display.html

gracias :)

Desconectado Gringo_

  • PIC10
  • *
  • Mensajes: 4
Re: Control de display VFD utilizando c18 y bus i80
« Respuesta #5 en: 30 de Junio de 2010, 18:17:22 »
Muchas gracias por tu pronta respuesta nocturno :) . La verdad que hay mucha informacion por ahi verdad? mira te dejo un link de un usuario que controlo un VFD pero utilizando M68 a ver si te sirve de algo.

http://www.socosoftware.com/M68Display.html

gracias :)

A vos tiene que servirte!  :D :D

Desconectado ablanco93

  • PIC10
  • *
  • Mensajes: 15
Re: Control de display VFD utilizando c18 y bus i80
« Respuesta #6 en: 05 de Julio de 2010, 10:26:26 »
jajajaj tienes razon, pero igual a el que me este ayudando le sirve. Viene como manejar un VFD utilizando C18 pero el problema es que viene la inicializacion del VFD utilizando M68 y yo lo necesito con i80 :S alguna sugerencia amigos? gracias por su tiempo :D

Desconectado ablanco93

  • PIC10
  • *
  • Mensajes: 15
Re: Control de display VFD utilizando c18 y bus i80
« Respuesta #7 en: 19 de Julio de 2010, 19:13:29 »
Bueno de regreso con lo del VFD, ya he leido el datasheet y sobre el protocolo i80 que es el que utilizo para utilizar el VFD. A continuacion les dejo la libreria para inicializar el VFD, no se por que no funciona, trate de comentarla lo mas que pude, si alguien tiene una sugerencia de como debo de inicializarlo, o de como debo de escribir un byte/comando hacia el VFD se lo agradeceria.

/*LIBRERIA PARA CONTROLAR UN VFD DE LA MARCA NORITAKE MODELO CU16025-UW6J  UTILIZANDO 8 BITS PARA ENVIAR DATOS, POR MEDIO DEL PUERTO E
Y USANDO LOS PINES C1 COMO "WR" (WRITE ENABLE) Y C2 COMO "RD" (READ ENABLE) EN EL PIC24FJ128GA010*/
 
#ifndef __VFD_AMS24
#define __VFD_AMS24

#define FCY 2000000UL               //PARA UTILIZAR LAS FUNCIONES DE LOS RETARDOS
#include<libpic30.h>               //LIBRERIA PARA LOS RETARDOS

//DEFINICION DE BITS DE CONTROL DEL VFD
#define WR      PORTCbits.RC1         //WRITE ENABLE
#define RD      PORTCbits.RC2         //READ ENABLE
#define RS      PORTCbits.RC3         //RS SELECTS, DATA OR COMMAND
#define DATO   PORTE               // DATA/COMAND INPUT


void vfd_write_cmd(unsigned char command)
{
   RD=0;                        //NO SE LEERA!!!!
   RS=0;                        //SE ESCRIBIRA UN COMANDO
   WR=1;                        //WR EN ALTO
   WR=0;                        //WR PASA A BAJO
   __delay_us(2);                  //PEQUEÑO RETARDO
   WR=1;                        //WR ALTO
   DATO=command;                  //SE MANDA EL COMANDO AL BUFFER
   __delay_us(2);   
   WR=0;                        //WR DE NUEVO EN BAJO
}

void vfd_write_dato(unsigned char data)
{
   RD=0;                        //NO SE LEERA!!!!
   RS=1;                        //SE ESCRIBIRA UN COMANDO
   WR=1;                        //WR EN ALTO
   WR=0;                        //WR PASA A BAJO
   __delay_us(2);                  //PEQUEÑO RETARDO
   WR=1;                        //WR ALTO
   DATO=data;                     //SE MANDA EL COMANDO AL BUFFER
   __delay_us(2);   
   WR=0;                        //WR DE NUEVO EN BAJO

}


void vfd_init()                     //FUNCION PARA INICIALIZAR EL VFD
{
   TRISCbits.TRISC1=0;               //RC1 COMO SALIDA
   TRISCbits.TRISC2=0;               //RC2 COMO SALIDA
   TRISCbits.TRISC3=0;               //RC3 COMO SALIDA
   TRISE=0;                     //TODO EL PUERTO E COMO SALIDAS
   
   PORTE=0;
   PORTCbits.RC1=0;                //APAGADO DE LOS PINES
   PORTCbits.RC2=0;               //APAGADO DE LOS PINES
   PORTCbits.RC3=0;               //APAGADO DE LOS PINES


   vfd_write_cmd(48);               //FUNCTION SET   
                              //  WR      DB7   DB6   DB5   DB4   DB3   DB2   DB1   DB0
                                                                                   //  0      0   0   1   IF   *   *   *   *               *= don´t care         
                              //   0      0   0   1   1   0   0   0   0   

   vfd_write_cmd(48);               //FUNCTION SET   
                              //  WR      DB7   DB6   DB5   DB4   DB3   DB2   DB1   DB0
                                                                                //    0      0   0   1   IF   *   *   *   *               *= don´t care         
                              //   0      0   0   1   1   0   0   0   0   
   

   vfd_write_dato(0);               //BRIGHTNESS SET
                              //  WR      DB7   DB6   DB5   DB4   DB3   DB2   DB1   DB0
                                                                                  //  0      0   0   0   0   0   0   BR1   BR0
                              //   0      0   0   0   0   0   0   0   0


   vfd_write_cmd(1);               //COMANDO CLEAR DISPLAY
                              //  WR      DB7   DB6   DB5   DB4   DB3   DB2   DB1   DB0
                                                                                  //  0      0   0   0   0   0   0   0   1

   vfd_write_cmd(128);               //SET THE ADDRESS COUNTER TO POINT DE DD RAM
                              //  WR      DB7   DB6   DB5   DB4   DB3   DB2   DB1   DB0
                                                                                  //  0      1   0   0   0   0   0   0   0

   vfd_write_cmd(7);               //DISPLAY ON/OFF
                              //  WR      DB7   DB6   DB5   DB4   DB3   DB2   DB1   DB0
                                                                                   //  0      0   0   0   0   0   D   C   B
                                //  0      0   0   0   0   0   1   1   1
   
   vfd_write_cmd(6);               //ENTRY MODE SET
                              //  WR      DB7   DB6   DB5   DB4   DB3   DB2   DB1   DB0
                                                                                  //  0      0   0   0   0   0   1   I/D   S
                              //   0      0   0   0   0   0   1   1   0
}

#endif

/*
     BITS DE CONTROL DEL BYTE "DISPLAY ON/OFF"
      D=1: Display on
      D=0: Display off

      The C bit turns the cursor on or off. 
   C=1: Cursor on
   C=0: Cursor off

   The B bit enables blinking of the character the cursor coincides with.
   B=1: Blinking on
   B=0: Blinking off */


/*
   BITS DE CONTROL DEL BYTE "ENTRY MODE SET"
   The I/D bit selects the way in which the contents of the address counter are modified after every access to DDRAM or CGRAM. 
   I/D=1: The address counter is increment.
   I/D=0: The address counter is decrement.

   The S bit enables display shifts instead of cursor shift, after each write or read to the DDRAM. 
   S=1: Display shift enabled.
   S=0: Cursor shift enabled.

*/

/*
   BITS DE CONTROL DEL BYTE "FUNCTION SET"
   This command sets width of data bus line by itself, and sets screen brightness by following one byte data.
   This instruction initializes the system, and must be the first instruction executed after power-on.
   The IF bit selects between an 8-bit or a 4-bit bus width interface.
 
    IF=1: 8-bit CPU interface using DB7 to DB0
    IF=0: 4-bit CPU interface using DB7 to DB4
*/

/*   BITS DE CONTROL DEL BYTE "BRIGHTNESS CONTROL"
   One byte data (RS=1) which follows the "Function Set Command" is considered as brightness data. When a command (RS=0) is written after the "Function Set Command", the brightness
   control function is not initiated. Screen brightness is as follows.

    BR1 BR0 Brightness 
 -------- -------- -----------------------
    0      0    100 % (Default)
    0    1    75 %
    1    0    50 %
    1    1    25 %
*/