previously I had this code using pic 16f877a
DEFINE LCD_DREG PORTD
DEFINE LCD_DBIT 4
DEFINE LCD_RSREG PORTE
DEFINE LCD_RSBIT 0
DEFINE LCD_EREG PORTE
DEFINE LCD_EBIT 1
DEFINE LCD_BITS 4
DEFINE LCD_LINES 2
DEFINE ADC_BITS 10
DEFINE ADC_CLOCK 3
DEFINE ADC_ SAMPLEUS 50
TRISC.6 = 0
TRISC.7 = 1
TRISA = 255
ADCON1 = %11000010
TRISB.6 = %0
LED VAR PORTB.6
B1 VAR WORD
B2 VAR WORD
VALOR1 VAR BYTE
VALOR2 VAR BYTE
STAR:
ADCIN 1, B1
ADCIN 2, B2
VALOR1=B1/9
VALOR2=B2/12
SEROUT2 PORTC.6,188,["$", "$", DEC4 B1,"$", "$",DEC4 B2,10,13]
LCDOUT $FE,2," SYMMETRIC FONT "
LCDOUT $FE,$C4," JOSE LUIS "
LCDOUT $FE,$90," VOLTAGE NEGATIVE:-",DEC2 VALOR1
LCDOUT $FE,$D0," VOLTAGE POSITIVE:+",DEC2 VALOR2
HIGH LED
GOTO STAR
If you look at the image you will see that the voltages registered in the 20x4 lcd are different from the voltages registered in the proteus dc voltmeter.
I had errors in the floating point and I was able to correct it with the 32-bit library.
and the other code is an improvement, but it still has errors, and in the simulation it shows it.
I hope you can help me correct the code and thanks again





Bookmarks