Advertisement

Quick Links

BEGV643A
USER MANUAL
LCD Embedded System,
Atmel ATmega644p MCU,
Graphic 320x240 STN LCD,
LED/white backlight,
RS232/RS422/RS485, I
64KB in-system programmable Flash
No Operating System required
Bolymin, Inc.
www.bolymin.com.tw
2
C /SPI
info@bolymin.com.tw

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the BEGV643A Series and is the answer not in the manual?

Questions and answers

Summary of Contents for Bolymin BEGV643A Series

  • Page 1 BEGV643A USER MANUAL LCD Embedded System, Atmel ATmega644p MCU, Graphic 320x240 STN LCD, LED/white backlight, RS232/RS422/RS485, I C /SPI 64KB in-system programmable Flash No Operating System required Bolymin, Inc. www.bolymin.com.tw info@bolymin.com.tw...
  • Page 2: Table Of Contents

    4-1-2 Additional tool for C language 4-2 Execute AVR studio 4.16 on designer PC 4-3 In-system programmer AVR ISP mk II 4-4 Bolymin Free Software Utilities 4-4-1 Website links 4-4-2 Introduction of BOLYMIN software utilities 4-4-3 Software utilities function...
  • Page 3 Precaution WARNING CAUTION This device is designed to meet the requirement in part 15 of the FCC rules. Operation is subject to conditions ruled under FCC part 15. BEGV643A User Manual Ver.02 - 3 -...
  • Page 4 Please check packing content upon receiving BEGV643A parcel, make sure that all materials and options are packed inside parcel according to your order. Packing Contents Check-List BEGV643A LCD Embedded module Touch panel Software Utility Disc ISP Cable (option) ATMEL software development tool BEGV643A User Manual Ver.02 - 4 -...
  • Page 5 Chapter 1 Introduction Abstract This chapter is to offer you basic information regarding BEGV643A, to help you incorporate BEGV643A into your system. Contents include: 1-1 Features 1-2 Board Layout 1-3 Block Diagram 1-4 Mechanical Dimension 1-5 Board Specifications 1-6 Ordering information BEGV643A User Manual Ver.02 - 5 -...
  • Page 6: Features

    1-1 Features This BEGV643A is designed based on ATmega644p microprocessor, which requires no operating system to run on. Together with a 320x240 STN LCD and LED backlight built-in, this all-in-one LCD embedded system BEGV643A help designer enhance a compact design with cost saving, space saving, and design phase saving. Armed with RS232, RS422/485, I C and SPI interface port, this BEGV643A communicates many devices and peripherals.
  • Page 7 1-3 Block Diagram (Drawing 1.3) 1-4 Mechanical Dimension (Drawing 1.4) BEGV643A User Manual Ver.02 - 7 -...
  • Page 8 1-5 Board Specifications (Table 1.5) ® High-performance, Low-power AVR 8-bit microprocessor ATMEL ATmega644P 64K Bytes In-System Self-Programmable Flash Memory 2K Bytes Internal EEPROM 4K Bytes Internal SRAM 3 x 64K Bytes External EEPROM(optional) Support 8-bit single-scan resolution 320 x 240 monochrome STN LCD, with Display edge LED white backlight only Support four-wired resistive touch panel...
  • Page 9 Chapter 2 Installation Abstract This chapter is to offer designer fundamental information of BEGV643A jumpers and connectors, in order to help designer configure correct setting and connection between BEGV643A and system application. Contents include: 2-1 Jumpers 2-2 Connectors BEGV643A User Manual Ver.02 - 9 -...
  • Page 10 Please note, jumpers not described here are intended to keep as factory default setting. Please consult Bolymin before trying to change default setting. The table listed below describes location and function of each available jumper.
  • Page 11 2-1-2 Frame Ground (Drawing 2.1.2) Frame ground short Connect metal frame with GND open Not connected metal frame with ground default 2-1-3 RS-422/RS-485 VDD/Ground (Drawing 2.1.3) RS-422/RS-485 VDD/Ground short short internal VDD/ground for isolated RS-422/485 open open External VDD/ground for isolated RS-422/485 default BEGV643A User Manual Ver.02 - 11 -...
  • Page 12 2-1-4 Screw hole ground (Drawing 2.1.4) Frame ground short Connect screw hole with GND open Not connected screw hole with ground default 2-2 Connectors Connectors are the key link between BEGV643A and external devices. Detail locations and functions of available connectors are tabled and illustrated below.
  • Page 13 Pin Types =Input =Output =Input / Output (Bi-Directional) =User defined =Power Pin Definition: BEGV643A-Dual RS232 (Table 2.2.1a) Pin No. Signal Pin No. Signal EEPSDA EEPSCL EEPWP /Reset MOSI MISO Pin Definition: BEGV643A1-One RS232 (Table 2.2.1b) Pin No. Signal Pin No. Signal EEPSDA EEPSCL...
  • Page 14 Pin Definition: BEGV643A2-One RS232/One RS422 (Table 2.2.1c) Pin No. Signal Pin No. Signal EEPSDA EEPSCL EEPWP /Reset 422RP MOSI 422RN MISO 422TP 422TN VDD2 VDD2 GND2 GND2 Pin Definition: BEGV643A3-One RS232/One RS485 (Table 2.2.1d) Pin No. Signal Pin No. Signal EEPSDA EEPSCL EEPWP...
  • Page 15 2-2-1-2 Serial I/O (Table 2.2.1.2) Signal Type Pin No. Description SPI Chip select MOSI is the mater data output line, when SPI on module is MOSI configured as a master. When SPI is configured as a slave. This pin reverse the role. MISO is the master data input line, when SPI is configured master.
  • Page 16 2-2-2 Pin vs. Function Diagram 2-2-2-1 Power/LCD/Backlight Diagram of system power supply, and contrast adjustment. BEGV643A Vadj Vout /Reset 2-2-2-2 In-System Programming BEGV643A offers in-system software burn-in function, which allows designer to write software into ATmega644p via ATMEL AVR ISP MKII writer without taking ATmega644p IC off board. Please visit following website for more information on AVR ISP MKII writer.
  • Page 17 2-2-2-4 SPI BEGV643A offers SPI port. Designer has to define this port as SPI by software, or to use Bolymin SPI driver (free utility). BEGV643A M OSI M OSI M ISO M ISO Slave M aster BEGV643A M OSI M OSI...
  • Page 18 2-2-2-6 RS-422 BEGV643A offers 1 x RS-422(isolated) port. BEGV643A VDD2 RS-422 isolated power RS-422 Transmitter - RS-422 Recever + RS-422 Transmitter + RS-422 Recever - RS-422 Recever - RS-422 Transmitter + RS-422 Recever + RS-422 Transmitter - GND2 RS-422 isolated ground 2-2-2-7 RS-485 BEGV643A offers 1 x RS-485(isolated) port.
  • Page 19 Chapter 3 MCU port mapping Abstract This chapter explains ATmega644p MCU pin configuration and port mapping toward key elements such as LCD, Touch Panel, RS-232, RS-422, RS-485, LED Backlight, EEPROM/I 2-wire serial port, SPI, and General I/O. BEGV643A User Manual Ver.02 - 19 -...
  • Page 20 3-1 MCU Pin Configuration (Drawing 3.1, ATmega644p MCU) BEGV643A User Manual Ver.01 - 20 -...
  • Page 21: Enable Backlight

    3-2 MCU Port Mapping 3-2-1 LCD Controller (Table 3.2a) MCU ATmega644P LCD Controller PORTB.0 DB0(LSB) PORTB.1 PORTB.2 PORTB.3 PORTD.4 PORTD.5 PORTD.6 PORTD.7 DB7(MSB) PORTC.7 LCD /RESET PORTC.5 LCD RD PORTC.4 LCD WR PORTC.6 LCD C/D 3-2-2 Touch Panel (Table 3.2b) MCU ATmega644P Touch Panel PORTA.0...
  • Page 22: Spi

    3-2-7 SPI (Table 3.2h) MCU ATmega644P PORTB.4 PORTB.5 MOSI PORTB.6 MISO PORTB.7 3-2-8 General I/O (Table 3.2i) MCU ATmega644P General I/O PORTA.4 PORTA.7 BEGV643A User Manual Ver.02 - 22 -...
  • Page 23 Chapter 4 Software Development Tool & Utility Abstract This chapter explains ATmega644p MCU software development tool AVR ISP mkII writer and Bolymin free software utilities. BEGV643A User Manual Ver.02 - 23 -...
  • Page 24 4-1 ATMEL ATmega644p Software Development Tool Designers may download software development tool from AVR Studio website http://www.atmel.com/dyn/products/tools_card.asp?tool_id=2725, or from BOLYMIN utility disk. 4-1-1 Download software from AVR Studio website step1: Download design software Click here to download AVR Studio 4.16...
  • Page 25 BEGV643A User Manual Ver.02 - 25 -...
  • Page 26 Accept terms to continue BEGV643A User Manual Ver.02 - 26 -...
  • Page 27 Select folder to install and continue BEGV643A User Manual Ver.02 - 27 -...
  • Page 28 Select features to install and continue BEGV643A User Manual Ver.02 - 28 -...
  • Page 29 Click install to begin installation BEGV643A User Manual Ver.02 - 29 -...
  • Page 30 Wait for seconds for installation BEGV643A User Manual Ver.02 - 30 -...
  • Page 31 Click finish to exit the installation BEGV643A User Manual Ver.02 - 31 -...
  • Page 32: Additional Tool For C Language

    4-1-2 Additional tool for C language For C language designers, additionally please download and install AVR gcc from http://sourceforge.net/project/downloading.php?group_id=68108&filename=WinAVR-20090313- install.exe&a=6759369 Double click to install WinAVR Choose your language to install Close other applications to continue BEGV643A User Manual Ver.02 - 32 -...
  • Page 33 Click I agree to continue Choose folder to continue BEGV643A User Manual Ver.02 - 33 -...
  • Page 34 Choose components to install Wait for seconds for installation BEGV643A User Manual Ver.02 - 34 -...
  • Page 35 Click finish to exit installation ** AVR Studio and AVR gcc software are also available on Bolymin utility disk or Bolymin website. BEGV643A User Manual Ver.02 - 35 -...
  • Page 36 4-2 Execute AVR Studio 4.16 on designer PC Start All programs Atmel AVR Tools AVR Studio 4 Click New Project to start Choose Atmel AVR Assembler (assembly language), or AVR GCC(C code) BEGV643A User Manual Ver.02 - 36 -...
  • Page 37 Choose AVR GCC here (All Bolymin utility drivers are designed with C code), and key in Project Name and Initial file. Choose AVR Simulator, ATmega644P, and click Finish to continue BEGV643A User Manual Ver.02 - 37 -...
  • Page 38 Here you can see software design screen, yet no hurry to start software design yet. Choose Project Configuration Options to continue BEGV643A User Manual Ver.02 - 38 -...
  • Page 39 Choose General and key in necessary information to continue Choose Include Directories, and Include File Search Path to continue BEGV643A User Manual Ver.02 - 39 -...
  • Page 40 Choose Include as File Search Path to continue Click Yes to continue BEGV643A User Manual Ver.02 - 40 -...
  • Page 41 After executing AVR Studio 4.16 on PC, designer can see key information on 5 windows: [1]. Project management window BEGV643A User Manual Ver.02 - 41 -...
  • Page 42 [2]. Program editing window BEGV643A User Manual Ver.02 - 42 -...
  • Page 43 [3]. I/O view window [4]. Message window [5]. Toolbars BEGV643A User Manual Ver.02 - 43 -...
  • Page 44 4-3 In-System Programmer AVR ISP mkII ** Inside mkII box(1), designer will get DVD(2), mkII device(3), and USB cable(4). Please be sure that all parts are packed inside. BEGV643A User Manual Ver.02 - 44 -...
  • Page 45 Steps: 1.Get mkII connected to PC Choose Tools Program AVR Connect to continue Choose AVRISP mkII USB Connect to continue BEGV643A User Manual Ver.02 - 45 -...
  • Page 46 Choose Hex file for ATmega644p flash Program Choose Hex file for ATmega644p EEPROM Program Choose ELF file for fuses and lockbits Program BEGV643A User Manual Ver.02 - 46 -...
  • Page 47 Start software burning Choose Auto and necessary configure and click Start to program BEGV643A User Manual Ver.02 - 47 -...
  • Page 48 Good job! Software burning is done! BEGV643A User Manual Ver.02 - 48 -...
  • Page 49 Product Function Verify On PC: Start All programs Telecommunication Hyper Terminal Please define a name and choose a icon for this connection, and click Yes to continue. Choose a suitable COM port, and click Yes to continue. BEGV643A User Manual Ver.02 - 49 -...
  • Page 50 Key in COM port setting:115200/8/No/1/No, and click Yes to continue. BEGV643A User Manual Ver.02 - 50 -...
  • Page 51 Turn on BEGV64.A power, and designer will see this screen. After seeing above screen, designer can operate on PC & BEGV643A: A). Enter number “1”: for I C EEPROM function test (1 EEPROM) B). Enter number “2”: for 2 UART function test C).
  • Page 52 A). Enter number “1”: for I C EEPROM function test (1 EEPROM) 1). Enter number “1”: for I C EEPROM function test (1 EEPROM) 2). Enter number “2”: for I C EEPROM function test (2 EEPROM) 3). Enter number “3”: for I C EEPROM function test (3 EEPROM) 4).
  • Page 53 B). Enter number “2”: for 2 UART function test 1). Enter number “1”: to send 1 byte (0x55) 2). Enter number “2”: to send 1 byte (0xAA) 3). Enter number “3”: to send 1 word (0x5555) 4). Enter number “4”: to send 1 byte (0xAAAA) 5).
  • Page 54 C). Enter number “3”: for ATmega644P internal EEPROM setting ** Address 0x0000~0x001D is for touch panel calibration data 1). Enter number “1”: to write 55 on current screen 2). Enter number “2”: to write AA on current screen 3). Enter number “3”: to write 00 on current screen 4).
  • Page 55 D). Enter number “4”: for 4-wire SPI Master function test 1). Enter number “1”: to send 1 byte (0x55) 2). Enter number “2”: to send 1 byte (0xAA) 3). Enter number “3”: to send 1 word (0x5555) 4). Enter number “4”: to send 1 byte (0xAAAA) 5).
  • Page 56 E). Enter number “5”: for 4-wire SPI Slave function test 1). Enter number “1”: to receive 1 byte 2). Enter number “2”: to receive 1 word 3). Enter number “0”: to return to main screen BEGV643A User Manual Ver.02 - 56 -...
  • Page 57 F). Enter number “6”: to read from touch panel 1). Using light pen to touch a point on touch panel 2). X, Y values are touch panel coordinates 3). DX, DY values are LCD coordinates (DX=0/DY=0 if touch panel is not calibrated.) 4).
  • Page 58 G). Enter number “7”: for touch panel calibration (5 point) 1). On the LCD, designer will see displays. Please use light pen to touch center point of until it turns to . Such, one point is calibrated. 2). Please repeat above process to calibrate 5 points. 3).
  • Page 59 H). Enter number “8”: for LCD function test 1). Enter number “1”: to LCD show full on 2). Enter number “2”: to LCD show vertical line 3). Enter number “3”: to LCD show horizontal line 4). Enter number “4”: to LCD show half 5).
  • Page 60 H line Half Cross dot Character Picture1 Picture2 BEGV643A User Manual Ver.02 - 60 -...
  • Page 61 I). Enter number “9”: for backlight brightness adjustment function test 1). Enter number “1”: to backlight brightness + 5 2). Enter number “2”: to backlight brightness - 5 3). Enter number “0”: to return to main screen BEGV643A User Manual Ver.02 - 61 -...
  • Page 62: Website Links

    4-4 Bolymin Free Software Utilities 4-4-1 Website Links Touch Panel Driver www.bolymin.com.tw/embedded/utility/BEGV643A/tpdriver.zip UART Driver (RS-232/485/422) www.bolymin.com.tw/embedded/utility/BEGV643A/uartdriver.zip SPI Driver www.bolymin.com.tw/embedded/utility/BEGV643A/spidriver.zip C Driver www.bolymin.com.tw/embedded/utility/BEGV643A/i2cdriver.zip Backlight Driver www.bolymin.com.tw/embedded/utility/BEGV643A/backlightdriver.zip LCD Driver www.bolymin.com.tw/embedded/utility/BEGV643A/lcddriver.zip BEGV643A User Manual Ver.02 - 62 -...
  • Page 63: Introduction Of Bolymin

    4-4-2 Introduction of Bolymin software utilities It is recommended to use Bolymin software utilities in order to speed up project development phase. However, designer may develop your own software utilities, if you find Bolymin utilities is not convenient to use.
  • Page 64 Choose Include as File Search Path to continue BEGV643A User Manual Ver.02 - 64 -...
  • Page 65 Note: For touch panel calibration, Floating-point operations is necessary, so please add libm.a and libprintf_flt.a in WinAVR. BEGV643A User Manual Ver.02 - 65 -...
  • Page 66 BEGV643A User Manual Ver.02 - 66 -...
  • Page 67 Note: Adding into Obj BEGV643A User Manual Ver.02 - 67 -...
  • Page 68 BEGV643A User Manual Ver.02 - 68 -...
  • Page 69 Note: choose [Linker Options] BEGV643A User Manual Ver.02 - 69 -...
  • Page 70 Note: key in -Wl,-u,vfprintf, and then Add BEGV643A User Manual Ver.02 - 70 -...
  • Page 71: Software Utilities Function

    4-4-3 Software Utilities Function Description 4-4-3-1 UART function Header file : uart.h Object file : uart.o uartInit Function: Initial UART. void uartInit( Syntax uint8_t byPort, uint32_t uBaudrate, uint8_t byParity, uint8_t uDatabit, uint8_t uStopbit, uint8_t nTxMode Parameters byPort UART_PORT0 – 1st Uart port UART_PORT1 –...
  • Page 72 uartDisablePort Function: to stop operation of assigned Uart port Syntax void uartDisablePort ( uint8_t byPort Parameters byPort UART_PORT0 – 1st Uart port UART_PORT1 – 2nd Uart port Return value None. uartSendString Function: to send 1 string from assigned UART port Syntax void uartSendString( uint8_t...
  • Page 73 uartFlushReceiveBuffer Function: to clear receiving buffer on assigned UART port Syntax void uartFlushReceiveBuffer( uint8_t byPort Parameters byPort UART_PORT0 – 1st Uart port UART_PORT1 – 2nd Uart port Return value None. uartEnableTx Function: to Enable or Disable UART transmitter. (When UART port is applied on RS485 or RS422 , transmitter must be set to Disable, and to Enable transmitter only when sending data.) Syntax void uartEnableTx(...
  • Page 74 4-4-3-2 I C function Header file : i2ceeprom.h object file : i2ceeprom.o i2cInitial Function: Initial I2C functions. User should call this function before using I2C functions. Syntax void i2cInitial( Parameters None. Return value None. i2cReadByte Function: to read 1 byte data from I Syntax uint8_t i2cReadByte( uint8_t...
  • Page 75 4-3-3-3 SPI function Header file : spi.h object file : spi.o spiMaster Function: Initial SPI to master mode. void spiMaster( Syntax uint8_t mode Parameters mode SPI mode. 0 – CPOL=0, CPHA=0 Sample (Rising) Setup (Falling) 1 – CPOL=0, CPHA=1 Setup (Rising) Sample (Falling) 2 –...
  • Page 76 spiSlave Function: Initial SPI to slave mode. Syntax void spiSlave( uint8_t mode, Parameters mode SPI mode. 0 – CPOL=0, CPHA=0 Sample (Rising) Setup (Falling) 1 – CPOL=0, CPHA=1 Setup (Rising) Sample (Falling) 2 – CPOL=1, CPHA=0 Sample (Falling) Setup (Rising) 3 –...
  • Page 77 spiTransferByte Function: to send and read 1 byte data from SPI port Syntax uint8_t spiTransferByte( uint8_t data Parameters data byte to be sent Return value 1 byte data reading from SPI spiTransferWord Function: to send and read 1 word from SPI port Syntax Uint16_t spiTransferByte( uint16_t...
  • Page 78 4-3-3-4 E PROM function PROM Function is built inside WinAVR, so users need only to include eeprom.h in program to call E PROM Function. For exmaple #include <avr/eeprom.h> eeprom_write_byte Function: to write 1 byte to MCU EEPROM. Syntax void eeprom_write_byte ( uint8_t* address, uint8_t...
  • Page 79 4-3-3-5 Touch function Header file : touch.h, a2d.h object file : touch.o, a2d.o touchInit Function: Initial Touch panel. Syntax void touchInit( Parameters None. Return value None. touchGet Function: to read touch data from touch panel Syntax uint8_t touchGet( int * int * Parameters to read X Coordinate from touch data...
  • Page 80 4-3-3-6 LCD control function Header file : RA8806.h object file : RA8806.o lcdInit Function: Initialize all parameters of LCD display. User should call this function before use functions of LCD display. void lcdInit ( Syntax Parameters None. Return value None. lcdDisplayClr Function: Clear screen (include graphic and text layer).
  • Page 81 lcdSetDispMode Function: Set the display mode between graphic layer and text layer. Syntax void lcdSetDispMode ( uint8_t new_mode Parameters New_mode New display mode between graphic layer and text layer. Value : DM_OR_MODE, DM_XOR_MODE, DM_AND_MODE Content on Graphic layer Content on Text layer DM_OR_MODE DM_XOR_MODE DM_AND_MODE...
  • Page 82 lcdFillByte Function: Fill input byte value on specified area of graphic layer. Syntax void lcdFillByte ( uint8_t x_start, uint8_t y_start, uint8_t x_end, uint8_t y_end, uint8_t data, uint8_t mode Parameters x_start X coordinate of the top-left point of specified area. (UNIT=pixel) y_start Y coordinate of the top-left point of specified area.
  • Page 83 lcdDrawRect Function: Draw rectangle by single line on graphic layer. Syntax void lcdDrawRect ( uint8_t x_start, uint8_t y_start, uint8_t x_end, uint8_t y_end, Parameters x_start X coordinate of the top-left point of rectangle. (UNIT=pixel) y_start Y coordinate of the top-left point of rectangle. (UNIT=pixel) x_end X coordinate of the bottom-right point of rectangle.
  • Page 84 4-3-3-7 Backlight PWM control function Header file : bklight_pwm.h object file : bklight_pwm.o Note:Backlight PWM control used TIMER0 and INTERRUPT0 bklPWM_Init Function: Initialize all parameters of backlight PWM control function. User should call this function before use backlight PWM control functions. void bklPWM_Init ( Syntax Parameters...
  • Page 85 Appendix A: LCD Controller Specification Appendix B: EEPROM Specification Appendix C: ATMEL ATmega644p MCU Specification Please download this specification from following ATMEL link: http://www.atmel.com/dyn/resources/prod_documents/doc8011.pdf BEGV643A User Manual Ver.02 - 85 -...
  • Page 86 <END of BEGV643A User Manual> BEGV643A User Manual Ver.02 - 86 -...

This manual is also suitable for:

Begv643a3Begv643a1Begv643a2

Table of Contents