5秒后页面跳转
AN1950 PDF预览

AN1950

更新时间: 2022-12-20 04:38:19
品牌 Logo 应用领域
飞思卡尔 - FREESCALE 监控
页数 文件大小 规格书
24页 298K
描述
Water Level Monitoring

AN1950 数据手册

 浏览型号AN1950的Datasheet PDF文件第3页浏览型号AN1950的Datasheet PDF文件第4页浏览型号AN1950的Datasheet PDF文件第5页浏览型号AN1950的Datasheet PDF文件第7页浏览型号AN1950的Datasheet PDF文件第8页浏览型号AN1950的Datasheet PDF文件第9页 
where H1 and H2 are the maximum and minimum water levels  
respectively and D is the possible datapoints available per  
character.  
bintasc Function  
The binasc function converts a binary value to its ascii  
representation.  
Resolution = (160mm– 0mm) / 8.0 = 20 mm / data point.  
A/D Functions  
The graphical history is displayed using the eight special  
characters. To update the graphics, all the characters have to  
be updated. The characters are updated by first positioning a  
pixel for the most recent water level reading in the first column  
of the first character. Then the four right columns of the first  
character are shifted to the right. The pixel in the last column  
of that character is carried to the first column of the next  
character. This column shifting is continued until all 40 data  
points have been updated in the eight special characters.  
The A/D functions are used to input the amplified voltage  
from the pressure sensor from channel 0 of the A/D converter.  
The function adcbyti will set the A/D control register, wait for  
the A/D reading and load the data from the A/D data register  
into the accumulator. The function adcbyta is used to obtain an  
averaged A/D reading by calling adcbyti 256 times and  
returning the resulting average in the accumulator.  
LCD Functions  
LfNx Function  
The LCD hardware is set up for multiplexing three pins from  
the microcontroller using an eight-bit shift register. Channels  
three, four, and five are used on port A for the LCD enable (E),  
the LCD reset (RS), and the shift register clock bit,  
The LfNx function calculates the water level from the  
current A/D pressure reading. The A/D Pressure value is  
stored in Register A before this function is called. Using the  
A/D value and the calibration values stored in the flash, the  
water level is calculated from the following function:  
respectively. The clock bit is used to manually clock data from  
channel four into the eight-bit shift register. This is the same  
line as the LCD RS bit because the MSB of the data is low for  
a command and high for data. The RS bit prepares the LCD  
for instructions or data with the same bit convention. When the  
eight bits of data are available on the output pins of the shift  
register, the LCD enable (E) is toggled to receive the data.  
The LCD functions consist of an initialization function lcdinit  
which is used once when the system is started and five output  
functions. The functions lcdcmdo and lcdchro both send a  
byte of data. The function shiftA is called by both lcdcmdo and  
lcdchro to manually shift eight bits of data into the shift register.  
The function lcdnibo converts the data to binary before  
displaying. The lcdnibo displays a byte of data by calling  
lcdnibo for each nibble of data. The function lcdnibo enables  
strings to be easily added to the software for display. The  
function accepts a comma- delimited string of data consisting  
of 1–2 commands for clearing the screen and positioning the  
cursor. It then continues to output characters from the string  
until the @ symbol is found, signally the end of the string.  
RBRA: = (NX –N1) * 160 / (N2 – N1),  
where NX is the current A/D Value  
N1 is the A/D Value at 0 mm H20  
N2 is the A/D Value at 160 mm H20  
To simplify the calculation, the multiplication is done first.  
Then the function NdivD is called to divide the values.  
NdivD Function  
The NdivD function performs a division by counting  
successive subtractions of the denominator from the  
numerator to determine the quotient. The denominator is  
subtracted from the numerator until the result is zero. If there  
is an overflow, the remainder from the last subtraction is the  
remainder of the division.  
wrflash and ersflsh Functions  
The wrflash and ersflsh functions are used to write to and  
erase values from the flash. For more information regarding  
flash functionality, refer to Section Four, Flash Memory from  
the MC68HC908QY4/D Databook.  
CONCLUSION  
The water level reference design uses a MPXM2010GS  
pressure sensor in the low cost MPAK package, the low cost,  
eight-pin microcontroller, and a quad op-amp to amplify the  
sensor output voltage. This system uses very few  
ALLINIT Function  
The Allinit function disables the COP for this version of  
software, sets the data direction bits, and disables the data to  
the LCD and turns off the LCD enable line. It also sets up the  
microcontroller's internal clock to half the speed of the bus  
clock. See Section 15, Computer Operating Properly, of the  
MC68908QT4 datasheet for information on utilizing the COP  
module to help software recover from runaway code.  
components, reducing the overall system cost. This allows for  
a solution to compete with a mechanical switch for water level  
detection but also offer additional applications such as  
monitoring water flow for leak detection, and the other  
applications for smart washing machines.  
WARMUP Function  
The Warmup function alternates the blinking of the two  
LEDs ten times. This gives the LCD some time to warm up.  
Then the function warmup calls the LCD initialization function,  
lcdinit.  
AN1950  
Sensors  
6
Freescale Semiconductor  

与AN1950相关器件

型号 品牌 描述 获取价格 数据表
AN1955 FREESCALE Thermal Measurement Methodology of RF Power Amplifiers

获取价格

AN197 SILICON SERIAL COMMUNICATIONS GUIDE FOR THE CP210X

获取价格

AN1979 FREESCALE Altimeter and Barometer System

获取价格

AN1984 FREESCALE Handling Freescale Pressure Sensors

获取价格

AN1A3Q NEC On-Chip Resistor PNP Silicon Epitaxial Transistor

获取价格

AN1A4M NEC PNP SILICON TRANSISTOR

获取价格