Home
User Manual for COP8-REF-AME
Contents
1. Prepared Checked Status Rev Date Page x of x BC MK Proposal 04 12 01 26 of 26 8 13 Convert Humidity This routine converts AD value into value in 96 RH units It uses approximation method At the end humidity value is converted into separate digits displayed on LCD Location mathpack inc Convert Humidity AD val gt 0x1A4 2 Yes Humidity 100 AD val gt 0x19A gt Yes Humidity 98 No Y No AD val gt 0x006 Yes Humidity 22 96 No Humidity 20 Binary to BCD Bin_Dec a brand new world Page 26 Description Reference design for COP8AME Fil a brand new world Use Manual COP8 REF AME Project no Scale Prepared Checked Status Rev Date Page x of x BC MK Proposal 04 12 01 27 of 26 8 14 Convert_Pressure Convert_Pressure Convert AD value into voltage Calculate pressure accordingly to equation V v v v 0 009 P kPa 0 095 Binary to BCD Bin_Dec a brand new world This routine converts value read from AD converter into value in kPa units using appropriate equation At the end pressure value is converted into separate digits displayed on LCD Location mathpack inc Page 27
2. BC MK Proposal 04 12 01 3 of 26 1 Brief Description of System COP8 REF AME Preliminary Product Requirement Spec Sep 15 2001 Features gt gt VN VVVVVV Stand alone multi meter reference design with COP8AME as system processor Capability to connect external voltage and current sources to measure external voltages in the range of 0 to 19 9V and current the range of 0 to 20mA AGC Automatic Gain Control is implemented which is under software control supporting higher accuracy There is a voltage and a current source installed in order to allow standalone operation PC software with application information source code circuit schematics and bill of materials is provided in the package Demonstrates the built in AD converter capability of the COP8AME Communication protocol is supported on the board RS 232 Both in circuit programming and in circuit emulation supported on the reference board Sensors for light and humidity measurements are on board Pushbuttons are included for controlling purposes Programming interface support a brand new world Page 3 Reference design for COPBAME File Scale a brand new world Manual COP8 REF AME Prepared Checked Status Rev Date Page x of x BC MK Proposal 04 12 01 4 of 26 2 General Description The reference design is intended for several different purposes The main goal is to show the buil
3. a brand new world Manual COP8 REF AME ide Prepared Checked Status Rev Date Page x of x BC MK Proposal 04 12 01 14 of 26 8 Flowcharts 8 1 Program PROGRAM This is the whole application flow Below the Program flow is a description of the syntax used in the flowcharts in this document The flowchart is a complement to the comments in the code and should be used as a support while reading the code Location main asm EXIT START STOP I susrourine QUESTION a brand new world Page 14 Description Reference design for COPBAME File Scale a brand new world Manual COP8 REF AME Pus Prepared Checked Status Rev Date Page x of x BC MK Proposal 04 12 01 15 of 26 8 2 Init Reset PSW and init watchdog Setup all ports Init microwire and timers Init variables Init UART Init UART Init AD converter Set 9600 Check flash Init ID Clock Put initial text on display Init AD Init display Init LCD a brand new world This is the way the System is initialized This is in our opinion a good way to start up your own software Location main asm Page 15 Description Reference design for COP8AME File Scale a brand new world Manual COP8 REF AME ide Prepared Checked Status Rev Date Page x of x BC MK Proposal 04 12 01 16 of 26 8 3 Main
4. design for COP8AME File Scale a brand new world Manual COP8 REF AME ide Prepared Checked Status Rev Date Page x of x BC MK Proposal 04 12 01 24 of 26 8 11 Clock Increment timer TO interrupt counter Counter gt 488 2 Yes This is the driver that keeps track of time It handles both 10 MHz clock and 32 kHz clock Location timer x inc 10 MHz Seconds 59 Yes Clear seconds Increment minutes 32 kHz Yes Clear minutes Increment hours Yes Clear hours a brand new world Page 24 Description Reference design for COP8AME File Scale a brand new world Manual COP8 REF AME ide Prepared Checked Status Rev Date Page x of x BC MK Proposal 04 12 01 25 of 26 8 12 Convert Temp Calculate temperature accordingly to eq v lv Bin_Dec Convert_Temp Convert AD value into voltage Binary to BCD uation 1 625 V a brand new world This routine converts value read from AD converter into value in C units It is up to user to write code that will handle appropriate accuracy At the end temperature value is converted into separate digits displayed on LCD Location mathpack inc Page 25 Reference design for COPBAME File Scale a brand new world Manual COP8 REF AME
5. kHz signal through periodical level changing on L6 and G3 pin This signal feeds humidity sensor Timer T2 starts when user enters humidity measurement routine and stops immediately after exit This simple generator code is written in the Timer2A Int subroutine 5 7 mathpack inc In the mathpack inc file there is a collection of useful mathematical routines There is one routine for 16 bit multiplication Bin Mul 16 and one routine for 16 bit division Bin Div 16 There are also routines for converting 16 bit binary to decimal digit values Bin Dec Conversion routines especially for temperature Convert Temp humidity Convert Humidity and pressure Convert Pressure measurements are also written a brand new world Page 10 Description Reference design for COPBAME Fil i Scale a brand new world Manual COP8 REF AME Preig Prepared Checked Status Rev Date Page x of x MK Proposal 04 12 01 11 of 26 6 Hardware Description Here is a description of the main hardware ideas behind the COP8 REF AME reference design This picture illustrates functions supported by this reference design The schematics and bill of materials are on the provided CD ROM a ba ot pu om s P TOPO Peo eee etches a brand new world Page 11 Reference design for COPBAME File Scale a brand new world Manual COP8 REF AME Prepared Che
6. reference board They are humidity IC2 and pressure IC4 sensors Their outputs are connected to two of the A D inputs through an external connector a brand new world Page 12 Description Reference design for COPBAME File Scale a brand new world Manual COP8 REF AME Pus Prepared Checked Status Rev Date Page x of x BC MK Proposal 04 12 01 13 of 26 7 Board configuration The jumpers configuration is shown in a table below Jumpers J5 J6 J7 J8 J11 J14 J15 J18 J19 J20 Light up x 1 X X X X Measurement Temperature up x X up x X X X x X External voltage up x x X x ep X External current up x X up x X X X up x On board voltage up x x up 0 X 1 X X x On board current up x 1 up x X X X 1 Humidity dn x X dn x X x Atmospheric up 1 X up x X X X X X 1 closed up upper position 0 open dn bottom position x free Except configuration shown above all pin pairs of connector J9 must be jumpered for correct operation of COP8 REF AME Reference Design Board To use ISP connector J22 should be shorted in rightmost position Opposite position is used for resetting Flex bit a brand new world Page 13 Description Reference design for COPBAME File Scale
7. 5 Reference design for COPBAME File Scale a brand new world Manual COP8 REF AME Prepared Checked Status Rev Date Page x of x BC MK Proposal 04 12 01 6 of 26 3 1 Light meter The light meter mode samples the input from the photodiode D3 and presents the result of AD conversion on the display The value shown on the display is the ADC value without any AGC Automatic Gain Control implemented The photodiode voltage is amplified to cover the range from dark to full sunshine In order to increase or decrease gain of the amplifier it is up to the user to change the resistor R20 default 300k Ohm To enable light measurement a jumper must be placed on J14 3 2 Temperature meter The temperature meter uses CO8AME built in temperature sensor and has a resolution of 0 5 C The temperature to voltage conversion is given by the following equation V v 8 27 Les There is no calibration used for temperature sensor For more accurate measurements of temperature it is up to the user to write complementary code modify equation More information about the built in temperature sensor can also be found in COP8AME specification 3 3 External voltage meter An user may connect an external voltage source to connector J10 and measure it This input voltage must be in the range of 0 20 Volts To enable external voltage measurement a jumper must be placed on J18 in Ext Volt p
8. Display Handler Command Handler a brand new world This is the forever loop that secures that all the resources get their shares of processing time Location main asm Page 16 Reference design for COPBAME File Scale a brand new world Manual COP8 REF AME Prepared Checked Status Rev Date Page x of x BC MK Proposal 04 12 01 17 of 26 8 4 Display handler This is the complete code that deals with the updating of the display i e control over the information the display Location Icd inc Display Handler YES button pressed Yes NO button pressed New second No Yes MODE COUNTER 1 Yes MODE COUNTER 1 Setup display with Setup display with Setup display with LEVEL 2 info LEVEL 1 info LEVEL 2 info a brand new world Page 17 Description Reference design for COPBAME File Scale a brand new world Manual COP8 REF AME Pus Prepared Checked Status Rev Date Page x of x BC MK Proposal 04 12 01 18 of 26 8 5 Init LCD Init LCD Reset enable register select and delay 25 ms Put_LCD_ Ctrl Cursor home Clock display and delay 5 ms 1 ms 1 ms Put LCD Ctrl 8 bit data 2 lines 5x7 dots display controller is Delay 1 ms handled Location Icd inc Put LCD Ctrl both rows no back no shift Delay 1 ms Put LCD Ctrl Clear display Delay 1 ms
9. ISP operations it is important to short J22 connector in Normal position a brand new world Page 8 Reference design for COPBAME Fil Scale a brand new world Manual COP8 REF AME Prepared Checked Status Rev Date Page x of x BC MK Proposal 04 12 01 9 of 26 5 Description of firmware modules The firmware code may be found on the CD ROM accompanying the reference board in the Firmware folder This section describes the firmware in detail There are flowcharts for the most useful routines in chapter 7 They present some of the functions in detail That should help the user to understand the structure of the firmware application 5 1 main asm This is the main file for the application It contains the initialization of the system and includes all other files used in the firmware It is important to notice that the main driver is used to guarantee a part of processor time to all the modules There are also three subroutines Store Data Clear Flex Bit Read Data in the main file They show how one can use the built in boot ROM subroutines to reprogram parts of the flash memory Store Data is used for storing the clock value and the system ID into the flash memory Read Data is used for reading in flash memory stored system ID and the clock value from the last set clock command from PC software Clear Flex Bitis used for clearing the last part of the flash memory where the OPTION
10. Put LCD Ctrl Move cursor right This is a description of how initiation of the a brand new world Page 18 Description Reference design for COP8AME File Scal a brand new world Manual COP8 REF AME ide Prepared Checked Status Rev Date Page x of x BC MK Proposal 04 12 01 19 of 26 8 6 Print LCD Print LCD Get ROM Byte character to display Character 0 Character 1 No Character 2 No Character r 2 No Put LCD Put_LCD_ Ctrl Yes line 1 Y Put LCD Ctrl 98 line 2 Y Put LCD Ctrl 83 clear screen a brand new world This is the flow for writing a string stored in ROM onto the display Please not that the string must be null terminated 0 otherwise the routine won t stop Note also that digit 1 and 2 is used for determining which line to print on Location Icd inc Page 19 a brand new world Description Reference design for COP8AME Scale User Manual COP8 REF AME E Prepared Checked Status Rev Date Page x of x BC MK Proposal 04 12 01 20 of 26 Set register select a brand new world This routine is used for shifting out one byte of display data Location Icd inc Page 20 Description Reference design for COPBAME File Scale a brand new world Manual COP8 REF AME Pus Prepared Checked Statu
11. User Manual for COP8 REF AME Description Reference design for COP8AME Fil a brand new world User Manual COP8 REF AME Project no Scale Prepared Checked Status Rev Date Page x of x BC MK Proposal 04 12 01 2 of 26 Reference design for COP8 REF AME Table of Contents 1 2 3 BRIEF DESCRIPTION OF SYSTEM GENERAL DESCRIPTION DESCRIPTION OF FIRMWARE FUNCTIONS LIGHT METER TEMPERATURE METER EXTERNAL VOLTAGE METER EXTERNAL CURRENT METER ON BOARD VOLTAGE METER ON BOARD CURRENT METER HUMIDITY METER PRESSURE METER DESCRIPTION OF COMMUNICATIONS INTERFACE TIE EIA 232 RS 232 4 2 COMMUNICATION PROTOCOL 4 3 MICROWIRE DESCRIPTION OF FIRMWARE MODULES MAIN ASM MEMORY INC 4 1 AD_CONV INC TIMER_X INC MATHPACK INC Pur LCD UART REC CONVERT CONVERT res E esas da adi edo seu dis Ue nea E CONVERT 59 0 sa dass ss da s dosi sa daas isse s asa sa sa asas sa s asa nass sa 64 a brand new world Page 2 HARDWARE DESCRIPTION METALINK DIVA CONNECTOR HEADER FOR CONNECTING AN ANALOG DAUGHTER BOARD ISP PROGRAMMING CONSIDERATIONS FREQUENCY INPUT SENSORS FOR WEATHER MEASUREMENTS Reference design for COPBAME Fil Scale a brand new world Manual COP8 REF AME Prepared Checked Status Rev Date Page x of x
12. cked Status Rev Date Page x of x BC MK Proposal 04 12 01 12 of 26 6 1 Metalink DIVA connector A user may use Metalink DIVA connector J9 to write his own code and emulate it trough Metalink system The design of this connection is done according to the specifications from Metalink When firmware runs from Flash and not from emulator the DIVA connector should be jumpered all pin pairs 6 2 Header for connecting an analog daughter board This header consists of two pin strip headers J3 and J4 with standard pin spacing 2 54 mm The spacing between the two headers is 2 54 mm x 12 to make it possible to use a standard prototyping board Therefore user can create an analog daughter board in an easy way to test the stand alone amplifier and the programmable gain amplifier built into COP8AME 6 3 ISP programming recommendation It is very important that the PC parallel port cable to the RJ11 connector on the reference board has to be disconnected when resetting the board to get into ISP mode If the cable is connected high levels on the parallel interface pins will prevent the COP8 flash from performing a correct reset 6 4 Frequency input There is connector J17 on reference board that may be used to measure input frequencies using high speed timer This is done by connecting one of the two high speed timer capture inputs to J17 6 5 Sensors for weather measurements Sensors for weather measurements are installed on the
13. current sources that are installed on board The firmware software is controlled via two push buttons labeled YES and NO To leave the startup menu the user has to push one of the buttons The menu system has two levels one base menu and one submenu In the base menu the user can select if he wants to enter the mode displayed or not By choosing NO the user will go to the next mode selection If the user pushes YES button the next submenu will be displayed or a specific mode will be executed The submenus and operating modes are described below Additionally wnen LEDs are connected to COP8AME ports through J5 and J8 green LED flashes once per second when measurement is performed and also if YES button is pressed Red LED lights when NO button is pressed Both LEDs are not active for humidity measurements More information about the COP8 microcontrollers and the latest updates of tool and reference designs can be found at National Semiconductors microcontroller product site http www national com cop8 A lot of other useful information can also be found on the COP8 CD This CD can be supplied by your local distributor or National FAE Mode number Mode description Measure light Measure temperature Measure external voltage Measure external current Measure on board voltage Measure on board current Measure humidity Measure atmospheric pressure coo BGO PO a brand new world Page
14. eive interrupts The receive interrupt will put the received byte into a 64 byte long buffer and the user can use the Get Byte From Buff subroutine to get the bytes from the buffer a brand new world Page 9 Reference design for COPBAME Fil Scale a brand new world Manual COP8 REF AME O Prepared Checked Status Rev Date Page x of x BC MK Proposal 04 12 01 10 of 26 The send interrupt works in a different way It is up to the user to load the send buffer with data to send and then activate send interrupt This routine will empty the send buffer and then turn of the send interrupt 5 5 ad_conv inc ad_conv inc_contains functions for handling the AD converter For instance in ad_conv inc file the routine Read_AD_chis located This routine will read the AD channel set in the ADSET variable and then store the results in ADRES7 low eight bits and in ADRES2 high two bits 5 6 timer x inc timer x inc file contains all functions used with the timers First there is the timer zero interrupt handler TimerO Int The timer zero handles the time counter Clock The control of the push buttons is also under timer zero control There are also functions for using timer one there The frequency counter is implemented using timer and the code for measuring the frequency is in Timer1A Int This function is written for user usage but not used in multimeter Timer two is used to generate 1
15. fact that humidity sensor must be driven by alternating current meter uses four pins two for feeding and two for differential measurement connected to J19 J18 J5 and J8 connector Therefore these connectors must be shorted in position Humidity 3 8 Pressure meter The main part of pressure meter is MPXA4115A atmospheric pressure sensor It could measure the pressure from 15 to 115 kPa For AD values read a mathematical equation is applied v v v v 0 009 P kPa 0 095 No calibration is used for this sensor To make this measurement connector J6 must be shorted a brand new world Page 7 Reference design for COPBAME File Scale a brand new world Manual COP8 REF AME Prepared Checked Status Rev Date Page x of x BC MK Proposal 04 12 01 8 of 26 4 Description of Communications Interface There is TIE EIA 232 communication interface present on board It is described below Short description of the communication protocol implemented in the firmware is available in the following section as well 4 1 TIE EIA 232 RS 232 To be able to communicate with PC or other reference boards an RS 232 circuit is present on board This is also the default interface for the host PC software The COP8AME hardware USART is capable to communicate with speeds of up to 38 400bps 4 2 Communication protocol A simple protocol has been created for PC software communicatin
16. g with the reference board The communication protocol is described in the table below Each command from the host PC has a corresponding acknowledge For example the Set Clock Command will be transmitted to the reference board as first byte 05h second byte 05h and the actual time set in the host software window on three bytes Then the reference board will reply with first byte 04h second byte 05h and then the time as interpreted by the firmware sent back on three bytes first hour then minutes and last seconds Signal e Length Data Test Loop 0x00 0x02 Get AD Value Cmd 0x01 0x03 Channel AD Value Resp 0x02 0x07 Channel AD Val HB LB Dec Val HB LB Get Clock Command 0x03 0x02 Clock Response 0x04 0x05 Hours Minutes Seconds Set Clock Command 0x05 0x05 Hours Minutes Seconds Get ID Command 0x06 0x02 ID Response 0x07 0 06 Letter 1 Letter 4 Set ID Command 0x08 Ox06 Letter 1 Letter 4 The other commands are executed in the same way Just note that all the commands have a reply and it is up to the user whether to use this information or not 4 3 Microwire The RJ11 connector J13 on board allows to program COP8AME through ISP Please read application note AN 1154 for more information on all functions of the ISP program This connector can also be used to connect to the reference board other devices that are Microwire compatible During
17. osition 3 4 External current meter An user may connect an external current source to connector J10 and measure it This input current must be in the range of 0 20 mA To enable external current measurement a jumper must be placed on J19 in Ext Curr position 3 5 On board voltage meter A voltage source installed on board works in the range of 0 5V The voltage can be changed using VR1 potentiometer This mode can be used to check that the AD converter is working To enable on board voltage measurement a jumper must be placed on J15 The on board voltage is also present on connector J11 3 6 On board current meter A current source installed on board works in the range of 0 10 mA The current can be changed using VR2 potentiometer To use the current source an user has to put a jumper on J7 connector or connect an external circuit to J7 Otherwise the source will not be connected to ADC input a brand new world Page 6 Reference design for COPBAME Fil Scale a brand new world Manual COP8 REF AME Prepared Checked Status Rev Date Page x of x BC MK Proposal 04 12 01 7 of 26 J7 connector can also be used to connect an external current meter to check the accuracy of the AD converter 3 7 Humidity meter The humidity meter is able to measure humidity from 20 to 100 RH It uses approximation method for AD values read described in detail in the flowcharts Due to the
18. register is located The intent behind this subroutine is to show a way of getting into the boot ROM programming mode and allowing for in circuit programming 5 2 memory inc The memory include file contains all variables and constants declarations used in the firmware applications It also contains declarations and setup values for all ports and pin setups 5 3 Icd inc The driver Display Handler for the multimeter application is stored in the cd inc file The file also contains the routines for running the dot matrix display There are flowcharts describing the code structure in chapter 7 nit LCD Print LCD Put LCD Ctrl and Put LCD are important routines of this module They are described in detail in the code For a quick reference nit LCD is used to initiate the dot matrix on board processor please refer to the manufactures of dot matrix displays for more information on this Print LCD is used to write a complete string onto the display The strings are stored in ROM and there is an example of writing a string to LCD in cd inc file Then Put LCD Ctrl is used to send a control signal to the display controller line selection clear screen and cursor home The last subroutine that is useful to know about is the Put LCD that will put the content of the accumulator on to the display 5 4 uart inc In uart inc file the driver Command Handler for communications handling is located This file also includes the handling of the send and rec
19. s Rev Date Page x of x BC MK Proposal 04 12 01 21 of 26 8 8 Put LCD Ctrl Reset register select This is the way control signals are sent to the display a brand new world Page 21 Description Reference design for COP8AME a brand new world Scale User Manual COP8 REF AME Prepared Checked Status Rev Date Page x of x BC MK Proposal 04 12 01 22 of 26 8 9 UART_Rec UART_Rec Receiving error Yes No Load received byte to receiving buffer Increment receiving buffer counter Rev buffer full Yes No Set RECEIVE B bit in UART FLAG a brand new world Clear buffer Clear flags This is interrupt driver for the hardware interrupt It takes care of buffering and flagging for new bytes in buffer Location uart inc Page 22 Description Reference design for COP8AME File Scale a brand new world Manual COP8 REF AME ide Prepared Checked Status Rev Date Page x of x BC MK Proposal 04 12 01 23 of 26 8 10 UART Send UART Send Get byte from sending buffer Increment sending buffer counter All bytes sent a brand new world Clear buffer disable UART TX interrupt This is the send out buffer routine It works by turning on the UART send interrupt Location uart inc Page 23 Description Reference
20. t in capabilities of the COP8AME microcontroller The features include dual clock high speed PWM timer 6 channel AD converter programmable gain amplifier temperature sensor and also the built in USART Another goal is to create a versatile platform for developers that want to test their own code It is possible with Flash feature of COP8AME and can be done using PC software to re program the device There is also Microwire bus connector with standard spacing on the card to enable the user to hook on his own devices to COP8AME a brand new world Page 4 Reference design for COPBAME Fil Scale a brand new world Manual COP8 REF AME Preig Prepared Checked Status Rev Date Page x of x MK Proposal 04 12 01 5 of 26 3 Description of Firmware Functions The user has the capability to use the reference design as a stand alone multimeter Below is a brief description of the different functions of the multimeter In each paragraph there is also a description of the hardware and software used for each function Please read the dedicated paragraph for a more detailed look into the hardware design see p 6 A user can select the analogue channel to read The possible channels are voltage input current input light sensor humidity sensor atmospheric pressure sensor and the on chip temperature sensor It is also possible to read voltage and current from external sources or from the voltage and
Download Pdf Manuals
Related Search
Related Contents
POTWASHER WITH GRANULATE WD-90GR HC Nostalgia Electrics RFH-900 User's Manual EVGA 015-P3-1582-ER NVIDIA GeForce GTX 580 1.5GB graphics card MicroLogix 1400 Programmable Controllers Ausgabe 1/2013 Manuel d`utilisation du Nokia 6216 classic Kamoer Dosing Pump Instruction Manual Copyright © All rights reserved.
Failed to retrieve file