I'm not sure you can have a SPACE after $.Code:Lcdout $ fe, 1, "1 EEPROM"
Post all your updated code. It will be easier to spot an error than using our crystal ball.
Do you get any compile errors?
Robert
I'm not sure you can have a SPACE after $.Code:Lcdout $ fe, 1, "1 EEPROM"
Post all your updated code. It will be easier to spot an error than using our crystal ball.
Do you get any compile errors?
Robert
hello robert thanks for replying, oh oo this code
hello robert thanks for replying, oh oo this code
PORTB DEFINE LCD_DREG
DEFINE LCD_DBIT 4
PORTB DEFINE LCD_RSREG
DEFINE LCD_RSBIT 1
PORTB DEFINE LCD_EREG
DEFINE LCD_EBIT 2
SCL var PORTA.0 'Clock pin
SDA var PORTA.1 'Data pin
E0 var byte 'Address <<<< I changed this to "WORD"
B1 var byte 'Data 1
ADCON1 = 7 'Set PORTA and PORTE to digital
Pause 100 'Wait for LCD to start up
b1 = e0 + $ 80 'B1 is the EEPROM data
pause 100
I2CWRITE SDA, SCL, $ A0, E0, [B1, "pic basic pro"] 'WRITTEN
pause 100
I2CREAD SDA, SCL, $ A0, E0, b1
PAUSE 100
lcdout $ FE, 1, B1
end
I want the pic 16F628A EEPROM read and write q 24c32a this recorded in the external EEPROM and appears on the LCD, the case would be the phrase "pic basic pro"
sorry my english, I'm Brazilian, sao paulo
thank you
fernandocsouza
The lcd defines are not correct format.
The 16f628a does not use adcon1, but you need to turn off comparators that are on porta.
'ADCON1 = 7 'Set PORTA and PORTE to digital
CMCON = 7 'turn off comparators
address E0 is not set anywhere.
remove the spaces after "$"
that i2cread will only read one byte, you'll need to set an array and use str\x or a loop to read the whole string.
You may want to send something to the lcd first to make sure it's working before solving the i2cread issues.
the following compiles and should display the "Display working" at least
Code:DEFINE LCD_DREG PORTB DEFINE LCD_DBIT 4 DEFINE LCD_RSREG PORTB DEFINE LCD_RSBIT 1 DEFINE LCD_EREG PORTB DEFINE LCD_EBIT 2 SCL var PORTA.0 'Clock pin SDA var PORTA.1 'Data pin E0 var WORD 'Address <<<< I changed this to "WORD" B1 var byte 'Data 1 CMCON = 7 'turn off comparators Pause 100 'Wait for LCD to start up E0 = $0000 'didn't see i2c address anywhere, need to set. b1 = e0 + $80 'B1 is the EEPROM data pause 100 LCDOUT $FE,1,"Display working!" ' see if lcd setup correctly. I2CWRITE SDA, SCL, $A0, E0, [B1, "pic basic pro"] 'WRITTEN pause 100 I2CREAD SDA, SCL, $A0, E0, b1 PAUSE 100 lcdout $FE, 1, B1 end
also need to add "TRISB = 0" somewhere before using lcdout. (default is input, need to set to output)
Also, make sure Low voltage programming is disabled, it uses portb.4.
Last edited by nomad; - 5th May 2014 at 17:44. Reason: oops
HELLO personal thanks for replying,
I pulled the ADCON1 and put the CMCON = 7 and appeared error symbol
Nor did the case of states i2c address you explain to me or write code to perform this address
because the lcd was already running and the data were recorded in eeprom 24c32a
the difficult that even this reading is made of the data in the EEPROM and show lcd
thanks for helping me
fernandocsouza
(double post)
Last edited by Demon; - 5th May 2014 at 23:58.
sorry, i'm lost as how to help. your code should not compile at all.
(I tried in microcode studio, fixed all the errors, and posted the result.)
Are you sure you've selected 16f628a? it has comparators and uses cmcon.
I've used them before and checked against my old projects and the data sheet.
what I posted compiles fine here with no errors. (Although I did not correct the i2cread section to get the full string for display)
If nothing at all is displaying, there's bigger issues.
make sure 16f628a is the chip youre using, and it is selected in your program!
thank you for answering me NOMAD installed microcode studio again and the LCD worked just right and I could write the phrase "pic basic pro" in eeprom 24c32a, and now a friend as I do for reading the data and display on lcd
please help me
fernandocsouza
Friend nomad thanks for helping me
got the pic 16F628A read the eeprom 24c32a this error in declarations
I2CREAD SDA, SCL, $ A1, e0 + $ 20 [b1 str \ 9] 'limit
pause 100
lcdout str b1 \ 9
pause 100
had to put the var data with the line of the EEPROM memory in the case E0 + $ 20
but anyway thanks
fernandocsouza
Bookmarks