The first example is real-time-clock and temperature. This example uses several pre-build routines, and call each routine in sequence. Those subroutines include time delay, LCD display and temperature reading routines.
You can download this RTCnTMP.HEX file, and program SSE8680 evaluation board with this HEX file via ICD2. When the HEX is programmed, disconnect ICD2 cable from SSE8680. The LCD display will show current time. If you press push button S7, the LCD will show current temperature.
The pin connection is listed on SSE8680 page. In order to use on-board LCD display, some steps need to be done prior to send character to LCD display.
|
Command |
HEX Code | Execution Time |
| Clear Display, Cursor to Home | 0x01 | 1.64 ms |
| Cursor to Home | 0x02 | 1.64ms |
| Cursor decrement, Shift Off | 0x04 | 40us |
| Cursor decrement, Shift On | 0x05 | 40us |
| Cursor Increment, Shift Off | 0x06 | 40us |
| Cursor Increment, Shift On | 0x07 | 40us |
| Display, Cursor, and Cursor Blink Off | 0x08 | 40us |
| Display On, Cursor and Cursor Blink Off | 0x0C | 40us |
| Display and Cursor On, Cursor Blink Off | 0x0E | 40us |
| Display, Cursor, and Cursor Blink On | 0x0F | 40us |
| Cursor Shift Left | 0x10 | 40us |
| Cursor Shift Right | 0x14 | 40us |
| Display Shift Left | 0x18 | 40us |
| Display shift Right | 0x1C | 40us |
| 2x20 Size | 0x3C | 40us |

Download LCD8680 ZIP file
Tc72 is a SPI compatible temperature sensor. The pin connection is listed on SSE8680 page. The functions of this example are control register modifying , temperature reading and manufacture ID reading. When the power is applied to SSE8680, control register needs to need set to conversion mode prior to read the data.
| Register | Read address | Write Address | Value on POR/BOR |
| Control | 0x00 | 0x80 | 0x05 |
| LSB Temperature | 0x01 | N/A | 0x00 |
| MSB Temperature | 0x02 | N/A | 0x00 |
| Manufacture ID | 0x03 | N/A | 0x54 |
PIC18F8680 provides 16 10-bit resolution analog to digital converter channels. This program demonstrate how to set up ADC registers and display the result on LEDs. The LEDs are connected PORTD, and analog signal is connected RA0. A 5 Kohm potentiometer provides voltage from 0v to Vcc, and the reference voltage is connected Vcc and ground. The following steps lead you to set up the ADC registers.
¡@
¡@
¡@
¡@
¡@