
|
INFO - FAQ - CC2-Forum - CCPro-Forum |
|
||
|
Hallo I found a very interesting site About a 12 bits AD converter http://cubloc.com/download/app_mcp3202.pdf But is there some one who can translate the basic in the Munit 2 basic Hans > I thought off a 10BITS chip AD9051 in 0-5 volt > 10 bits parallel out. > All the 10 outÂ’s into the 16 channel multiplexer MC 14067B > And via een BCD code out the Munit > ComeÂ’s the VAR into port5 of the Munit > See example > > DEFINE Ingang9 BIT[1] 'Ingangen zo geplaats dat ze netjes op en rij staan in 1 WORD > DEFINE Ingang10 BIT[2] > DEFINE Ingang1 BIT[9] > DEFINE Ingang2 BIT[10] > DEFINE Ingang3 BIT[11] > DEFINE Ingang4 BIT[12] > DEFINE Ingang5 BIT[13] > DEFINE Ingang6 BIT[14] > DEFINE Ingang7 BIT[15] > DEFINE Ingang8 BIT[16] > DEFINE SensorValue WORD[1] > > define I byte[4] > DEFINE Ieen BIT[25] > DEFINE Itwee BIT[26] > DEFINE Idrie BIT[27] > DEFINE Ivier BIT[28] > > DEFINE InVar BIT[17] > > DEFINE poortA Port[1] > DEFINE poortB Port[2] > DEFINE poortC Port[3] > DEFINE poortD Port[4] > DEFINE Bit10In PORT[5] > > #Start > > #Ingangen > FOR I=0 to 9 > PoortA=Ieen 'BCD code voor chip MC 14067B > PoortB=Itwee > PoortC=Idrie > PoortD=Ivier > IF Bit10In=ON THEN InVar=ON ELSE InVar=OFF > IF I = 0 THEN Ingang1 = InVar > IF I = 1 THEN Ingang2 = InVar > IF I = 2 THEN Ingang3 = InVar > IF I = 3 THEN Ingang4 = InVar > IF I = 4 THEN Ingang5 = InVar > IF I = 5 THEN Ingang6 = InVar > IF I = 6 THEN Ingang7 = InVar > IF I = 7 THEN Ingang8 = InVar > IF I = 8 THEN Ingang9 = InVar > IF I = 9 THEN Ingang10 = InVar > > Next > 'Example pressurre of 250 bar > 'totaal 1023 steps > IF SensorValue > 204 THEN SensorValue = SensorValue - 204 ELSE SensorValue = 0 '1023/5=204 steps > SensorValue = SensorValue * 250 / 819 '1023-204 > > > Goto Start > > But isnÂ’t there an easyer way > > Hans > > > Hallo > > > > I have one more problem , > > IÂ’ve a pressure sensor 4 to 20 mA > > This go on 250 ohm. > > So I have 1 to 5 volt on the 8 bit A/D entrence. > > 1 volt is 1/5 from the A/D port. > > At the formule as, for example, the pressure sensor is 0 to 250 bar > > > > IF Adport1>51 THEN Sensor1=Adport1-51 ELSE Sensor1=0 > > Sensor1=Sensor1*(250/204) > > > > This is working > > But itÂ’s to grove > > The next question is: > > Is there a way , or a chip, bijv. 10 bits AD ingang > > > > Hans |
| Antwort schreiben |