Documentation for project debounce.prj
Basic18 Documentation Generator V 1.0
Index
| Project Path | C:\Eric\vb\Projects\Bas18a3\programs\Examples3\ButtonDebounce\debounce.prj |
| Processor: | 18F452 |
| Oscillator: | 4MHz |
Included files:
- c:\eric\vb\projects\bas18a3\programs\examples3\buttondebounce\debounce.tmp
- c:\eric\vb\projects\bas18a3\source\libs\18f452.bas
- c:\eric\vb\projects\bas18a3\programs\examples3\buttondebounce\debounce.bas
- c:\eric\vb\projects\bas18a3\source\libs\interface\4bitlcd.bas
- c:\eric\vb\projects\bas18a3\source\libs\interface\debounce.bas
Button Debouncing example
Simply count button presses and display the total on an LCD
This program works with the ICD2 Demo board
PORTB pin 0 is pulled high with a 10K resistor and switched
low with the button
LCD data bits 4, 5, 6, 7 connected to PORTD bits 4, 5, 6, 7
LCD E on PORTA bit 1
LCD RW on PORTA bit 2
LCD RS on PORTA bit 3
Procedures called by global
Procedures that call global
To Index
- MAIN
- INIT
- LCDINIT
- DLY2
- LCDWRITENIBBLE
- LCDPUTI
- UPDATEDISPLAY
- LCDCLS
- ASSIGNCSTRING16
- STR
- LCDPUTS
- WAITFORBUTTON
User Procedures
Library Procedures
Initialize the LCD module. The following variables MUST be defined
in their proper places before using these routines
- LCD_D4, LCD_D4_DIR
- LCD_D5, LCD_D5_DIR
- LCD_D6, LCD_D6_DIR
- LCD_D7, LCD_D7_DIR
- LCD_E, LCD_E_DIR
- LCD_RW, LCD_RW_DIR
- LCD_RS, LCD_RS_DIR
| Size in Bytes: | 134 |
| Number of Parameters: | 0 |
| Local Variables: | 0 |
| Deepest Stack Level: | 2 |
Procedures called by LCDINIT
- DLY2
- LCDWRITENIBBLE
- LCDPUTI
Procedures that call LCDINIT
To Index
Write a nibble to the LCD module.
| Size in Bytes: | 58 |
| Number of Parameters: | 1 |
| Local Variables: | 1 |
| Deepest Stack Level: | 5 |
Parameters:
| Name | Type | Description |
| WREG | UBYTE | Write the upper 4 bits of this parameter to the LCD |
Procedures that call LCDWRITENIBBLE
To Index
Write a Byte To the LCD
| Size in Bytes: | 26 |
| Number of Parameters: | 1 |
| Local Variables: | 1 |
| Deepest Stack Level: | 4 |
Parameters:
| Name | Type | Description |
| WREG | UBYTE | Write this value To the LCD module |
Procedures called by LCDWRITE
Procedures that call LCDWRITE
To Index
Read a byte from the LCD module
| Size in Bytes: | 124 |
| Number of Parameters: | 0 |
| Local Variables: | 1 |
| Deepest Stack Level: | 5 |
Return Variables:
| Name | Type | Description |
| RET | UBYTE | The byte read from the LCD module |
Procedures that call LCDREAD
To Index
Wait on the last command to finish executing on the LCD
| Size in Bytes: | 24 |
| Number of Parameters: | 0 |
| Local Variables: | 1 |
| Deepest Stack Level: | 4 |
Procedures called by LCDWAIT
Procedures that call LCDWAIT
To Index
Display a character on the LCD
| Size in Bytes: | 12 |
| Number of Parameters: | 1 |
| Local Variables: | 0 |
| Deepest Stack Level: | 3 |
Parameters:
| Name | Type | Description |
| WREG | UBYTE | The value to displayed on the LCD |
Procedures called by LCDPUTC
Procedures that call LCDPUTC
To Index
Write an instruction to the LCD
| Size in Bytes: | 12 |
| Number of Parameters: | 1 |
| Local Variables: | 0 |
| Deepest Stack Level: | 3 |
Parameters:
| Name | Type | Description |
| WREG | UBYTE | The instruction to send to the LCD |
Procedures called by LCDPUTI
Procedures that call LCDPUTI
- LCDINIT
- LCDCLS
- LCDLINE1
- LCDLINE2
- LCDLINE3
- LCDLINE4
- LCDPOS
To Index
Display a string on the LCD
| Size in Bytes: | 26 |
| Number of Parameters: | 1 |
| Local Variables: | 0 |
| Deepest Stack Level: | 2 |
Parameters:
| Name | Type | Description |
| S | STRING | The string to displayed on the LCD |
Procedures called by LCDPUTS
Procedures that call LCDPUTS
To Index
Clear the LCD display
| Size in Bytes: | 8 |
| Number of Parameters: | 0 |
| Local Variables: | 0 |
| Deepest Stack Level: | 2 |
Procedures called by LCDCLS
Procedures that call LCDCLS
To Index
| Size in Bytes: | 94 |
| Number of Parameters: | 3 |
| Local Variables: | 4 |
| Deepest Stack Level: | 1 |
Parameters:
| Name | Type | Description |
| PORT | UINTEGER | ? |
| PIN | UBYTE | ? |
| WREG | UBYTE | ? |
Procedures called by WAITFORBUTTON
Procedures that call WAITFORBUTTON
To Index
| Size in Bytes: | 72 |
| Number of Parameters: | 2 |
| Local Variables: | 5 |
| Deepest Stack Level: | 2 |
Parameters:
| Name | Type | Description |
| PORT | UINTEGER | ? |
| WREG | UBYTE | ? |
Return Variables:
| Name | Type | Description |
| RET | UBYTE | ? |
Procedures called by ISBUTTONHIGH
Procedures that call ISBUTTONHIGH
To Index
| Size in Bytes: | 74 |
| Number of Parameters: | 2 |
| Local Variables: | 5 |
| Deepest Stack Level: | 2 |
Parameters:
| Name | Type | Description |
| PORT | UINTEGER | ? |
| WREG | UBYTE | ? |
Return Variables:
| Name | Type | Description |
| RET | UBYTE | ? |
Procedures called by ISBUTTONLOW
Procedures that call ISBUTTONLOW
To Index
| Size in Bytes: | 32 |
| Number of Parameters: | 2 |
| Local Variables: | 2 |
| Deepest Stack Level: | 3 |
Parameters:
| Name | Type | Description |
| PORT | UINTEGER | ? |
| WREG | UBYTE | ? |
Return Variables:
| Name | Type | Description |
| WREG | UBYTE | ? |
Procedures called by CREATEMASK
Procedures that call CREATEMASK
To Index
| Size in Bytes: | 56 |
| Number of Parameters: | 0 |
| Local Variables: | 0 |
| Deepest Stack Level: | 0 |
Procedures called by MAIN
- INIT
- UPDATEDISPLAY
- WAITFORBUTTON
To Index
Update the LCD display
| Size in Bytes: | 95 |
| Number of Parameters: | 0 |
| Local Variables: | 2 |
| Deepest Stack Level: | 1 |
Local Variables:
| Name | Type | Description |
| S | STRING | Temporary string |
Procedures called by UPDATEDISPLAY
- LCDCLS
- ASSIGNCSTRING16
- STR
- LCDPUTS
Procedures that call UPDATEDISPLAY
To Index
Initialize hardware and software
ADC Configuration
=================
Processor: 18F452
Fosc: Fosc/32
Channel: 0
ADC: ON
Justify: Right
Analog Channels: AN0
Digital Channels: AN1,AN2,AN3,AN4,AN5,AN6,AN7
Verf+: Vdd
Vref-: Vss
| Size in Bytes: | 18 |
| Number of Parameters: | 0 |
| Local Variables: | 0 |
| Deepest Stack Level: | 1 |
Procedures called by INIT
Procedures that call INIT
To Index
| Size in Bytes: | 124 |
| Number of Parameters: | 2 |
| Local Variables: | 0 |
| Deepest Stack Level: | 2 |
Parameters:
| Name | Type | Description |
| BIN | ULONG | ? |
| S | STRING | ? |
Procedures called by STR
Procedures that call STR
To Index
| Size in Bytes: | 78 |
| Number of Parameters: | 1 |
| Local Variables: | 2 |
| Deepest Stack Level: | 3 |
Parameters:
| Name | Type | Description |
| S | STRING | ? |
Procedures that call BCD2A
To Index
| Size in Bytes: | 108 |
| Number of Parameters: | 2 |
| Local Variables: | 3 |
| Deepest Stack Level: | 3 |
Parameters:
| Name | Type | Description |
| BIN | ULONG | ? |
| S | STRING | ? |
Procedures that call B2BCD
To Index
| Size in Bytes: | 34 |
| Number of Parameters: | 0 |
| Local Variables: | 0 |
| Deepest Stack Level: | 2 |
Procedures that call ASSIGNCSTRING16
To Index
| Size in Bytes: | 24 |
| Number of Parameters: | 2 |
| Local Variables: | 0 |
| Deepest Stack Level: | 3 |
Parameters:
| Name | Type | Description |
| D1 | UBYTE | ? |
| D2 | UBYTE | ? |
Procedures that call DLY2
- LCDINIT
- ISBUTTONHIGH
- ISBUTTONLOW
To Index
| Size in Bytes: | 14 |
| Number of Parameters: | 2 |
| Local Variables: | 1 |
| Deepest Stack Level: | 4 |
Parameters:
| Name | Type | Description |
| VAL | UBYTE | ? |
| WREG | UBYTE | ? |
Return Variables:
| Name | Type | Description |
| WREG | UBYTE | ? |
Procedures that call LSL1
To Index