Trouble with simple RomEngine and TV.text program.
sccoupe
Posts: 118
Im using the romengine and tvtext objects to do a simple assign a value to variable, write a different value to the variable eeprom location, read that eeprom value into variable2 and then print both variables to the screen. It should show "56", but doesnt work. I have the second write to the screen commented because it seems to lock the application like its a null value or something. Am I using the romengine correctly?
Thanks
Thanks
CON _clkmode = xtal1 + pll16x _xinfreq = 5_000_000 _clockDataPin = 29 _clockClockPin = 28 VAR word variable word variable2 OBJ text : "tv_text" rom : "I2C_ROMEngine" PUB start | i text.start(12) rom.ROMEngineStart(_clockDataPin, _clockClockPin, -1) variable := "5" rom.writeword(@variable,"6") variable2 := rom.readword(@variable2) text.out(variable) 'text.out(variable2)
Comments
text.hex(variable2,4) returns 0000
So a null value i guess that the text.out cannot handle and crashes. Looks like the writing isnt working.
Passing 0 to text.out() will clear the screen. Is that what happens? Just to be sure, can you assign the result of rom.writeword() to e.g. variable2 and print it out with text.hex(variable2, 8)?
How does text.hex(variable, 4) show up after assigning "5" to it?
text.out() is apparently what happens, yes its a clear blue screen. I thought it locked up.
text.hex(@@variable, 4) shows 0045
text.hex(@variable, 4) shows 08F0
text.hex(variable, 4) shows 0035
rom.writeword() isnt valid, so im not sure what you mean there.
Thanks
Apologies, that was short for
And I just noticed, in your original code you write the "6" to the address of variable but attempt to read it back from the address of variable2 which explains why you get 0 back. Unless that's a typo. Can you verify?
This also displays 0000
Yes, the other part was a typo.
Well, that simply means that writing the word failed (it's supposed to return TRUE/-1). Time to check the wiring (or you could first start looking how far you get in the I2C driver). As I've never used to object you're on your own now. Are you using pull-ups on both lines like suggested in the driver source?
Or maybe try a different I2C driver.
No. Also, I just had a closer look at the driver you're using and it seems that it relies on there being a pull-up on both lines (level is controlled by manipulating dira only).
Thanks much for your help. Now I can sleep tonight. LOL!