Peptu Help



PIC Code
The PIC code has no need for any user interaction, all that is required is that it is programmed into a 20Mhz PIC 16F873.



PC Based Code
The PC based code, Peptu.exe, on the other hand does require some user input in order to get the hardware working correctly. There are three areas where user input is required:

  • Setting port, module size, cursor, wrap and scroll
  • Selecting the bootstrap display options
  • Creating, saving and loading the bootstrap display

Additionally users can:

  • Read the hardware build level information
  • Read the PIC firmware build / rep level information
  • Read the Peptu.exe software build / rep level information
  • Do a basic test of operability of the LCD interface
  • Clear the LCD display
  • Reset the PIC
  • Access Help information

LCD Module Setup
When the hardware is installed it mut be set up to match the LCD module that it drives. The interface has been tested with 16 x 2, 20 x 2, 16 x 4 and 20 x 4 modules as well as a variety of serial ports. It is probable that when the driver software is installed the setting for the USB module will be set to COM4. Full details of the installation of the USB driver can be found "here".

INSERT FTDI SETTING DETAILS

The 'look and feel' of the Peptu.exe can be seen below.


From this it can be seen that the user accesses the drop-down lists to select the required parameter(s).

The following images show the available options.




The user can also click the wrap and / or scroll check boxes. The use of these options will be covered fully in a later section. After the user has set the desired options the 'Accept Parameters' button is pressed to send the options to the hardware module where it is stored into EEPROM. On each subsequent occasion that the system is re-initialised (system reboot / reload or user presses the 'Reboot' button on the Peptu screen) this data will be used to set the hardware operating conditions. If the user selects an incorrect port an error message will be presented and the software will shut down.


Bootstrap Options
The picture below show the available bootstrap options.


From this it can be seen that there are three options.

  • The first option clears the screen and awaits the arrival of data from the PC.
  • The second option is to present the default screen, the Peptu copyright screen. This is presented as the PC is being booted / reloaded and remains visible until an application sends data to the LCD.
  • The third option is to present a user defined screen at boot / reload time that remains visible until an application sends data to the LCD.

After making the required selection the 'Accept Option' button is pressed to send the data to the hardware module where it is placed into EEPROM. On each subsequent occasion that the system is re-initialised (system reboot / reload or user presses the 'Reboot' button on the Peptu screen) this data will be used to set the bootstrap option.

User Generated Bootstrap Display Feature

The User can:

  • Create / modify a user display
  • Save display details to filestore
  • Load existing display from filestore
  • Show the currently active user display
  • Send display to hardware

The user initiates the creation of a new user display by pressing the 'Create & Update' button which results in the following screen being presented:


Note that the display will be adjusted to reflect the number of rows defined in the previous steps, in the example this is a 16 x 2 display. The user then creates the desired user defined character(s) by clicking the appropriate pixel positions. One click sets the pixel and a second click resets it. An example of a user defined display is shown below, note that this time it is for a 4 row display.


After creating each individual image the user must press the 'Save' button, if this is not done the image will be lost. The act of pressing the save button saves the approriate character to EEPROM and it becomes immediately avaialble whenever that user defined character is included in a display. It will become the 'default' user defined character for that character nunber. Please note that the characters are numbered as 1 - 8 but as far as use is concerned they are 0 - 7. (I will 'fix' this problem in the next release!)


To create a bootstrap display using the created images the user just types the required message into 'Row Data' boxes and whenever a user defined character is required the appropriate character number field should be dragged and dropped into the required Row Data box. Note that when this is undertaken a 'graphic' will be inserted into the 'Row Data' box that does not match that created. (This effect occurs because the application software does not understand user defined characters and just uses the approriate characted from the font in use by the application, i.e. the MS Windows Terminal font character set) However, the Vitual LCD display does show the appropriate character so the actual display being created can readily be seen. (Again this is an issue that will be addressd in the next release). The user then presses the 'Send All To EEPROM' button and the display becomes the 'active' user defined bootstrap display. All that the user has to do to activate it is select the boot display option 'Display user defined screen & await first character' and press the 'Accept Option' button. At the next re-load of the system that message will be displayed whilst ths system is loading. If it is required to see what the display will actually look like on the physical LCD then user should press the 'Show on LCD' button whiach has the ation of moving the data shown on the virtual LCD display to the actual LCD. If required to test that the data has been safely stored in the EEPROM then it can be undertaken by pressing the 'Reboot' button which forces a reboot of the Peptu hardware.

Having created your 'masterpiece' and sent it to the EEPROM means that it becomes the default boot display. However, users might wish to have more than one boot display from which they can select the one they wish to run at any particular time. For example under normal conditions one message might be displayed but at a Lan party another etc. This is possible as when the display has been created, tested and sent to the EEPROM it can also be saved to filestore. To save the UDCs to filestore first create and test as outlined above then press the 'Close' button on the 'Display Generation' screen which closes that display and presents the PEPTU LCD display again. Now press the 'Save To' button and a display similar to that below will be presented:


This allows the user to name the file and select the folder to which the file is to be stored. As an example you could have files called normal.par which is the default but have another called lanparty.par which is set to be the default for the duration of a lan party. To select an alternative to the currently active display press the 'Load From' button. That will present the user with the file selection display shown above enabling the required file to be loaded. When the file is loaded the display changes to the 'Display Generation' screen and the desired user defined character grahics become visible. In order for that selecction to become the default all that is required is to press the 'Send All to Eprom' button as covered above.

The other buttons should all be self explanatory but a special mention needs to be made about the 'Reboot' button's action. When this button is pressed it resets the Peptu hardware interface but sometimes it will / may not work. The reason for this is that if some 'glitch' occurs whilst the PC is sending a coomand sequence the controller will be sitting awaiting the completion of the command sequence and under those circumstances the controller will not realise that a reset command sequence has been sent. However, repeated pressing of the 'reset', will eventually mean that the controller does see a request to rest itself and the normal reboot sequence will occur.
As an example in order to generate a user defined character the PC must send 10 bytes; the code for a UDC operation the UDC number and 8 data bytes. As soon as the controller detects the UDC operation byte it will enter a loop awaiting a further 9 bytes and if the 'glitch' occurs after only 6 of the data bytes have been sent then the next two bytes received are treated as data and not tested for command activity. The action of pressing the 'Reboot' button it to send two bytes to the controller so the first press of the button will be ignored but the second will be detected and acted upon. To date I have not had an instance when I have NEEDED to press the reset button but have frequently used it to reboot after switching boot displays and / or boot display options.

Information Screen

The 'About' button is used to provide the current hardware setting details together with the hardware and software build / rep levels and typically looks as shown below:


The information displayed is recovered from the EEPROM on the Peptu interface and reflects the current settings being used by the Peptu controller. In this case it shows that the LCD module in use is a 16 x 2 module with Scroll set to Off, Wrap set to Off, Cursor set to Off and a boot display option of 'Display Peptu Screen & Wait' set. It also shows that the hardware build level is 3 and dated 16.6.2004, that the PC based 'Hardware Setup and Boot Control' software version is 1.0.0 and that the PIC code is version 1.0 with no patches applied.


Compatibilty with Crystafontz 632 / 634 Modules

In the Design Aims section I stated that the design aim was to emulate the Crystalfontz units with the following exceptions:

  • No inverting block cursor (Cf code \007)
  • Modified Boot Screen control (Cf Code \009)
  • No software control of back light or contrast (Cf codes \014 and 015)
  • No scrolling marque capability (Cf codes \021 and \022)
  • Only the 3x4 Large Block Number set (Cf code \028)
  • Modified Show Information Screen (Cf code \031)

With benefit of experience of using the system I have also decided not to implement the direct write to the LCD controller function (Cf code \030).
Below is a list of all implemented command codes (Note: all codes are in decimal).

Command Code Action
00 Null Action
01 Cursor Home
02 Hide Display
03 Restore Display
04 Cursor Off
05 Underline Cursor On
06 Block Curson On
07 Null Action
08 Backspace and Overwrite
09 Boot Screen Options (see later section)
10 Line Feed
11 Delete Character At Cursor Poition
12 Clear the Display
13 Carriage Return
14 Null Action
15 Null Action
16 Null Action
17 Set Cursor Column and Row
18 Horizontal Bar Graph
19 Scroll On
20 Scroll Off
21 Null Action
22 Null Action
23 Wrap On
24 Wrap Off
25 Set User Defined Character
26 Reboot
27 Escape Sequence
28 Large Block Characters
29 Null Action
30 Null Action
31 Pass EEPROM content to PC

Additional information for all implemented command codes can be found here