Hello, last night very nearly completely finished my hardware to read 4-20mA (24VDC) and generate a PWM 4-20mA (24VDC) ... Everything runs based on two LM358 with single source (one is supplied 12Vdc and the other to 24VDC). GND is shared between the two operational amplifiers.
I share the diagram, if you need anything else, ask me and I will share it...
To read the 4-20mA signal and place it on the display, as I was tired last night and I can not think of anything to work with floating point, implement the following lines:
Code:
ADCIN 0, ent420
nivel = ent420
aux1=(ent420*100)/250 ;(V*100)/(R*100)
aux1= aux1 *2
;****blabla bla
LCDOUT $FE, 1
LCDOut $fe,2,"Sal: ",DEC4 aux1,"mA"
to generate the pwm to take me filter 0-5Vdc to create the 4-20mA, implement these lines:
Code:
PWM PORTC.2,nivelAUX,100 ;nivel PWM = (Vout * 255) / V.Fuente
Sorry for my spanglish!!!! 
En Español
Hola, anoche termine casi casi por completo mi hardware para poder leer señales 4-20mA (24Vcc) y generar con un PWM 4-20mA (24Vcc)... Todo corre en base a dos LM358 con fuente simple (uno se alimenta a 12Vcc y el otro a 24Vcc). GND se comparte entre ambos amplificadores operacionales.
Te comparto el diagrama, si necesitas algo mas, me pedis y te lo comparto
Para leer la señal 4-20mA y colocarlo en el display, como anoche estaba cansado y no se me ocurria nada para trabajar con punto flotante, implemente las siguientes lineas:
Code:
ADCIN 0, ent420
nivel = ent420
aux1=(ent420*100)/250 ;(V*100)/(R*100)
aux1= aux1 *2
;****blabla bla
LCDOUT $FE, 1
LCDOut $fe,2,"Sal: ",DEC4 aux1,"mA"
para generar el pwm que me lleve el filtro de 0-5Vcc para crear los 4-20mA, implemente estas lineas:
Code:
PWM PORTC.2,nivelAUX,100 ;nivel PWM = (Vout * 255) / V.Fuente
Bookmarks