Nxp jul1311

3,942 views

Published on

Published in: Design, Technology, Business
0 Comments
2 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
3,942
On SlideShare
0
From Embeds
0
Number of Embeds
293
Actions
Shares
0
Downloads
69
Comments
0
Likes
2
Embeds 0
No embeds

No notes for slide

Nxp jul1311

  1. 1. Designing LCD applications with NXPARM Cortex-M3 LPC1788Kenneth Dwyer, eeTimes Webinar, July 13th, 2011 1
  2. 2. Agenda NXP and LPC1788 Introduction LCD Terminology and Technologies LCD Interface and signals NXP Microcontrollers with LCD interface System Issues to consider LCD Software and Tools 3rd Party LCD Software Support LPCZone and Training Q&A 2
  3. 3. NXP is a leader in ARM Flash MCUs Clear strategy: 100% focus on ARM Top performance through leading technology & architecture Design flexibility through pin- and software-compatible solutions – Scalable memory sizes – Widest range of peripherals Unlimited choice through complete families for multiple cores 3
  4. 4. NXP MCU – the only complete ARM range ofCortex-M0, Cortex-M3 and Cortex-M4 processors NXP ARM Cortex-M ContinuumEntry level Fully featuredCortex-M0 Cortex-M4 $0.65* Cortex-M0 Cortex-M3 Cortex-M4 $7.00* True 8/16-bit High performance for Advanced Digital replacement communication and Signal control - low power, low cost, control - Floating point unit more performance - LCD, USB, Ethernet, - Dual-core options CAN and much more Over 250 different ARM based microcontrollers available!! (* Recommended price at 10kpcs) 4
  5. 5. Bringing LCD graphics to Cortex-M3LPC178X 5
  6. 6. Bridging Cortex-M3 and ARM7LPC1700 Cortex-M3 MCUs are pin-compatible to NXP ARM7 MCUsallowing easy project migration – LPC178x is pin-compatible to the LPC247x series – LPC177x is pin-compatible to the LPC246x, LPC245x and LPC238x series – LPC176x is pin-compatible to the LPC236x series 6
  7. 7. LPC178x seriesCortex-M3 performance @ 120MHz Up to 512 kB on-chip flash memoryMaximum bandwidth for Up to 4 kB on-chip USB and Ethernet EEPROMcommunication becauseof unique matrix bus and Up to 96 kB on-chip SRAM flexible SRAM implementation 32-bit full External New NXP USART with Memory Interface support for Smart Card Interface First Cortex-M3 with full New NXP Event Recorder LCD graphics controller in RTC domain for anti- tampering protectionSee web: http://ics.nxp.com/products/lpc1000/lpc17xx/ 7
  8. 8. LPC177x & LPC178x Features ARM Cortex-M3 Core Analog Peripherals – 120 MHz operation – 12-bit ADC with 8 channels (400 ksps) – Nested Vectored Interrupt Controller (NVIC) – 10-bit digital-to-analog converter – Wakeup interrupt controller – Memory Protection Unit Other Peripherals – CRC Calculation engine – LCD controller (LPC178x) – Up to 32-bit External Memory Controller Memories – Low Power Real-time clock – Up to 512 kB Flash memory – Event recorder – Up to 96 kB SRAM (3 blocks) – Eight-channel, general-purpose DMA – Up to 4 kB EEPROM – Up to 165 GPIO Serial Peripherals – Motor control PWM – 10/100 Ethernet MAC – Quadrature encoder interface – USB 2.0 full-speed device/host/OTG – Four 32-bit timers/counters – Four UARTs + one USART – 12 MHz internal RC oscillator trimmed to – Two CAN 2.0B controllers 1% accuracy – Three SSP/SPI controllers – Three I2C (one with FM+) – SD/MMC – I2S interface 8
  9. 9. LPC178x Four parts in the family support LCD 9
  10. 10. Target application for LPC177x / LPC178xNXP Cortex-M3 design-wins in multiple applications Point-of-sale PLC HMI / Home-display Car Alarms terminals And many other And many other And many other And many other communications industrial/medical consumer / appliance transportation applications, e.g.: applications, e.g.: applications, e.g.: applications, e.g.: - Web server - HVAC - Audio - Aftermarket - Multi-protocol - security monitoring - Alarm systems - GPS/Fleet bridge - video intercom - Scanners management - circuit breakers - Small appliances 10
  11. 11. LCD Terminology and Technologies 11
  12. 12. Resolution and Color Depth Resolution is not measured in inches! – QVGA 320 X 240 – VGA 640 x 480 – SVGA 800 X 600 – Landscape or portrait orientation Color depth or bits per pixel (bpp) 12
  13. 13. What is a Frame Buffer? Contiguous memory buffer containing a complete frame of data Consists of color values for every pixel – For QVGA with 16 bpp color => 240 x 320 x 2 = 150kB of RAM Color values are commonly represented as – 1 bit (1 bpp): Monochrome – 2 bit (2 bpp): Palette based (4 colors) – 4 bit (4 bpp): Palette (16 colors, controller has a palette look-up table) – 8 bit (8 bpp): Palette (256 colors, controller has a palette look-up table) – 16 bit (16 bpp): High color format (5:5:5 - 32,768 colors; 5:6:5 - 65,536 colors) – 24 bit (24 bpp): True color format (16,777,216 colors) 13
  14. 14. Palette Based Frame Buffer The frame buffer will contain an index value for each pixel Palette RAM is pre-filled with 16-bit color value for each index Framebuffer Palette Image NXP microcontrollers have 256 entries to support – 1, 2, 4, or 8 bpp palletized color displays for color STN and TFT – 1, 2, or 4 bits-per-pixel (bpp) palletized displays for mono STN 14
  15. 15. LCD panel Technologies – STN and TFT STN (Super-Twisted Nematic) – Slower response compared to TFT technologies – Lower cost and power than TFT – Variations include Color STN (CSTN) and Dual STN (DSTN) – STN displays only turn segments on and off TFT (Thin-Film transistor) – Fast response – Higher cost than STN, Uses more power than STN – Variations include Advanced TFT (ADTFT) and Highly Reflective TFT (HRTFT) 15
  16. 16. LCD Clocked STN Element 0, 3 RGB elements Element 959, line 0 make 1 pixel line 0 320x240 CSTN display R G B R G B R G B R G B R G B Element 3, line 239 R G B R G B R G B With a 4-bit CSTN display, a clock of data will drive 4 elements, or 1-1/3 pixels. It will take 240 clocks to D0 D1 D2 D3 drive all the data for a 320 pixel line. 16
  17. 17. LCD Clocked TFT Pixel 0 (16 bits), Pixel 319, line 0 line 0 320x240 TFT display RGB RGB RGB RGB RGB RGBPixel 1, line 239 RGB RGB RGB With a 18-bit TFT display, a clock of data will drive 1 pixel. It will take 320 clocks to drive all the data for a R5...R0 G5...G0 B5...B0 320 pixel line. 17
  18. 18. LCD Interface and signals 18
  19. 19. Driving a clocked LCD bus VSYNC/FP HSYNC/LP Pixel clock Data lines Host MCU LCD panel PWM Backlight Constant current source 19
  20. 20. Refresh Rate REFRESH_RATE (Hz) = pixel_clock_rate / [(vertical_resolution + vertical_front_porch + vertical_back_porch) * (pixel_clocks_per_data_line + horizontal_front_porch + horizontal_back_porch))] Example : – 6.5MHz pixel clock – vertical resolution=240 lines, – vertical front porch=5 lines, – vertical back porch=1 line, – pixel clocks per data line = 320 pixels, – horizontal front porch=20 clocks, – horizontal back porch=10 clocks – REFRESH_RATE = 6,500,000 / [(240 + 5 + 1) * (320 + 20 + 10)] = 75.5Hz 20
  21. 21. LCD Signals The largest configuration for the LCD controller uses 31 pins. There are many variants using as few as 10 pins for a monochrome STN panel. 21
  22. 22. LCD STN Signals Single Panel 22
  23. 23. LCD TFT Signals 23
  24. 24. Driving the LCD – various timings VSYNC starts the frame Horizontal front porch timing Vertical back porch timing HSYNC starts at the beginning of each line Vertical front porch timing Horizontal back 320x240 display shown with porch timing timing for VSYNC, HSYNC, clock, and porch values 24
  25. 25. Truly 240 x 320 TFT RGB666 25
  26. 26. Snapshot of incorrect LCD settings 26
  27. 27. LCD – TFT Horizontal Timings 27
  28. 28. LCD – TFT Vertical Timings 28
  29. 29. NXP Microcontrollers with LCDinterfaces 29
  30. 30. NXP Microcontrollers with LCD interfaces Main features of the LCD Controller: – Support for STN Single and Dual and TFT panels – Up to 1024x768 resolution – 24-bit LCD interface supports 24bpp (16M colors) – Palette table allowing display of up to 256 of 64k colors – Adjustable LCD bus size supports various panel bus configurations – Dedicated LCD DMA controller – Hardware cursor support In addition to the LPC1788 the following devices have the same interface: – LPC1850, LPC4300, LPC325x, LPC247x and LH7 devices This helps to significantly to reduce software porting efforts 30
  31. 31. Configuring the LPC1788 LCD Power: In the PCONP register, set the PCLCD bit (0 @ Reset). – Note the LCD power-up sequence Setup the clocks and timing registers Select LCD pins and pin modes via the relevant IOCON registers 31
  32. 32. Dual-CSTN data flow 32
  33. 33. NXP Microcontrollers – TFT data flow 33
  34. 34. System Issues to Consider 34
  35. 35. LPC178x bandwidth calculator http://ics.nxp.com/support/documents/microcontrollers/xls/lpc178x.lcd.bus.load.calculator.xls 35
  36. 36. LCD Tearing Tearing: – Result of LCD DMA unable to service the LCD FIFO in time – Use the FIFO Underflow to monitor for this Workarounds – Change AHB priority – next slide – Slow down frame refresh rate, pixel clock if possible – Use 32-bit wide external memories – Increase the SDRAM clock speed, use faster SRAM – Profile code and move frequently accessed code to internal SRAM 36
  37. 37. LPC1788 LCD AHB Priority AHB Matrix Arbitration register (Matrix_Arb - 0x400F C188) The values used for the various priorities are 3 = highest, 0 = lowest To give priority to the LCD DMA use the value 0x0000 0C09 37
  38. 38. LCD Software and Tools 38
  39. 39. Basic Graphic’s Library - SWIM A free ‘basic’ graphics library – Simple Windows Interface Manager – Basic fonts ASCII characters, 6x7, 6x13, 8x8 – Draw boxes, lines, set colors – Display and scale bitmap images AN10815 – API documentation for SWIM Library – Quick start guide document – IAR, Keil, Rowley, GNU projects for: • LPC3250 Phytec, LPC2478 and LPC1788 EA, LPC1850 Hitex – http://ics.nxp.com/support/documents/microcontrollers/zip/an10815.zip 39
  40. 40. SWIM Code Overview Using SWIM it’s easy to setup the LCD controller 40
  41. 41. LPC Bitmap Converter Utility This tool converts BMP format into C Code format Useful for importing images but uses a lot of memory – not compressed like JPEG or GIF Command line tool Windows 7 compatibility Source code available http://www.lpcware.com/content/nxpfile/bmp-c-image-conversion-utility 41
  42. 42. LPC1788 Boards and IDE’sEvaluation Boards Available Now! Embedded Artists LPC1778/88 (OM13001) – Display panel separate IAR KSDK-LPC1788 FDI uEZ-LPC1788IDEs LPCXpresso ARM/Keil µVision4 CodeRed RedSuite IAR Embedded Workbench for ARM (EWARM)JTAG debuggers All debuggers supporting Cortex-M3 42
  43. 43. Other support material http://ics.nxp.com/support/microcontrollers/lcd/ LPC178x PDL – Peripheral driver library – Software drivers and examples for all peripherals – Includes USB, Ethernet and LCD examples – CMSIS 2.0 Compliant – http://ics.nxp.com/support/documents/microcontrollers/?scope=LPC178x&t ype=software&search=CMSIS http://ics.nxp.com/literature/presentations/microcontrollers/pdf/graphics. lcd.technologies.pdf uClinux Q3/2011 with all the graphics packages it offers – nano-X (formerly microWindows), Qte, directfb BSDL, IBIS Models, Orcad symbols – http://ics.nxp.com/support/models/lpc1000/ 43
  44. 44. Touchscreen AN AN10675 – http://ics.nxp.com/support/documents/microcontrollers/pdf/an10675.pdf – Details on how to utilize the ADC for Touchscreen support – Technique can be easily adapted for other MCUs LPC3250 has dedicated hardware support for resistive touchcreens VREF Resistor which much higher impedance than the touchscreen GPIO1 To ADC1 Y+ Top plate To ADC2 X+ X- GPIO2 GPIO4 Bottom plate Y- GPIO3 44
  45. 45. LPC247x Design Example This illustrates how to connect the following – STN 4-bit B/W QVGA (320 X 240) – TFT 18-bit WVGA (800 X 480) – TFT QVGA (320 X 240) – ADTFT 24-bit QVGA (320 X 240) http://ics.nxp.com/support/design/microcontrollers/lcd.controller/ 45
  46. 46. 3rd party LCD Software Support 46
  47. 47. BlueWater Embedded Prism/Prism-Micro Prism Micro is for lower color depth applications, <= 8bpp (256 colors) It has a smaller footprint than Prism, but it is still C++ API Demo software here: http://www.bwembedded.com/products/prism_target_demos.php 47
  48. 48. FDI uEZGUI-1788 System LPC1788 system running uEZ +FreeRTOS Seiko 7.0” TFT WVGA 800x480 with integrated Touch Screen Rowley Crossworks and JLINK GPL licensed source code http://www.teamfdi.com/products/uEZGUI-1788- 70WVE/brochure/uEZGUI-1788-70WVE%20Brochure.pdf http://sourceforge.net/projects/uez/ http://ics.nxp.com/support/microcontrollers/lcd/#Featured 48
  49. 49. Segger emWIN Written in ANSI-C Widgets, anti-aliasing, multiple fonts Touchscreen support integrated Virtual screen, VNC Support Memory devices – smoother transitions Full API Documentation NXP evaluation versions here – http://www.segger.com/cms/nxp.html 49
  50. 50. Other Third party offerings I2ST – Java virtual machine – Support for LPC2478 and LPC1788 – http://www.is2t.com GHI – Microsoft .NET Micro Framework – FEZ support LPC1788 and LPC2478 devices – www.GHIElectronics.com 50
  51. 51. LPCZone, Training 51
  52. 52. Where to get started? www.nxp.com/microcontrollers – MCU homepage www.nxp.com/lpczone – Product updates and training www.nxp.com/lpcxpresso – Low-cost development www.mbed.org – Rapid proto-typing
  53. 53. New Cortex-M training videos Introduction to NXPs Cortex-M0/M3/M4 processors – http://ics.nxp.com/support/training/cortex-m.intro/ LPC1000 debug tools, tips, and tricks (part 1) Cortex-M0 – http://ics.nxp.com/support/training/lpc1000.debug.tools.tips.1/ LPC1700 series overview – http://ics.nxp.com/support/training/lpc1700.overview/ Cortex-M3 Introduction to NXPs LPC4300 Cortex-M4 based digital controller – http://ics.nxp.com/support/training/lpc4300.intro/ Introduction to NXPs LPC4300 advanced peripherals – http://ics.nxp.com/support/training/lpc4300.peripherals/ Cortex-M4 LPCXpresso introduction – http://ics.nxp.com/support/training/lpcxpresso.intro/ LPCXpresso Learn Eclipse the LPCXpresso way – http://ics.nxp.com/support/training/learn.eclipse.lpcxpresso/ Simplifying USB with NXPs lowest-cost ARM MCUs – http://ics.nxp.com/support/training/lpc1000.debug.tools.tips.1/ USB
  54. 54. Q&A 54
  55. 55. 55

×