Home
ML610Q400 Series Sample Program AP Notes For Barometer
Contents
1. Figure 4 7 A display during air pressure calibration Name Content to be displayed Mode display Displays the BARO Abbreviation of Barometer Displays the CALB during air pressure calibration Abbreviation of Calibration Clock time display Displays the time elapsed after activation in the range of 0 00 00 to 23 59 59 Only the digits of hours are zero suppressed Temperature display Displays the temperature calculated from the RC ADC conversion results If the 66 39 temperature is a negative value is displayed at one digit before the significant digit Displayable temperature values are in the range of 50 0 to 105 0 and zero suppression is performed to the displayed value It does not display immediately after Power ON and during air pressure calibration Air pressure display Displays the air pressure calculated from the SA ADC conversion results as a decimal number The range is 1100 to 500 and zero suppression is performed to the displayed value When temperature is out of range in air pressure measurement it is displayed as The air pressure will be set up as the present air pressure is displayed during air pressure calibration It does not display immediately after Power ON Pressure mark display Displays the hPa
2. Figure 4 3 The time display after power on O 2 o 9 0 0 C hPa Figure 4 4 A display during air pressure measurement 25 C R O 2 9 9 55 0 C hPa Figure 4 5 A display during air pressure measurement 5 5 C BARO 12 59 59 500 L 1 1 G hPa Figure 4 6 A display during air pressure measurement Temperature is outside of the air pressure measurement range CA LB 12 5 9 5 9 102 0 py Os hPa
3. AA PAO Ty en an a Ane dE Re Lea A Laie pate ae rete tL En kos eee aA a A AN Bee dad feta a IP hPa C Temperature Temperature display mark display Air pressure display Pressure mark display 29 4 3 Key Event The key events that the sample program handles are shown below Short press push Polling s performed at 128 Hz intervals from the time a key was pressed and a short press push is confirmed if a match occurs four times A short press melody is output if it is a valid event Short press release Polling is performed at 128 Hz intervals from the time a key was pressed and a short press release is confirmed if a match occurs four times but the key is released in less than 2 seconds Long press A long press is confirmed if a key is held down for 2 seconds or more Once a long press is confirmed no further long press event occurs even if the key is held down continuously Priority Key S1 gt Key S2 gt Key S3 gt Key S4 4 4 Functions of Sample Program Measurement of RC ADC and SA ADC 1s performed at intervals of 1 second 1 and the temperature calculated from the measurement result of RC ADC and the air pressure calculated from AD value of SA ADC are displayed on LCD And measurement time
4. 4 bits and it can distinguish that it is negative 11 3 ne 0 to OXFFFFFF count value 14 2 Temperature value OxF500 to 0x1050 distinguish that it 1s negative BRT value 0 to OxFFF Be Total 18 o S Data value 1s binary data BCD format The value which is multiplied by 10 is saved When Temperature value is negative it saves so that 1 may be set to higher 4 bits and it can 38 Revision History Revision History Edition Date Previous cu n Description Edition Edition prie 200 ital Eaton 40
5. SEMICONDUCTOR SQ003116E005 ML610Q400 Series Sample Program AP Notes For Barometer Application 2nd Edition Issue Date April 16 2010 NOTICE No copying or reproduction of this document in part or in whole is permitted without the consent of LAPIS Semiconductor Co Ltd The content specified herein is subject to change for improvement without notice The content specified herein is for the purpose of introducing LAPIS Semiconductor s products hereinafter Products If you wish to use any such Product please be sure to refer to the specifications which can be obtained from LAPIS Semiconductor upon request Examples of application circuits circuit constants and any other information contained herein illustrate the standard usage and operations of the Products The peripheral conditions must be taken into account when designing circuits for mass production Great care was taken in ensuring the accuracy of the information specified in this document However should you incur any damage arising from any inaccuracy or misprint of such information LAPIS Semiconductor shall bear no responsibility for such damage The technical information specified herein is intended only to show the typical functions of and examples of application circuits for the Products LAPIS Semiconductor does not grant you explicitly or implicitly any license to use or exercise intellectual property or other rights held by LAPIS Semiconductor and othe
6. Set HSCLK Initialize SA ADC control module saAdc_init function Wait for the amplifier to settle SA ADC Interrupt SADINT Start SA ADC conversion saAdc_execute function SA ADC conversion completion processing y Stop SA ADC conversion saAdc_execute function Acquire SA ADC conversion results saAdc_getResult function Stop operating the amplifier Figure 3 4 Conversion Procedure 25 Main Routine 1 2 3 4 5 6 7 8 Set HSCLK gt The SA ADC counts HSCLK to set conversion time therefore it is necessary to set the settings for HSCLK before conversion Initialize the SA ADC control module gt Set the following conversion conditions to the saAdc_init function and initialize the SA ADC control module Specify the number of times conversion is performed The number of times of conversion specifies Single AD conversion only in the case that AD conversion is performed by the differential amplification input Because the amplifier settling time is required before AD conversion starts Specify the range of clock frequency of HSCLK Specify the operating mode The AD conversion by the differential amplification input is specified Y Set the input offset of the 2nd amplifier Set the gain multiplication factor of the 2nd amplifier Wait for the amplifier to settle gt Wait the required time for t
7. temperature the count value of RC ADC AD value of SA ADC air pressure air pressure calibration value and the adjusted baud rate count value are saved at EEPROM 2 1 1 sec intervals here means that the time from the end of the first measurement of the temperature and air pressure to the start of the next measurement is 1 second In this sample program a measurement of the temperature and air pressure takes about 0 7 second Therefore time from the start of the first measurement to the start of the next measurement is about 0 7 1 1 7 second 2 The data saved at EEPROM can be transmitted to PC via UART And adjustment of the count value for UART baud rates is possible 30 4 4 1 State Transition 1 Reset by RESET_Npin or reset by WDT overflow System stn Initialization end y Barometer Application initialization Initialization end Long S3 press Short S3 press N ADC conversion that is N SA ADC conversion results in f SA ADC conversion results in E2PROM are being cleared performed at 1 sec intervals is E2PROM are being transmitted E Clearing complete being stopped Short S3 press or C transmission complete Short S2 press Short S2 press being activated Executes SA ADC SA ADC conversion that is performed at 1 sec intervals is A lapse of 1 sec conversion Long S4 press Short S4 press Short S2 press Air pressu
8. ADC result register 1L SADRIH SA ADC result register IH SADCONO SA ADC control register 0 SADCONI SA ADC control register 1 SADMODO SA ADC mode register 0 AMPOFES Amplifier offset register AMPGAIN Amplifier gain register AMPCONO Amplifier control register O Figure 3 1 Configuration of SA ADC Table 3 1 List of Pins No Positive power supply pin for successive approximation type A D converter Ver Reference power supply pin for successive approximation type A D converter As Negative power supply pin for successive approximation type A D converter AINO 1 Successive approximation type A D converter input pin 0 AINI 1 Successive approximation type A D converter input pin 1 11 Direct input A D conversion input voltage AY TS TSS TSS 12 bit ff PL Ware a TTT RATT SUCCESSIVE O S ER a approximation VADIN AN AA 24 type A D Variation range Vap n converter ias did AVss aran A A D conversion input voltage Amplification input j vas 12 bit urn Sn Wi successive Wein approximation 2nd amplifier variation range inversion amplifier AMPGAIN AMPOFFS type A D converter Amplifier input 3 voltage VAINx variation range A D conversion input voltage Differential amplification input AVop 12 bit o VREF ne successive Y 7 approximation Vapin AINO 58 a T amplifier type A D _ variation range ifferentia inversion Se converter Amp
9. FA Cy luF Rs0 10 Kohm AVpp 3 0V Clo 1uF Cs0 560 pF Viet 2 3V Cu 0 1uF Cvr0 820 pF C TUF R70 103AT Semitec thermister Rant 10 Kohm Cx 0 1uF Rano 33 Kohm Ca Cb Cc Cd 1uF Cane 100 uF C12 034 1uF R1 15 Kohm CaL o 0pF R2 1 Kohm CpL o 0pF R3 470 ohm Figure 2 2 Peripheral Circuit Diagram The number of COM SEG pin that can be connected to LCD panel depends on the type of the LCD driver built into the MCU Please see the chapter LCD Panel Specifications 2 3 LCD Driver ofthe User s Manual for your target MCU nn characters 7 segment characters 8 segment characters The 4 digits on the upper part of the a The 6 digits on the upper part of the panel The 12 digits on the lower part of the panel Marks for hand held calculator 7 Other marks 32 Figure 2 3 Layout of the LCD Panel Table 2 1 Pin Assignments COM SEG em a CT 11 rans e IEA I MJ ot a ZH WATE ef es at eb St DRESS Ji CIMI ZEHN NH 4P 40 aN 4M TEAR SE Cumapc AAT ERS EsJESEUEARSES et aD PN 25 2 28 eo 1 CBAR H 36 37 38 39 40 41 4 43 44 45 4 17 40 Com Sa 6F Ga IF 74 OF ade lO 310 mare be LaF 04 18 64 10 14 L4F A ETA CEE 3 106 108 Ba von te Cb 108 105 120 126 130 830 148 146 COMA SC 6E eC 7E 7C 8E x tete ie er ues pie He Pec Pe Pee Fae ac La mielalalsisislsieisieisielelelsisisieisiatoiniuiz cofia F
10. ML6100400 Series Demo kit Hardware User s Manual e nX U8 100 Core Instruction Manual e MACUS Assembler Package User s Manual e CCU8 User s Manual e CCUS Programming Guide e CCUS Language Reference e DTU8 User s Manual e IDEU8 User s Manual e uEASE User s Manual e uEASE Connection Manual ML610Qxxx e FWuEASE Flash Writer Host Program User s Manual e LCD Image Tool User s Manual 2 System Configuration 2 1 Hardware Configuration The following figure shows the hardware configuration on which the sample software runs LCD Power Supply f A PWR ML61004xx gt BUZZER SW reference board Internal A sum con gt Thermistor gt SSIO battery Internal Humidity sensor Ir External 1st 2nd 3rd 120 External 2 p Select SW gt A function T power Air pressure Select SW EEPROM sensor supply input 4 gt RS232C terminal eee EE IF ALL Control switch PO NMI RESET ML610Q400 Series Demo Board RS 232C 1 It is necessary to mount the air pressure sensor separately from ML610Q400 Series Demo Board and connect it via Successive Approximation Type A D Converter input pin on ML61004 x x reference board Figure 2 1 Hardware Configuration In the above hardware configuration the peripheral parts which are necessary for running
11. by dividing AVpp with the resistor of 10kQ and 33kQ Also the capacitor of 100uF is connected in order to prevent Vref from dropping caused by current draining into Vref pin when SA ADC measurement starts Ranz AVbDp 3 0V Vref 2 3V Rani 10kQ Rano 33kQO Cano 100uF About the electrical characteristics of SA ADC refer to the chapter Electrical Characteristics of the User s Manual for your target MCU 15 3 1 2 3 Air Pressure Calculation To calculate the air pressure in advance define Pressure AD value characteristic which is based on Pressure Voltage difference characteristic which is shown in the section 3 1 2 2 The air pressure is calculated by this characteristic and A D conversion result If we define the values of voltage difference when AD values are 0 and 4095 as Vdiff 0 and Vdiff 4095 respectively they are calculated as follows assuming that the offset of the amplifier is 0 Vdiff 0 OmV 1 2AVpp 25 5 58 823529 mV Vdiff 4095 2300mV 1 2AVpp 25 5 31 372549 mV From this result A D resolution is 58 823529 31 372549 4095 90 196 4095 0 022mV LSB When the input voltage of A D converter is 1 2A Vpp 1 5V AD value is calculated as follows 1 5 x 2 3 4095 2670 652 2670 x 2 3 4095 1 499634 1 499634 1 5 0 000366 2671 x 2 3 4095 1 500195 1 500195 1 5 0 000195 Because 2671 is the nearest AD value to 1 5V 1 2AVpp is defined as 1 5001
12. is minimized by using the following method 1 According to the equation 3 1 2 4 1 3 1 2 4 2 and 3 1 2 3 1 calculate air pressure using AD value at temperature T C Press t n Press Min Slope25 x Vas T n so 3124 3 Press tn Air pressure at T C when AD value is n n AD value at T C Vas T n Voltage difference at 25 C converted from voltage difference at T C by using the equation 3 1 2 4 2 Slope25 Slope of Pressure Voltage difference characteristic at 25 C It 1s the same as Slope in the equation 3 1 2 3 1 Press Min Minimum pressure of the range of A D conversion It is the same as Press_Min in the equation 3 1 2 3 1 2 Calculate air pressure in the equation 3 1 2 3 1 by using AD value which the calculation result of 1 is 101 3kPa 3 Define the difference between 1 and 2 as the correction value for air pressure The following shows the correction values which corresponds to each temperatures The sample program uses the correction value as the integer value in the unit of 0 1hPa Temperature Correction Correction value kPa value 0 1hPa 0 04323 O gt N 20 continued from the previous page 0 26346 9 0 29185 29 E gt 0 32171 E 20 38552 CA DADI 42 E 04546 45 o o 056866 57 0f 0 6094 6 IIS E T 9 5 0 83369 83 PG 088254 ge 0 98428 98 E 1 03715 oo 1 09181 The sample program uses the correction value which corresponds to
13. mark It does not display immediately after Power ON Temperature mark display Displays the C mark It does not display immediately after Power ON Measurement mark display During air pressure measurement 1 is displayed on the upper left 34 4 4 3 Description of UART Display SA1 00 00 01 SADR 123 BARO 1020 hPa CALB 0000 RC1 CNT 616A4 020 0 C UABRT 33 SA1 00 00 02 SADR 122 BARO 0999 hPa CALB 0000 RC1 CNT 616A3 019 9 C UABRT 32 SA1 00 00 11 SADR 011 BARO 0990 hPa CALB 020 RC1 CNT 5883C 10 0 C UABRT 33 SA1 00 00 12 SADR 012 BARO 0980 hPa CALB 020 RCI CNT 5883B 10 4 C UABRT 34 SA1 00 00 13 SADR 012 BARO hPa CALB 020 RC1 CNT 5B096 50 0 C UABRT 34 Content to be displayed Display data Type of ADC Displays the SA1 Measured clock time Displays in the range of 00 00 00 to 23 59 59 Measurement results A D value Displays in the range of 000 to FFF in the hexadecimal format after SADR Measurement results Displays in the range of 0000 to 9999 in the decimal format after air pressure value BARO Displays the when the air pressure stored in EEPROM is negative value Air pressure calibration value Displays in the range of 600 to 600 in the decimal format after CALB Displays the type of ADC Displays the RC1 Measurement results Count value Displays in the range of 000000 to FFFFFF in the hexadecimal format after CNT Measurement result
14. on ML610Q42X and ML610Q41X series MCU because SA ADC does not support the differential amplification input and the selection of amplifier gain and offset which are required for operating the application Also this sample program is not available on ML610Q48X series MCU because it does not have SA ADC 10 3 Description of Functional Modules 3 1 Air Pressure Calculation Module 3 1 1 Built in A D Converter 3 1 1 1 Configuration of SA ADC This MCU has a 2 channel successive approximation type A D converter SA ADC with a built in sample amp hold This SA ADC consists of two stages the first one being the first amplifier that supports differential amplification input and the second one being the second amplifier that allows gain and offset adjustment By combining these two amplifiers various analog input values can be measured In addition by short circuiting between input pins at the time of differential amplification input the offset value of the amplifiers can be measured AVoo Successive a approximation SS type AA A D AMPCONO AMPGAIN criar SADRnL y SADRnH AINO 1st amplifier 2nd amplifier l I l I l I l I l I I g differential inversion Analog AIN1 input amplifier selector I I ih l I i I AMPOFFS l SADCONO SADCON1 HSCLK 3 SADINT 4 096MHz 500KHz SADMODO a Data bus SADROL SA ADC result register OL SADROH SA ADC result register OH SADRIL SA
15. the temperature rounded off to integer value Example The correction value at 9 5 C s regarded as the correction value at 10 C 109 The correction value at 30 4 C is regarded as the correction value at 30 C 2 In this method the maximum error is 0 5728kPa 5 728hPa which is observed as the maximum error in the full scale range at 9 9 C Including the error due to A D resolution 0 41hPa LSB also the total error is 6 138hPa 21 3 1 3 Calibration When performing highly precise air pressure measurement a required calibration is shown The measured air pressure value shifts for every product A cause has the following 1 Offset voltage of the air pressure sensor Offset Typical voltage difference actual measurement of the output voltage from the sensor may differ minutely for every product of an air pressure sensor Thereby the input voltage to SA ADC may shift 2 Offset of the amplifier of SA ADC built in MCU Offset of the amplifier built by SA ADC may differ minutely for every product of MCU Thereby an A D conversion result may shift This sample has an air pressure calibrating function in order to solve this gap Compare reference air pressure value Pref with the air pressure measurement value Ps the result of Procedure 6 in the section 3 1 7 2 Air pressure calculation procedure calculated by this software and please correct Ps to become the same as Pref by key operation Henceforth air pressure c
16. y y v RS 232C Switch Air pressure connector sensor ML610Q400 Series Demo Board PC Communication software Figure 2 4 Software Configuration 2 5 List of Folders and Files The folders and the files are as listed below ar a Build result output folder ae ist 604 PEN ooo E UART baud rate correction module folder i adjustBaudrate c adjustBaudrate h barometer Pressure calculation module folder i Da aro c a h bold BLD control module folder Epic Bla chk sc clock Clock control module folder CLOCK CLOCIES ELOCK SYSFUNnese clock sysfunc h common General purpose function module folder COMMONS common h eeprom EEPROM control module folder i eeprom c zn az i I C communication control module folder oe a TES Interrupt control module folder Tr key Key input control module folder ae key h Lead LCD display control module folder LED G LED A ds ample tac Us Samples te main Sample program main folder mcu large L mcu h mcu small L mcu h eepromMap h main BAK malta E main h S610431SW asm S610435LW asm rt timer ES uart uart c uart h readme txt S16 div10 and mod asm Us Baro Sample large Pip Uo Baro sample mad PID ES E E pe continued from the previous page RC ADC control module folder Real time clock control module folder SA ADC control module folder Time base counter control module folder Temperature calculation
17. 95 in the sample program At this time the offset of AD value is set so that the voltage difference becomes 0 in Pressure Voltage difference characteristic The offset of AD value is calculated as follows Offset of AD value 2671 4095 1424 In the sample program in order to enable a fine adjustment of the range of A D conversion the start position of the air pressure calculation can be adjusted in units of 0 022mV by adjusting the offset of AD value 2671 offset erorrroporcrorororonoradoronorocnrrsrcos 851 O O TT lo Bar RE 0 035 B Nil Doffe EE E A ee S ae i Pef 0 50 0 1100 Per a Pure 0 227 50 0 1100 Pvss Pressure A D input voltage ure Pressure A D input voltage ea characteristic characteristic N50 AD value at 50 0kPa N110 AD value at 110 0kPa Pvss Pressure at Vapn 0 Pvref Pressure at V pmVref Note Because the second amplifier of SA ADC in MCU is the inversion amplifier AD value decreases when the input voltage increases When the value of AD value is n the equation which directly calculates air pressure from Pressure AD value characteristic is as follows Press n Press Min Slope x V_n 3 1 2 3 1 Press n Calculated air pressure Press Min Minimum pressure of Pressure Voltage difference characteristic 2 272876 kPa Slope Slope sensitivity of Pressure Voltage difference characteristic 110kPa SOkPa 57 452mV 25 453mV Vin Voltage difference which is con
18. ART Data Formats Table 4 1 shows the data format for UART transmission in SA ADC measurement mode Table 4 1 SA ADC measurement result transmission data format o Type of ADC SA Channel No SS to 1 due to the differencial amplification input Hs aoo Insert a space as a data delimiter 4 2 Hourdaa 00 to 23 BCD format 4 Insert a colon as a clock time delimiter Minute data DO to 59 BCD format Insert a colon as a clock time delimiter 10 2 Second data 00 to 59 BCD format 8 1 Space Cs Insert space as a data delimiter SADR IA 000 to FEF J 2 1 Spae Inserta space as a data delimiter BARO AN BCD format stored in EEPROM is negative value IhPa Insert hPa as air pressure unit A pr as a dala deini 2 37 5 CALB CALB e lt ehren RE ecotoma OOO O calibration value 46 Space Space Insert a space as a Insert a space as a data delimiter delimiter 47 2 TypeofADC RC ME et ee spees as a dala eimie CNT a Inserta ER S asa Insert a space as a data delimiter delimiter m 0 to 105 0 ICT Insert a T as temperature unit 7A 6 JUABRT _ u 77 3 BRTvaue 000 to FFF AA a termination of data Total Data value 1s text BE TE 36 4 5 EEPROM Memory Map The memory map of EEPROM in the sample program is shown below __ Address
19. _ Areaname o Size 0x0000 to Management information storage 15bytes Ox000E area AR o a fo to SA ADC measurement result 1800 bytes storage area for 100 0x0716 _ data items _ 0x0717 to Reserve area 30953bytes Ox7FFF 4 5 1 1 Management Information Storage Area Management information is stored in the following data format Table 4 5 Management Information Storage Area Storage Data Format U8AmpSample ASCII data The number of SA ADC measurement result data items that 23 Binary data have been stored A 2 l Reserve 0x0000 Total 15 37 4 5 1 2 SA ADC Measurement Result Storage Area SA ADC measurement results are stored successively in the following data format In the sample program the maximum number of data items that can be stored in the SA ADC measurement storage area is 100 Table 4 6 SA ADC Measurement Result Storage Data Format bytes AA Type of ADC O nn to 1 due to the differencial Channel No ie amplification input 0 to 23 BCD format a a a 1 BCD format I sc CE BCD format SA ADC value 000 FFF BCD format When an air pressure calculation result is an Air pressure value 0 to 0x9999 0xFFFF error data OxFFFF is saved An error is the case where the barometer calc function returns value other than BARO R OK BCD format When air pressure calibration value is a 0xF600 to 0x0600 Oe calibration value negative it saves so that 1 may be set to higher
20. able functional modules are different by target MCU due to the difference of MCU peripherals In the case that these functional modules are applied to user application available functional modules on each MCU are shown below Table 2 3 List of available functional modules Supported MCU ML610Q43X ML610Q42X ML610Q41X ML610Q48X SA ADC Control Module 4 o 2 Pressure Calculation Module RC ADC Control Module 4 Frequency measurement mode 4 l I2C Communication Control Module 4 Functional EEPROM Control Module 4 modules LCD Display Control Module 4 Key Input Control Module 4 RTC Control Hardware RTC o Available x Not available Frequency measurement mode by hardware is not available on ML610Q415 because it does not have low speed crystal oscillation clock 2 Function that uses the differential amplification input or the selection of amplifier gain and offset is not available 3 All display area of LCD panel can not be available because the number of SEG pin that is connected to LCD panel is not enough 4 For the details of these modules please see the ML610Q400 Series Sample Program AP Notes For Sensor Mesurement Application 5 For the details of these modules please see the ML610Q400 Series Sample Program AP Notes For RTC Application 2 7 2 About Functions of Sample Program This sample program is available on only ML610Q43X series MCU Note This sample program is not available
21. alibration value Pref Ps is added to the measured air pressure value This value is determined as final air pressure value For key operation method refer to 4 4 Functions of Sample Program Moreover when air pressure calibration value is known beforehand AD value which is counted backward from air pressure calibration value can be added to the measured A D conversion result In this case please calculate AD value equivalent to an air pressure calibration value and set the value to the following variable AD value equivalent to air pressure calibration value For example when air pressure calibration value is 5hPa AD value equivalent to this can be calculated as follows AD value equivalent to air pressure calibration value Arr pressure calibration value Air pressure resolution per 1 AD value Air pressure calibration value Slope of Pressure Voltage difference characteristic x AD resolution ShPa 1100hPa 500hPa 57 452mV 25 453mV x 90 196mV 4095 x 1 AD resolution is multiplied by 1 because the input from the air pressure sensor is inverted when A D conversion is carried out 5hPa 0 41hPa 12 22 3 1 4 API Function The API function which this module provides is explained below 3 1 4 1 barometer_calc Function This function calculates the air pressure on 25 CTypical condition from AD value of SA ADC Air pressure is returned as the result of calculation in un
22. device LAPIS Semiconductor shall bear no responsibility in any way for use of any of the Products for the above special purposes If a Product is intended to be used for any such special purpose please contact a ROHM sales representative before purchasing If you intend to export or ship overseas any Product or technology specified herein that may be controlled under the Foreign Exchange and the Foreign Trade Law you will be required to obtain a license or permit under the Law Copyright 2009 2011 LAPIS Semiconductor Co Ltd Table of Contents 1 POVERNE WESEN Zar ee a es see sen a esse 2 Ze SYSTEM CONFIGURATION 00 desscccsededuscicvessiusiccedesaccsseabcnccdescecescseuaieosdstavessecuaceateosees 3 2 HARDWARE ONEIGURATION EHE ia 3 22 PERIPHERAL GIRGUIT DIAGRAM SE ea dosis neat A 2 3 KGDIPANELSPEBIEICATIONSEE een ickdvenduatastecdalcualnataemaad nes 5 22 SOFTWARE CONFIGURA O N dr dciad 6 2 5 EISTOP FOLDERS AND LES nee ee ee 7 2 6 BUILDIPROGCEBDU RE wessen ee nee ee 9 2 AVES TIS TION Sl else Dreier 10 3 DESCRIPTION OF FUNCTIONAL MODULES ccccccscccccccccccccccccccccccccccccccccccccccccccccccccccccccccsccoes 11 3 1 AIR PRESSURE CALCULATION MODULE E22 ne ee een 11 4 DESCRIPTION OF THE SAMPLE PROGRAM sesscsesecsesecccsecsecsesecccsecsecccsecseoscceccosesesecseseosesesecseseocosesesseseseosese 28 4 1 GOMMON SEEGIFICATIONS ae ee a ee duced ee 28 4 2 CONFIGURATION OF THE LCD PANEL c ccccc
23. e calculation procedure The procedure from the temperature measurement to the air pressure calculation by using the air pressure calculation module is shown Main Routine 1 RC ADC conversion gt This sample performs RC ADC conversion required for temperature calculation in order to carry out temperature correction to the calculation result of air pressure NOTE For RC ADC module details refer to 3 2 RC ADC Control Module of ML610Q400 series sample program AP note sensor measurement application Temperature calculation Temperature value is calculated from the conversion result of RC ADC based on the frequency ratio temperature conversion table for thermistor 103 AT NOTE For SA ADC module accuracy refer to 3 3 Temperature Calculation Module of ML610Q400 series sample program AP note sensor measurement application VX 3 SA ADC conversion gt The AD conversion of the voltage difference between AIN1 and AINO pin is carried out For details refer to the section 3 1 7 1 4 AD value correction gt The AD value equivalent to air pressure calibration value is added to the acquired AD result adcOffset default is 0 5 Air pressure calculation gt The air pressure value is calculated with barometer_calc function using the acquired AD result and air pressure calculation table for air pressure sensor HSPPAROO3C gt When temperature is outside of the measurement range 40 1 C or more less than 10 C the calculat
24. er your target MCU s startup file In the case of ML610Q432 it is S610432SW asm 4 Define the macro that represents the target MCU Select the menu Project gt Options gt Compiler assembler gt Macro tab In the displayed window define the macro like following name _ML610Q4XxX About the XX part replace with the type number of MCU For example if ML610Q432 is used define the following macro _ML6100Q432 In the case that the macro other than the type number in the above Table 2 2 1s defined the case that macro such as above 1s not defined or the case that the memory model that s supported by PID file 1s different from the memory model of MCU that is defined by the above macro the compiler issues the following error at the beginning of the output messages Error E2000 error Unknown target MCU 5 Ifnecessary modify other macro definitions About the available macro definitions see the readme txt in the sample program folder For ML610043X series MCU LCD TYPE 1 FREQ TIMER MODE 0 _RTC TYPE _SAADC_REG Select the menu Project gt Rebuild Then the build procssing for the sample program starts When the build processing is completed abs file is generated in the project folder and hex file is generated in _output hex folder 2 7 Restrictions 2 7 1 About Available Functional Modules In the functional modules that compose this sample program the avail
25. fset of AD value is lower than 2198 Therefore the table address is determined to 1 Table address 1 BaseAd 2198 BasePress 2063868 Calculate air pressure by using the table parameter Press _623 2063868 1058 2198 623 1424 gt gt 8 2063868 1058 151 gt gt 8 2063868 159758 gt gt 8 2223626 gt gt 8 8686 gt 868 6 hPa 18 3 1 2 4 Temperature Dependence of Voltage Difference The voltage difference of the air pressure sensor changes depending on temperature Therefore the temperature correction 1s necessary for accurate measurement The temperature characteristic of the sensor is described below The air pressure at the temperature T C is calculated from Pressure Voltage difference characteristic at 25 C by using the following equation V gt 5 T Vt Vt 1 Kt T ss 3 1 2 4 1 V gt s T Vt Voltage difference at 25 C converted from voltage difference at T C Vt Voltage difference at T C Kt T Temperature correction value Kt T Ax T 25 B x T 25 A 6 88 x10 B 7 41 x10 Press_t T V25 T Vt Intercept25 Slope25 eu 13 1249 Press _t T Air pressure at T C Slope25 Slope of Pressure Voltage difference characteristic at 25 C Intercept25 Intercept of Pressure Voltage difference characteristic at 25 C 19 The sample program correct the air pressure calculation result simply so that the error due to temperature dependence at 101 3kPa 1013hPa
26. g clock 2 kHz e Bias 1 4 bias for the ML610Q431 Q432 1 3 bias for the ML610Q41 1 Q412 Q415 fixed by hardware e Duty 1 4 duty e Frame frequency 73 Hz 5 RTC e Initial value ofa date 00 01 01 e Initial value of time 23 59 57 e Initial value of the day of the week 1 Sunday 6 SA ADC e Conversion count e HSCLK 375 kHz to 1 1 MHz e Operating mode Differential amplification input e Input gain and offset gain 25 5 offset 0 7 RC ADC e Channel 0 e Reference clock LSCLK e Oscillation mode RSO CSO oscillation RTO CSO oscillation 8 Temperature measurement range and accuracy e 30 to 65 C 41 C 50 to 31 C and 66 to 105 C 2 C 28 4 2 Configuration of the LCD Panel The following subsections describe the LCD panel configuration and types of display The LCD panel has two types of display patterns depending on the type of the LCD driver built into the MCU one with the display allocation function and the other without it The section from here onward assumes that the LCD panel is equipped with the display allocat on function 4 2 1 LCD Display Image with Display Allocation Function The display allocation function is available if DSPMOD1 s DASN bit 2 can be set to 1 The display image in this case is shown below Measurement Clock t displ mark display Mode display OCK time display 1
27. he amplifier settling more than 94us Start SA ADC conversion gt Specify the channel 0 to the saAdc execute function and start SA ADC operation Wait for SA ADC conversion completion gt Wait until SA ADC interrupt occurs conversion complete Stop SA ADC conversion gt Specify stopping of conversion in the designated parameter of the saAdc_execute function and stop SA ADC operation Acquire SA ADC conversion results gt Specify the channel 0 number to the saAdc_getResult function and acquire the SA ADC conversion results In a differential amplification input the conversion result of a channel 0 1s surely acquired Stop operating the amplifier gt In order to reduce power consumption shut off the power supply for the amplifier by setting the analog input as the direct input In the sample program it sets the following conditions to the saAdc_init function and initializes the SA ADC control module to the initial setting after power on Specify the number of times conversion as Single AD conversion only Specify the range of clock frequency of HSCLK as 1 5MHz 4 2MHz Specify the operating mode as the direct input Y Set the input offset of the 2nd amplifier as 0 Set the gain multiplication factor of the 2nd amplifier as 1 time SA ADC interrupt SADINT 1 SA ADC conversion completion processing gt The SA ADC interrupt processing sets the flag that indicates conversion completion 26 3 1 7 2 Air pressur
28. he official driving voltage of the sensor 1s from 3 85V to 2 75V Because the sample program assumes that the sensor is drived by dry cell battery it is designed so that the sensor is drived within 3V by reducing the driving current to 0 4mA In this case the output voltage becomes 1 1 375 0 55 0 4 1 375 13 3 1 2 1 2 Software The following shows the operating conditions of software application Range of measurement pressure SO0hPa 1100hPa It is the same as the air pressure sensor m Unit of the pressure displayed on LCD IhPa Operating temperature 10 C 40 C m Aaccuracy pressure difference x 1 3 hPa 10 C 40 C 500hPa 1100hPa pressure difference x 1 6 138 hPa 10 C 5 C lower than 784hPa 3 1 2 1 3 Peripheral Circuit Composition of Sensor Figure 3 3 shows the circuit diagram for air pressure measurement Because the manufacturer recommends using a constant current for the sensor driving current the constant current circuit is connected to the sensor The driving voltage of the sensor must be lower than the maximum output voltage of the operational amplifier which is used for the constant current circuit In the case that the power supply for the operational amplifier is the same as the power supply for MCU 3V please be careful that the value of R3 70009 x driving current in Figure 3 3 must be lower than 3V ML610Q4XX 3V R1 Vin R2 R1 15KQ Cons
29. ion itself is skipped and hPa is displayed 6 Temperature correction gt The air pressure correction value corresponding to the acquired temperature is acquired from an air pressure compensation table For details refer to the chapter 3 1 2 4 gt The air pressure is calculated by adding the air pressure correction value to the calculation result of barometer_calc function 7 Air pressure car bration gt The air pressure calibration value acquired by the calibration is added to the present air pressure gt The final air pressure value is rounded within the limits It s fixed to 500hPa when air pressure value is less than 500 hPa It is fixed to 1100hPa when air pressure value is larger than 1100hPa NOTE When not performing temperature correction the procedure of 1 and 2 s not needed 24 4 Description of the Sample Program The following shows the functional specification of the sample program 4 1 Common Specifications 1 System clock e SYSCLK HSCLK RC oscillation mode 500 kHz 2 UART e 9600 bps 8 bit no parity 1 Stop bit positive logic LSB first To use RS232C interface mounted on ML610Q400 Series Demo Kit it is necessary to set P42 and P43 as a secondary function by selection of a port function jumper switch short circuit between 2 1 pins on ML610Q400 Series Demo Kit 3 Timer e Channels 0 1 16 bit mode operating clock LSCLK overflow interval 10 ms 4 LCD driver e Bias voltage multiplyin
30. its of 0 1hPa Example In the case of 1013 3hPa it s 10133 In case that 1t converts into a hectopascal calculate 1t to 1 10 Function int barometer_calc name unsigned short adc_value signed short adc_offset_ value unsigned short baro tBaroTableList pTbl Arguments unsigned short adc_value AD value signed short adc_offset value A D offset value When not adjusting the start A D value of the air pressure calculation specify 0 unsigned short baro Pointer to the area which stores air pressure 0 1 hPa unit Example In the case of 1010 5hPa it s 10105 tBaroTableList pTbl Pointer to an air pressure calculation table int Air pressure calculation succeeded BARO R OK 0 AD value AD offset val is larger than maximum value BARO MAX AD VALUE BARO R ERR H 1 AD offset value is larger than BARO MAX AD OFFSET VALUE BARO R ERR H 1 AD offset value is smaller than BARO MIN AD OFFSET VALUE BARO R ERR L 2 23 3 1 5 List of Constants Table 3 1 Constants for Return Values Constant name Defined Description value BARO R OK Processing succeeded BARO R ERR H 1 gt AD value is larger than 4095 gt AD offset value is larger than maximum value FRARO MAX AD OFFSET VALUE gt AD value AD offset value is larger than maximum value RARO MAX AD VALUE BARO R ERR L 2 gt AD offset value is smaller than minimum value RARO MIN AD OFFSET VALUE Table 3 6 Constant for Calculati
31. lifier input AINI i fi Van put amphign voltage difference Va ngir Variation range AMPGAIN AMPOFFS VA naitt Vai Vamo Figure 3 2 Amplifier Configurations For details refer to the chapter Successive Approximation Type A D Converter SA ADC of the User s Manual for your target MCU 3 1 1 2 Input voltage for A D converter in differential amplification input setting The following equation 3 1 1 2 1 shows the theoretical equation for the output voltage from the second amplifier of SA ADC in differential amplification inupt setting Vapin AINI AINO x AmpGain_ Ist Ratio AmpOffset x AVpp x AmpGain_ 2nd x 1 1 2 Ratio AmpOffset xAVpp xn 13 21 1 2 1 V ADIN Input voltage to A D converter That is the output voltage from the second amplifier AINI AINO Voltage difference between two input pins AIN1 and AINO AmpGain_Ist Gain of the first amplifier It is fixed to 3 times AmpGain 2ndx 1 Gain of the second amplifier It is selected by AMPGAIN register The multiplication of 1 is due to the inversion amplifier Ratio AmpOffset Amount of the input offset of the second amplifier It is selected by AMPOFFS register Example for calculating the input voltage to A D converter V pm is shown below Conditions u AVpp is 3V m Gain of the second amplifier is 1 m Amount of the input offset of the second amplifier is 6 Voltage difference between two input pins is 0 3V Vapi
32. module folder Timer control module folder UART communication control module folder Description of compile options Sample program assembler code Divl10 Project file for large model MCU Project file for samll model MCU 2 6 Build Procedure Start IDEU8 select the menu Open and open the project file PID file In the case that MCU memory model is small model the project file is US Baro Sample Small PID In the case of large model the project file is U8 Baro Sample Large PID Correspondence of MCU and PID file is shown below Table 2 2 Correspondence of MCU and PID file Us Baro Sample Small PID Us Baro Sample Large PID ML6100Q431 432 ML610Q435 436 Supported MCU In the default setting ML610Q431 is set as the target MCU If your target MCU 1s different follow the procedure below to change the setting 1 Select the menu Project gt Options gt Compiler assembler 2 In the displayed window select the target MCU from the Target microcontroller list in the General tab Also modify the following option in the Additional options field in the Assembler control group DEFTARGET TYPE M6104XX About the XX part replace with the type number of MCU For example if ML610Q432 is used input the following option DEFTARGET TYPE M610432 3 Remove the startup file S6104315SW asm registered in the file tree of IDEU8 Instead of that regist
33. n 0 3 x3 0 063 x 1 x 1 1 2 0 06 x3 0 9 0 18 1 68 0 6 V 12 3 1 2 Measurement by Air Pressure Sensor To measure air pressure the sample program introduces the air pressure sensor using effect of piezo resistive bridge circuit The value of air pressure is calculated from the voltage difference between two output pin of the sensor To perform A D conversion of the voltage difference as the analog input signal use SA ADC in differential amplification input setting This AP note describes how to mesure air pressure from the actual output of the sensor which is obtained by the differential amplification input setting 3 1 2 1 Operating Conditions This section describes the operating condition valid range and restrictions for the air pressure measurement 3 1 2 1 1 Hardware The following shows the operating conditions of hardware MCU and air pressure sensor Power supply 3V m Vref 2 3V describe later m AVss OV FGND Characteristics of the air pressure sensor 1s shown in Table Manufacturer 3V m Product number HSPPAROO3C m Classify of Pressure Absolute Table 3 2 Characteristics of air pressure sensor Item Unit Driving current Driving current 0 55mA 0 4mA Range of measurement kPa 50 0 110 0 pressure Driving Voltage Max V 385 28 M2 TA a E a Full Span e Ouiput Voltge 10kPay The data at 101 3kPa is a reference value m Driving current 0 4mA T
34. on parameter Constant name Defined Description value BARO FLOATING LEN Number of integer compensation bits of air pressure calculation BARO MAX AD OFFSET VALUE 1155 Maximum AD offset value BARO MIN AD OFFSET VALUE 1456 Minimum AD offset value BARO MAX AD VALUE 2940 AD value at the minimum air pressure when AD offset is 0 AD value at 49 97kPa BARO MAX TBL NO 4 Air pressure calculation table size Number of division of the air pressure measurement range BARO SLOPE 1058 Slope of air pressure calculation For details see the chapter 3 1 2 3 3 1 6 Structures This section describes the structures referred in the air pressure calculation table Air pressure calculation table Typedef struct unsigned long basePress Base air pressure unsigned short baseAd Base AD value tBaroTableList Table 3 7 Air pressure calculation table setting value Table address Defined value Air pressure range baseAd basePress hPa 1806 2478326 2198 2063868 968 gt x gt 806 1 2567 1673727 806 1 gt x gt 653 7 2940 1279357 653 7 gt x gt 499 7 24 3 1 7 Sample of Use The subsection below shows the sample which uses the functional module offered w th sample software 3 1 7 1 A D Conversion Procedure The procedure which uses SA ADC module from the initialization to the acquirement of A D conversion result by the differential amplification input setting is shown below Main Routine
35. r parties LAPIS Semiconductor shall bear no responsibility whatsoever for any dispute arising from the use of such technical information The Products specified in this document are intended to be used with general use electronic equipment or devices such as audio visual equipment office automation equipment communication devices electronic appliances and amusement devices The Products specified in this document are not designed to be radiation tolerant While LAPIS Semiconductor always makes efforts to enhance the quality and reliability of its Products a Product may fail or malfunction for a variety of reasons Please be sure to implement in your equipment using the Products safety measures to guard against the possibility of physical injury fire or any other damage caused in the event of the failure of any Product such as derating redundancy fire control and fail safe designs LAPIS Semiconductor shall bear no responsibility whatsoever for your use of any Product outside of the prescribed scope or not in accordance with the instruction manual The Products are not designed or manufactured to be used with any equipment device or system which requires an extremely high level of reliability the failure or malfunction of which may result in a direct threat to human life or create a risk of human injury such as a medical instrument transportation equipment aerospace machinery nuclear reactor controller fuel controller or other safety
36. re calibration Short S3 press Figure 4 2 State Transition Diagram SA ADC Measurement 31 System initialization Barometer Application initialization SA ADC that is performed at conversion l sec intervals is being stopped SA ADC conversion that s performed at l sec intervals is being activated SA ADC conversion results in E2PROM are being transmitted SA ADC results in E2PROM are being cleared conversion Air pressure calibration After power on the barometer application will be in this state The signature of EEPROM preservation area is checked and the writing of the signature of this sample and clear of reserve area The number of the saved SA ADC conversion result is read from EEPROM and barometer application is initialized A short S2 key press starts SA ADC conversion A short S3 key press transmits the SA ADC conversion results stored in EEPROM A long S3 key press clears the SA ADC conversion results stored in EEPROM Performs temperature measurement and SA ADC conversion at 1 sec intervals and corrects baud rate The calculation result of air pressure is displayed in the Air pressuer display area of the LCD as a decimal number Stores the elapsed time conversion results and corrected baud rate in EEPROM A short S2 key press stops SA ADC conversion A long S4 key press SA ADC conversion is stopped and it shifts to air pressure calibration But when it is the following conditions i
37. s Temperature value Displays in the range of 50 0 C to 105 0 C in the decimal format Baud rate count value Displays in the range of 000 to FFF in the hexadecimal format after UABRT 4 4 4 Explanation of Key Operation 4 4 4 1 SA ADC measurement Operation Es No effect Long press No effect s2 Sho men Starts stops SA ADC measurement sa ee press No effect Starts stops transmission of the SA ADC measurement result data stored in EEPROM Short press Other than during data transmission gt Starts data transmission During data transmission gt Stops data transmission Long press _ press Long press Clears allthe SA ADC measurement result data stored in EEPROM No effect It shifts to air pressure calibration L O O Ons PLESS It does not shift when measurement temperature is the outside range of 10C to 40C 4 4 4 2 Air pressure calibration 5 Ten eg No effect si Short press_ press No effect The air pressure value to display is increased by 1 Short press A maximum is 1100hPa or the measured air pressure which could not be calibrated plus 600hPa Long press No effect The air pressure value to display is decreased by 1 Short press A minimum is 500hPa or the measured air pressure which could not be calibrated minus 600hPa Long press No effect sa Shes press It shifts to the SA ADC measurement sa Shoe press No effect 35 4 4 5 U
38. sseecccccescecccccaccecccccusceeccccucceeccceuesccceeaucsecessuceececsuateccecuuansess 29 As EYEWE NT peste ct eects tate cated ee en esse Seen oe nf 30 4 4 FUNCTIONS OF SAMPLE PROG RAM scccccccseeeccccascecccccucseccccusecceccuusececeuusececeuescccscuuceccessusesececsuucsececauaesess 30 4 5 EEPROM MEMORY MAP cccccccccseecccccccecccccuscecccccucceccccusecccccucseccceucesececsueececeuauseccssueneececuuacsececauaesess 37 1 Overview This document describes the application programming notes hereafter called the AP notes arranged to help customers develop software that by using the Successive Approximation Type AD Converter which is hardware that the ML610Q400 Series MCU hereafter called the MCU has performs air pressure measurement as the barometer APIs are provided for each function module The AP notes describe the functions and operating conditions of each API and samples of use of those APIs In connection with the AP notes a sample program is provided that actually operates using APIs on ML610Q400 Series Demo Kit Related Documents The following are the related documents Read them as required e ML610Q400 Series Sample Program AP Notes For Sensor Mesurement Application e ML610Q400 Series Sample Program API Manual e ML6100431 ML6100432 User s Manual e ML6100435 ML6100436 User s Manual e ML610Q411 ML610Q412 ML610Q415 User s Manual e ML610Q421 ML610Q422 User s Manual e ML610Q482 User s Manual e
39. t does not shift to air pressure calibration gt Measured temperature is outside renge of 10 to40 When transmission of all data has been completed a transition is made to the SA ADC conversion that is performed at 1 sec intervals is being stopped state A short S3 key press stops transmission and makes a transition to the SA ADC conversion that is performed at 1 sec intervals is being stopped state After clearing the number of the saved SA ADC conversion result is read from EEPROM a transition is made to the SA ADC conversion that is performed at 1 sec intervals is being stopped state A short S2 S3 key adjusts the air pressure value currently displayed S2 key The air pressure value to display is increased by 1 A maximum is 1100hPa or the measured air pressure which could not be calibrated plus 600hPa S3 key The air pressure value to display is decreased by 1 A minimum is 500hPa or the measured air pressure which could not be calibrated minus 600hPa A short S4 key press makes a transition to the SA ADC conversion that is performed at 1 sec intervals is starting state When you operate a sample program for the first time in order to avoid incorrect operation please clear the data of EEPROM by a long S3 key press 32 Description of LCD Display B A R O
40. tant R3 4700 Vin 0 1875V current circuit 13 0 4mA Figure 3 3 Circuit diagram for air pressure measurement 14 3 1 2 2 Range of A D Conversion According to Table 3 2 the output voltage difference of the air pressure sensor in 50kPa and 100kPa can be obtained By using the equation 3 1 1 2 1 in the section 3 1 1 2 the input voltage to A D converter can be calculated and the result is shown in Table 3 3 Voltage difference V ADIN mV V N OF ut SD heute ten A IAN MEERE EE 0 851 O E PAOA E OE E E A E A B D5 ASS ee 0 035 0 3 Pressure kPa 0 2 27 50 0 101 3 110 0 56 58 0 50 0 110 0 Pressure kPa 101 3 Pressure Voltage difference characteristics Pressure A D input voltage characteristics Table 3 3 Characteristics of air pressure sensor Pressure Sensor output Input voltage to kPa voltage A D converter difference mV V 25 4533 0 850941 101 3 52 81207 0 153292 57 45185 0 034978 CADA SS Ses The pressure when the sensor output voltage difference is OmV is a reference value Because the range of the input voltage is from 0 851 to 0 03V which corresponds to the air pressure measurement range from 50kPa to 110kPa it is desirable that the voltage of Vref is set to the same voltage as one at 110kPa 0 851V But Vref must be higher than 2 2V due to the electrical characteristic of SA ADC in MCU Therefore in the sample program Vref is set to approximately 2 3V
41. tea ier 170 va 166 166 A iaa 156 ena EBEN eur een EI om 15 Co coe tse ta ar a es est ces a 201 i El 2 comal ise se 16 16 ac 190 180 16 sre fiac 15 enc 20 aic enc eet eee E vr La COMA 15H 150 1 164 1160 176 170 064 160 te 1541020200120 20 eeu een IT MeL LL Specifications of Operation Clock for bias generation circuit voltage multiplication Bias of the bias generation circuit Duty Frame frequency 1 16 LSCLK 2 kHz 1 4 1 4 duty 73 Hz 2 4 Software Configuration Figure 2 4 shows the software configuration Sample Program Adjust Key EEPROM Temperature Air pressure Baudrate Moduls Module conversion calculation Module Module Module UART ro RC ADC SA ADC LCD RTC Timer Clock Module Module Module Module Module Module Module Module pe eee _ _ _ OT TOO Software y Yy y Yv y y y y y y y ye ae UART TBC Porto 12C RC ADC SA ADC Lene RTC Timer Clock U8 internal functions External components EEPROM Thermistor LCD 103AT panel
42. the base AD value AD value which corresponds to the minimum air pressure in the divided range BasePress The value of the minimum air pressure in the divided range BasePress The integer value made by shifting BasePress N bit to left The base air pressure set in air pressure calculation table The air pressure calculation table is shown in Table 3 4 The value of BasePress is registered in this table after shifting N bit to left in order to reduce the number of calculation operations Table 3 4 Air pressure calculation table Parameter Range of air pressure hPa Table address BasePres 0 1806 968hPax2 x gt 968 806 1 hPa x2 653 7 hPa x2 499 7 hPa x2 653 7 gt x gt 499 7 17 Press n Press n01 Slope x BaseAd 0 n01 AD _Offset BasePress_0 Po LS Press _nl2 Slope x BaseAd_1 nl2 AD Offset BasePress_ 1 E AN Press_n45 Slope x BaseAd_5 n45 AD_Offset BasePress_5 BaseAd 4 00 i 4095 BaseAd 1 BaseAd_5 AD value n gt Pressure AD value characteristic Here the maximum error between the linear approximation and actual characteristics is e If e is larger than the maximum error for measuring air pressure it is necessary to make a finer portion and redo the approximation procedure Example of calculation In the case that AD value is 623 and offset of AD value is 1424 Look up the air pressure calculation table AD value of
43. the sample software are shown below Peripheral parts The number of Descriptions peripheral parts Control switch 4 The switch S1 S2 S3 and S4 are used to change mode or control the application Thermistor Air pressure sensor EEPROM LCD panel RS 232C interface Baud rate 9600bps Data 8bit Parity bit none Stop bit 1 bit 2 2 Peripheral Circuit Diagram The circuit of MCU circumference is connected as shown in the following figures Please be careful that it is different from the default connection on the reference board of ML610Q431 attached to ML610Q400 Series Demo Kit Please see 3 1 2 2 Range of A D Conversion about the details of the composition of the reference voltage AVref terminal portion of SA ADC In order to use the output of an air pressure sensor in the differential amplification input of SA ADC both AINO pin and AIN pin are connected to an air pressure sensor Please see 3 1 2 1 3 Peripheral Circuit Composition of Sensor about the circuit composition of the air pressure sensor circumference LCD Coin Cell O Es O 0 COMO 3 SEGO 63 NMI EXVDDV EXGND he oo 77 O ae ML610Q4xx P31 CS0 Cx P32 RSO Ca P33 RTO GE AVoo Ch AV ret Ca AVss C34 1 4 Bias Cio Cal LMV321 ATO OUTPUT IN_ V c IX DL XT1 P22 P20 P41 P40 P42 P43 re MDO RXD TXD SCL SDA F mwd HAPPAR003C Buzzer ICL2332 GND Riln e V V ite P SCL SDA Vcc GND TXD RXD 9 pin D SUB IC EEPROM A2 Vss
44. verted from A D to 90 196mV 4095 x n 16 In the sample program in order to reduce the error n calculation of air pressure the range of air pressure measurement 50kPa 110kPa is divided and the calculation parameters for each divided range is saved in ROM table If the air pressure sensor is changed please change also this calculation table to match with the sensor s characteristics In the air pressure calculation in order to calculate real number as integer a significant figure of each operand in the above equation is adjusted that is shifted N bit to left Press n BasePress lt lt N Slope lt lt N x Inverted n Inverted BaseAd gt gt N BasePress Slope x BaseAd n AD Offset gt gt N Assume that N 8 AD Offset Offset of AD value 1424 Inverted n 4095 AD value AD Offset After this Inverted means that 4095 AD value AD Offset Slope Slope x 90 196mV 4095 x 100 0 0413 x 100 This is a part of the equation 3 1 2 3 1 It is multipled by 100 in order to perform the calculation in the unit of hPa Slope The integer value made by shifting Slope N bit to left 1058 In the case that N is 8 Slope multiplied by 256 1s 1057 291469 But considering that the calculated result Press_n is rounded down by shifting to right later Slope is rounded up so that the end result of calculation becomes higher value BaseAd The value of
Download Pdf Manuals
Related Search
Related Contents
USER'S MANUAL Francese (classi 2) inscription mode d`emploi sept 2012 Anti-Bark Spray Collar™ Deluxe PBC00-12104 Network Video Recorder User Manual Abrir - Loctite THIECOM informiert über neue Artikel und Produkte Samsung Galaxy Y Duos Εγχειρίδιο χρήσης Copyright © All rights reserved.
Failed to retrieve file