Autor Tema: Conexion de un LCD a 4 bits predefinido con Proton  (Leído 2540 veces)

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

Desconectado LordLafebre

  • Moderador Global
  • DsPIC30
  • *****
  • Mensajes: 3529
    • Micros & micros
Conexion de un LCD a 4 bits predefinido con Proton
« en: 10 de Enero de 2006, 11:26:00 »
Hola Amigos:

Pues queria saber si al igual que PBP, proton tiene una configuracion predeterminada para un lcd a 4 bits, en PBP es asi:

A4 - R/S
B3 - E
A0 - D4
A1 - D5
A2 - D6
A3 - D7

no necesito hacer ninguna declaracion y el programita para un mensaje es el siguiente:

Codigo:
pause 100
loop:
        lcdout $fe, 1 , "TODOPIC"
end


Probe el mismo tipo de conexion con este programita en proton:

Codigo:
device 16F877
xtal 4

delayms 100
CLS
    print at 1,1, "TODOPIC"
    delayms 2000
end


pero no me funciono, asi que me imagino que si existe una configuracion personalizada debe ser otra...

La hay? Avergonzado

Desconectado LordLafebre

  • Moderador Global
  • DsPIC30
  • *****
  • Mensajes: 3529
    • Micros & micros
RE: Conexion de un LCD a 4 bits predefinido con Proton
« Respuesta #1 en: 10 de Enero de 2006, 11:43:00 »
Hola amigos:

Me respondo yo mismo, ya lo encontre:

Declares

There are six Declares for use with an alphanumeric LCD and PRINT: -
 
DECLARE LCD_TYPE 1 or 0 , GRAPHIC or ALPHA
Inform the compiler as to the type of LCD that the PRINT command will output to. If GRAPHIC or 1 is chosen then any output by the PRINT command will be directed to a graphic LCD based on the Samsung S6B0108 chipset. A value of 0 or ALPHA, or if the DECLARE is not issued will target the standard alphanumeric LCD type
 
Targeting the graphic LCD will also enable commands such as Plot, UnPlot, LCDRead and LCDWrite.
 
DECLARE LCD_DTPIN PORT . PIN
Assigns the Port and Pins that the LCD"s DT (data) lines will attach to.
 
The LCD may be connected to the PICmicro using either a 4-bit bus or an 8-bit bus. If an 8-bit bus is used, all 8 bits must be on one port. If a 4-bit bus is used, it must be connected to either the bottom 4 or top 4 bits of one port. For example: -
 
DECLARE LCD_DTPIN PORTB.4     " Used for 4-line interface.
DECLARE LCD_DTPIN PORTB.0     " Used for 8-line interface.
 
In the examples above, PORTB is only a personal preference. The LCD"s DT lines may be attached to any valid port on the PICmicro. If the Declare is not used in the program, then the default Port and Pin is PORTB.4, which assumes a 4-line interface.

DECLARE LCD_ENPIN PORT . PIN
Assigns the Port and Pin that the LCD"s EN line will attach to.
 
If the Declare is not used in the program, then the default Port and Pin is PORTB.2.
 
DECLARE LCD_RSPIN PORT . PIN
Assigns the Port and Pins that the LCD"s RS line will attach to.
 
If the Declare is not used in the program, then the default Port and Pin is PORTB.3.
 
DECLARE LCD_INTERFACE 4 or 8
Inform the compiler as to whether a 4-line or 8-line interface is required by the LCD.
 
If the Declare is not used in the program, then the default interface is a 4-line type.
 
DECLARE LCD_LINES 1 , 2 , or 4
Inform the compiler as to how many lines the LCD has.
 
LCD"s come in a range of sizes, the most popular being the 2 line by 16 character types. However, there are 4-line types as well. Simply place the number of lines that the particular LCD has, into the declare.

If the Declare is not used in the program, then the default number of lines is 2.

B7 - D7
B6 - D6
B5 - D5
B4 - D4
B3 - R/S
B2 - E

Ahora si ya me funciona Sonrisa Gigante