Home

Connecting an LCD or VFD to the PiXi (2.0)

image

Contents

1. cable typically cut shorter than 30cm e g RS 289 9852 or Farnell 297290 When assembling the ribbon cable into the 2x8 way socket that goes at the PiXi end of the cable assembly care should be taken to ensure that the coloured strand of the cable indicating terminal 1 is connected to terminal 1of the socket Terminals 15 amp 16 of the 2x8 way socket should have no connection in this case Similarly the coloured strand should connect to pin 1 of the connector that goes at the display end of the cable assembly Pins 17 amp 18 of the GPIO3 connector on the PiXi need to be cut off so that a shorter 2x8 terminal IDC socket can be plugged on to the GPIO3 header These pins are not connected to anything on the board so this does not damage the functionality of the PiXi If a shorter 2x7 terminal socket is used at the PiXi end of the cable then pins 15 amp 16 need to be cut off Note however that by cutting off these pins the GPIO3 header will no longer be able to provide power to a backlight If the display module doesn t have a header fitted then one should be fitted For a 2x7 way header RS 473 8355 or Farnell 2310055 may be suitable or for a 2x8 way header RS 473 8276 or Farnell 2308473 may be suitable Figure 6 Completed LCD VFD cable assembly Astro Designs Ltd Registered Office Marlborough UK ANO004 DOC 07 04 2014 AN 004 v1 0 Connecting an LCD or VFD to the Pixi 2 0 Page 7 of 9 Using the Display The PiXi FPGA
2. includes an interface that allows the display to be configured and written to using the SPI interface from the Raspberry Pi The FPGA also has the ability to initialise the display and write an initial message to the display immediately after the FPGA has been configured however this initialisation function is designed into the FPGA and can therefore only be modified by changing the FPGA design There is an example of how to do this in application note AN 003 FPGA Development on the PixXi The default initial message looks like this PiXi FPGA V hhmmssDDMMYY hhmmssDDMMYY describes the design signature for the FPGA which is based on the time amp date at which the installed design was last changed Character graphics amp configuration data can be written to the display by performing a single write over the Raspberry Pi s SPI interface The PiXi Tools libraries which can be downloaded from www astro designs com provide a simple SPI read write function that can be executed from the command line which can be used to configure the display and write text and potentially graphic data to the display Other SPI interface routines may also be used More information on the PiXi Tools package can be found in AN 020 Installing PiXi Tools on the Raspberry Pi In this example PiXi Tools is used to communicate with the display The full register map for the SPI interface on the PiXi FPGA can be found in AN 025 however for the purpose of using the L
3. AN 004 v1 0 Connecting an LCD or VFD to the PiXi 2 0 Page 1 of 9 Application Note AN 004 v1 0 Connecting an LCD or VFD to the PiXi 2 0 Summary The PiXi add on board is designed to expand the general purpose I O capabilities of the Raspberry Pi and provide a low cost means of introducing the user to the world of digital electronics and FPGA technology as well as giving the Pi Enthusiast a few more features to play with The low product cost and feature packed specification of the PiXi makes it ideal for applications in computing hobby electronics education training and product development This application note explains how to quickly connect a simple 16 character x 2 line or similar LCD or Vacuum Fluorescent Display VFD to the PiXi and use the Raspberry Pi to write text to the display Astro Designs Ltd Registered Office Marlborough UK ANO004 DOC 07 04 2014 AN 004 v1 0 Connecting an LCD or VFD to the PiXi 2 0 Page 2 of 9 Figure 1 A Vacuum Fluorescent Display connected to the prototype PiXi One of the initial design requirements of the PiXi was that it should be relatively easy to connect an LCD or Vacuum Fluorescent Display VFD to one of the GPIO ports so that the user can quickly use the Raspberry Pi to write text messages to a display There are a large number of small low cost LCD amp VFD modules available of varying formats e g 16 character x 2 line 40 character x 2 line Figure 1 shows
4. CD display interface only four registers are needed Register Map The standard FPGA on the PiXi provides two register mapped control amp status registers for the LCD VFD interface which can be accessed through the SPI interface on the Raspberry Pi Two further registers are needed to setup the operating mode of the GPIO3 port The display interface can be accessed over SPI at the following addresses Address Read Write Register Function 0x25 37 W GPIO3 Port Configuration Register 0x26 38 W GPIO3 Port Configuration Register 0x38 56 W LCD VFD Control amp Data Register 0x39 57 W LCD VFD Configuration Register GPIO3 Port Configuration Register Bit s Function 0x25 15 0 GPIO3 bits 7 0 function select 0x26 31 16 GPIO3 bits 15 8 function select LCD VFD Control amp Data Register Bit s Function 7 0 LCD Data 8 RS Astro Designs Ltd Registered Office Marlborough UK AN004 DOC 07 04 2014 AN 004 v1 0 Connecting an LCD or VFD to the Pixi 2 0 Page 8 of 9 LCD VFD Configuration Register Bit s Function 7 0 Not used 8 PIN_SWAP Set this bit to swap odd even pin functions 15 9 Not used The GPIO3 port can operate in several modes Each bit can be separately configured as input output or a number of special functions The LCD VFD interface mode is one of the special functions The GPIO3 Port Configurat
5. a typical 2 line x 80 character vacuum fluorescent display connected to the PiXi using an IDC cable and two IDC sockets The interfaces to these modules can vary widely typically including parallel asynchronous serial SPI amp I2C interfaces The LCD interface supported by the PiXi is the parallel interface as it is one of the most widely available interfaces found on these modules This is not to say that LCD or VFD modules with SPI 12C or other serial interfaces cannot be used with the PiXi in fact they can be used relatively easily but this example focuses on the parallel interface variety The parallel interface tends to have two basic physical variations as illustrated in Figure 2 one of which has the interface connected arranged as two rows of seven pins the other is arranged as one row by fourteen pins There are also extensions to these formats that use two extra pins pins 15 amp 16 to provide power to an LED back light Astro Designs Ltd Registered Office Marlborough UK ANO004 DOC 07 04 2014 AN 004 v1 0 Connecting an LCD or VFD to the PiXi 2 0 Page 3 of 9 TT 90800000000000 occoo 8600 a 00000000000000 Sseseedesesd 1 a85 Figure 2 Aselection of LCD amp VFD modules with parallel interfaces The format that is supported in this example is the 2 rows x 7 pins with the option of supporting two additional pins pins 15 amp 16 that can provide power to an LED backlight Important note It s worth no
6. fice Marlborough UK AN004 DOC 07 04 2014 AN 004 v1 0 Connecting an LCD or VFD to the PiXi 2 0 Page 5 of 9 display module end of the cable could be changed to a header with a socket fitted to the display module Remove these pins to allow 2x8 socket to fit GPIO3 2x13 2x7 2x8 Socket Socket l4eway cable with terminal aligned to pin of 2x8 socket 16x2 LCD Display 2x7 socket connects to underside of display 2x7 header mounted on under side of display s 2x Socket Terminals 15 26 seperated from terminals 1 14 Figure 4 Some examples of how to connect an LCD to the PiXi Cut these two pins to allow a Cut these two pins to allow a 2x8 way socket to be used 2x7 way socket to be used Note In doing this the back light power function will be permanently disabled Figure 5 Removing pins from the GPIO3 to allow a smaller connector to be fitted Astro Designs Ltd Registered Office Marlborough UK ANO004 DOC 07 04 2014 AN 004 v1 0 Connecting an LCD or VFD to the PiXi 2 0 Page 6 of 9 For this example a 2x8 way IDC socket is fitted at the PiXi end of the cable and a 2x7 way IDC socket is fitted to the display end of the cable The following parts can be used to make such a cable 1 1x 2x8 terminal IDC socket e g RS 192 7467 or Farnell 3003590 2 1x 2x7 terminal IDC socket e g RS 192 7451 or Farnell 3003589 3 1 length of 0 05 pitch 14 way ribbon
7. ion Register needs be set to a fixed value of OxOO000AAAA to select this mode where register 0x26 should be set to 0x0000 and 0x25 should be set to OxAAAA This value configures all 16 bits of the GPIO3 port to the LCD VFD interface mode however five bits of GPIO3 are not used for the LCD VFD interface mode so these bits could actually be separately configured to be used for another function Once the display is connected the first thing that needs to be done is to setup the GPIO3 port to communicate with the LCD or VFD module The following PiXi Tools commands do this pio spi set 0 0x25 OxAAAA pio spi set 0 0x26 0x0000 A typical LCD display module will require an initialisation string to be sent to it to configure the interface position the cursor or write pointer before any text can be written to the display The datasheet for the LCD module being used will usually describe the configuration codes for the display These can change from one display to another so always check the datasheet for the display that s being used The following example uses PiXi Tools spi set function to send a string of data to an LCD display to configure it prior to writing the first text pio spi set 0 0x38 0x030 pio spi set 0 0x38 0x030 pio spi set 0 0x38 0x030 pio spi set 0 0x38 0x038 pio spi set 0 0x38 0x102 Note that this sets the RS bit to 1 for this command pio spi set 0 0x38 0x00C pio spi set 0 0x38 0x001 pio spi set 0 0x38 0x006 pi
8. nsure that the power is orientated correctly Getting this wrong can cause the power connections to the display module to be reversed which could damage the display module if not detected quickly so it s important to make sure this is right Making up the cable There are a few options for making up the cable Figure 4 illustrates three options for making up the cable The header on the display module is typically arranged as 2x7 whereas the connector at the PiXi end is 2x13 The first option is for a 26 way IDC cable to be used with a 26 way 2x13 socket at one end and a 14 way 2x7 socket at the other end after having peeled a strip of cable containing 14 conductors away from the main cable Or the same connector 2x7 or 2x8 could be fitted at both ends If the latter method is chosen then two of the pins of the GPIO3 header on the PiXi need to be cut off to allow a shorter connector to fit If the 2x8 way connector is used then the pins that need to be cut off pins 17 amp 18 are not used and have no signals on them so there is no loss in functionality in removing these pins If the 2x7 way connector is fitted then the two pins that need to be cut off pins 15 amp 16 normally provide power to the back light if used For this reason it is recommended that a 2x8 way socket is fitted at the PiXi end of the cable and a 2x7 way connector is fitted at the display end As a further alternative the connector at the Astro Designs Ltd Registered Of
9. o spi set 0 0x38 0x002 And to write a message to the display pio spi set 0 0x38 0x048 H pio spi set 0 0x38 0x045 E pio spi set 0 0x38 0x04C L pio spi set 0 0x38 0x04C L pio spi set 0 0x38 Ox04F O pio spi set 0 0x38 0x020 pio spi set 0 0x38 0x057 W pio spi set 0 0x38 Ox04F O pio spi set 0 0x38 0x052 R pio spi set 0 0x38 0x04C L pio spi set 0 0x38 0x044 D L L Astro Designs Ltd Registered Office Marlborough UK AN004 DOC 07 04 2014 AN 004 v1 0 Connecting an LCD or VFD to the Pixi 2 0 Page 9 of 9 pio spi set 0 0x38 0x021 If all went well then the display should show HELLO WORLD PiXi Tools also provides a more convenient way of writing to a display The following command writes PiXi Tools to the display pio Icd init pio Icd write PiXi Tools Or to print a message at an particular x y position on the display the following command positions the same message in the centre of the first line of a 16 character wide display pio Icd print 0 3 PiXi Tools Further Reading The PiXi User Manual UM 002 has complete information on the pin functions for GPIO3 and other interfaces on the PiXi If you want to learn more about programming the FPGA on the PixXi to customise the welcome message please take a look at application notes AN 002 Programming the FPGA on the PiXi and AN 003 FPGA Development on the Pixi PiXi Tools is described in more detail in applica
10. ting at this point that there is at least one other variation of this interface format where the two pins used to provide power to the display module are reversed while the remaining pins remain identical Please check the power connections for any LCD or VFD module are compatible with this interface before connecting the module It s also worth noting that this variation can still be used with the PiXi with a fairly simple modification Simply fitting the header on the display module to the opposite side of the circuit board effectively swaps the odd amp even pins on the connector thereby reversing the power and ground connections This also swaps the data pins too but this can be compensated for by setting a bit in the LCD control amp data register which swaps these signals back within the FPGA Astro Designs Ltd Registered Office Marlborough UK ANO004 DOC 07 04 2014 AN 004 v1 0 Connecting an LCD or VFD to the PiXi 2 0 Page 4 of 9 Terminal 1 GPIO3 V l4 way cable with terminal aligned to pin of 2x8 socket 16x2 LCD Display Viewed from top 2x7 socket connects to underside of display Pin 1 GPIO3_ V Pin 2 GND 2x7 header mounted on under side of display Figure 3 Location of the power connections on the PiXi and various LCD modules The only customisation that might be required is that the 2x7 pin header on the display module usually needs to be fitted on the underside of the board to e
11. tion note AN 020 Installing PiXi Tools on the Raspberry Pi The full register map for the PiXi can be found in application note AN 025 PiXi SPI amp I2C Register Map All of these documents are available for download from www astro designs com Acknowledgements Raspberry Pi is a trademark of the Raspberry Pi Foundation Astro Designs Ltd Registered Office Marlborough UK AN004 DOC 07 04 2014

Download Pdf Manuals

image

Related Search

Related Contents

11-2 Drucken unter Windows  Sennheiser IE 8i  No. 29 'Choreographing Cycling Anims' in SwanQuake - C-DaRE  PA-818B (Model 7711/7712 User`s Guide)  InFocus 760 User's Manual    DN1700E(Rev.A 以降) 取扱説明書  防水パン取扱説明書 [更新済み]  User`s Manual - WAN Computers  ドーム型 HD-SDI カメラ SDC  

Copyright © All rights reserved.
Failed to retrieve file