2001 Microchip Technology Inc.
DS39024B-page 49
LCD.C
Description
#else
// Lower nibble
interface
DATA_PORT &= 0xf0;
// Write lower nib-
ble
DATA_PORT |= (CGaddr&0x0f);
#endif
DelayFor18TCY();
E_PIN = 1;
// Clock cmd and
address in
DelayFor18TCY();
E_PIN = 0;
#ifdef UPPER
// Upper nibble
interface
TRIS_DATA_PORT |= 0xf0;
// Make inputs
#else
// Lower nibble
interface
TRIS_DATA_PORT |= 0x0f;
// Make inputs
#endif
#endif
return;
}
/
*******************************************************************
*
* Function Name:
SetDDRamAddr
* Return Value:
void
* Parameters:
CGaddr: display data address
* Description:
This routine sets the display data address
*
of the Hitachi HD44780 LCD controller. The
*
user must check to see if the LCD controller
*
is busy before calling this routine.
*******************************************************************
*/
void SetDDRamAddr(static unsigned char DDaddr)
{
while(BusyXLCD());
#ifdef BIT8
// 8-bit interface
TRIS_DATA_PORT = 0;
// Make port output
DATA_PORT = DDaddr | 0b10000000;
// Write cmd and
address to port
RW_PIN = 0;
// Set the control
bits
RS_PIN = 0;
DelayFor18TCY();
E_PIN = 1;
// Clock the cmd and
address in
DelayFor18TCY();
E_PIN = 0;
DelayFor18TCY();
TRIS_DATA_PORT = 0xff;
// Make port input
#else
// 4-bit interface
#ifdef UPPER
// Upper nibble
interface
TRIS_DATA_PORT &= 0x0f;
// Make port output
DATA_PORT &= 0x0f;
// and write upper
nibble
DATA_PORT |= ((DDaddr | 0b10000000) & 0xf0);
Содержание Picdem 17
Страница 1: ...PICDEM 17 DEMONSTRATION BOARD USER S GUIDE 2001 Microchip Technology Inc DS39024B ...
Страница 19: ... 2001 Microchip Technology Inc DS39024B page 13 Using the PICDEM 17 Monitor Figure 2 5 Running Diagnostics ...
Страница 24: ...PICDEM 17 Demonstration Board User s Guide DS39024B page 18 2001 Microchip Technology Inc NOTES ...
Страница 28: ...PICDEM 17 Demonstration Board User s Guide DS39024B page 22 2001 Microchip Technology Inc NOTES ...
Страница 40: ...PICDEM 17 Demonstration Board User s Guide DS39024B page 34 2001 Microchip Technology Inc NOTES ...
Страница 62: ...PICDEM 17 Demonstration Board User s Guide DS39024B page 56 2001 Microchip Technology Inc NOTES ...
Страница 80: ...PICDEM 17 Demonstration Board User s Guide DS39024B page 74 2001 Microchip Technology Inc NOTES ...
Страница 82: ...PICDEM 17 Demonstration Board User s Guide DS39024B page 76 2001 Microchip Technology Inc A 1 SCHEMATIC 1 ...
Страница 83: ... 2001 Microchip Technology Inc DS39024B page 77 PICDEM 17 Demonstration Board Schematics A 2 SCHEMATIC 2 ...
Страница 84: ...PICDEM 17 Demonstration Board User s Guide DS39024B page 78 2001 Microchip Technology Inc A 3 SCHEMATIC 3 ...
Страница 85: ... 2001 Microchip Technology Inc DS39024B page 79 PICDEM 17 Demonstration Board Schematics A 4 SCHEMATIC 4 ...
Страница 86: ...PICDEM 17 Demonstration Board User s Guide DS39024B page 80 2001 Microchip Technology Inc NOTES ...
Страница 90: ...PICDEM 17 Demonstration Board User s Guide DS39024B page 84 2001 Microchip Technology Inc NOTES ...
Страница 91: ... 2001 Microchip Technology Inc DS39024B page 85 Floppy Disk Contents NOTES ...