GCL_PIFaceCaD (GVL)ΒΆ

InOut:

Scope

Name

Type

Initial

Comment

Constant

IODIRA

USINT

16#0

I/O direction A

IODIRB

USINT

16#1

I/O direction B

IPOLA

USINT

16#2

I/O polarity A

IPOLB

USINT

16#3

I/O polarity B

GPINTENA

USINT

16#4

interupt enable A

GPINTENB

USINT

16#5

interupt enable B

DEFVALA

USINT

16#6

register default value A (interupts)

DEFVALB

USINT

16#7

register default value B (interupts)

INTCONA

USINT

16#8

interupt control A

INTCONB

USINT

16#9

interupt control B

IOCON

USINT

16#A

I/O config (also : USINT := 16#0B)

GPPUA

USINT

16#C

port A pullups

GPPUB

USINT

16#D

port B pullups

INTFA

USINT

16#E

interupt flag A (where the interupt came from)

INTFB

USINT

16#F

interupt flag B

INTCAPA

USINT

16#10

interupt capture A (value at interupt is saved here)

INTCAPB

USINT

16#11

interupt capture B

GPIOA

USINT

16#12

port A

GPIOB

USINT

16#13

port B

OLATA

USINT

16#14

output latch A

OLATB

USINT

16#15

output latch B

BANK_OFF

USINT

16#0

addressing mode

BANK_ON

USINT

16#80

INT_MIRROR_ON

USINT

16#40

interupt mirror (INTa|INTb)

INT_MIRROR_OFF

USINT

16#0

SEQOP_OFF

USINT

16#20

incrementing address pointer

SEQOP_ON

USINT

16#0

DISSLW_ON

USINT

16#10

slew rate

DISSLW_OFF

USINT

16#0

HAEN_ON

USINT

16#8

hardware addressing

HAEN_OFF

USINT

16#0

ODR_ON

USINT

16#4

open drain for interupts

ODR_OFF

USINT

16#0

INTPOL_HIGH

USINT

16#2

interupt polarity

INTPOL_LOW

USINT

16#0

DELAY_PULSE_NS

UDINT

1000

1us

DELAY_SETTLE_NS

UDINT

40000

40us

DELAY_CLEAR_NS

UDINT

2600000

2.6ms

DELAY_SETUP_0_NS

UDINT

15000000

15ms

DELAY_SETUP_1_NS

UDINT

5000000

5ms

DELAY_SETUP_2_NS

UDINT

1000000

1ms

PIN_D4

USINT

0

mcp23s17 GPIOB to HD44780 pin map

PIN_D5

USINT

1

PIN_D6

USINT

2

PIN_D7

USINT

3

PIN_ENABLE

USINT

4

PIN_RW

USINT

5

PIN_RS

USINT

6

PIN_BACKLIGHT

USINT

7

LCD_CLEARDISPLAY

USINT

16#1

commands

LCD_RETURNHOME

USINT

16#2

LCD_ENTRYMODESET

USINT

16#4

LCD_DISPLAYCONTROL

USINT

16#8

LCD_CURSORSHIFT

USINT

16#10

LCD_FUNCTIONSET

USINT

16#20

LCD_SETCGRAMADDR

USINT

16#40

LCD_SETDDRAMADDR

USINT

16#80

LCD_NEWLINE

USINT

16#C0

LCD_ENTRYRIGHT

USINT

16#0

flags for display entry mode

LCD_ENTRYLEFT

USINT

16#2

LCD_ENTRYSHIFTINCREMENT

USINT

16#1

LCD_ENTRYSHIFTDECREMENT

USINT

16#0

LCD_DISPLAYON

USINT

16#4

flags for display on/off control

LCD_DISPLAYOFF

USINT

16#0

LCD_CURSORON

USINT

16#2

LCD_CURSOROFF

USINT

16#0

LCD_BLINKON

USINT

16#1

LCD_BLINKOFF

USINT

16#0

LCD_DISPLAYMOVE

USINT

16#8

flags for display/cursor shift

LCD_CURSORMOVE

USINT

16#0

LCD_MOVERIGHT

USINT

16#4

LCD_MOVELEFT

USINT

16#0

LCD_8BITMODE

USINT

16#10

flags for function set

LCD_4BITMODE

USINT

16#0

LCD_2LINE

USINT

16#8

LCD_1LINE

USINT

16#0

LCD_5X10DOTS

USINT

16#4

LCD_5X8DOTS

USINT

16#0

LCD_MAX_LINES

USINT

2

LCD_WIDTH

USINT

16

LCD_RAM_WIDTH

USINT

80

RAM is 80 wide, split over two lines

ROW_OFFSETS

ARRAY [0..1] OF BYTE

[0, 16#40]

SWITCH_PORT

USINT

GPIOA

LCD_PORT

USINT

GPIOB