Hi, all.
I'm visiting a german technical school and we have do start a Project work in February. For the coarse advance planning I would like to have a Basic structure of the Programming with Keil µ-Vison. We already programmed some stuff with µ-Vision, but not deep enough
I would like to read the digitized value of a pressure sensor with a microcontroller, let the Software evaluate it, and show the pressure value on a Display.
so is it possible, to build a Table (like Excel, .csv, etc.) and let the programm compare the Value of the input Port from the microcontroller withe the values in the table and take appropriate pressure value.
Or is there another possibility, do assign the values, so that I can change the assignments quick and easy?
please excuse my bad english.
Thank you in advance!
Jonas
I want to use Keil µ-Vision3.
Yes. I want to let µ-Vision compare Values from intput port with Values in a Table.
BUT How???
I only know something like an If-funktion
like: if (P0 = 128) { pressure = "150bar"; }
if (P0 = 215) { pressure = "180bar"; }
etc...
so itÂ's more easy, to have a Table where you can change the assinged Values.
But doesn't the measured value represent a discretisation of a continuous function? In that case, you don't need a table. You can use a formula to convert the measurement. Or, you may use a partial linear interpolation for translating the samples.
Because of there is no analog input on the microcontroller (we use Atmel T89C51CC01) the Voltage of the Pressure sensor is converted by an A/D converter.
so we have values like:
Pressure - Voltage - 8-Bit A/D 10 bar --- 1,22V --- 42 20 bar --- 1,43V --- 49 30 bar --- 1,65V --- 57 40 bar --- 1,86V --- 64 50 bar --- 2,08V --- 71 60 bar --- 2,30V --- 79 ... 300 bar --- 7,50V --- 255
So there is no linear interpolationand and no continuous function can be used. I can solve the problem with many If - else loops but its laborious and I think, I can use this also for other projects.
Thank you, for your help!
in the uVision manual:
http://www.keil.com/support/man/docs/uv3/uv3_debug_functions.htm
But this really isn't the sort of thing that uVision is designed for - it sounds like what you really need is to write a PC application in VB or whatever, and have it communicate with the microcontroller via a serial link
Or perhaps you should be using something like LabView or Matlab:
http://www.ni.com/labview/
http://www.mathworks.com/
View all questions in Keil forum