jazzed said...
Ok, I'll have to put together a test and try to reproduce the problem using an I2C EEPROM routine (since I don't have PCF8591). Is there already an I2C EEPROM access test for Javelin? There is some built-in stuff, but that won't help this. Sorry it's not working for you this time.
Hi jazzed,
Here is my new home-made test program with a 24LC256 EEPROM chip·that I made quickly and tested.
Have a Look at this and tell me more about it.
See you soon.
I2C.java uses CPU.java. For it to work with Propeller, we have to change CPU.java.
I propose folding all PROP.java code into CPU.java and deprecating PROP.java.
Current PROP.java becomes an alias for CPU.java and can be removed later.
This would allow supporting all existing Javelin code which was written without regards
to the possibility that a new CPU class could be used (an OOP methodology failure).
I've included a new CPU.java, PROP.java, EE24LC256.java and a version of
I2CTest.java that should work fine without GC enabled.
I'm thinking EE24LC256.java should be generalized, however that may be redundant
because the JVM has eeprom code built-in.
Note the first EEPROM read should give 0x04A0B400 for an 80MHz clock program.
@JM, Did it work with the code I posted? It worked fine for me as posted.
Don't forget to post your test code so I can try to reproduce your problem [noparse]:)[/noparse]
Meanwhile, I'll test your new CPU.java.
Cheers,
--Steve
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
May the road rise to meet you; may the sun shine on your back.
May you create something useful, even if it's just a hack.
jmspaggi said...
Here is my code. It's a cut and past from your's.
Ok, I added the new CPU.java to my library and compiled with your post. Here's what I get:
Serial
LCDTest.java v2.4
Starting EE24LC256 test...
Step 1Step 2Step 3
04A0B400
// looptest is set false, so only one long is printed.
I think I want to move beyond .zip source sharing and use source control sharing. I'll do that later.
Meanwhile here is an JVM update based on my current directory for you to try. There are few differences.
Please try running the JVM without recompiling the Java code. The jem.bin should show the above output.
Cheers.
--Steve
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
May the road rise to meet you; may the sun shine on your back.
May you create something useful, even if it's just a hack.
I have extracted the entire zip, including the jem, and I have not recomiled anything.
...
Are you testing on the PPDB?
Ok, I was testing on Propeller Protoboard. Tried it on PPDB and got your result.
At least I can reproduce the problem ...
Can you put a 2.2KOhm (up to 10KOhm) pull up resistor on P28? I did this for my PPDB and it works.
I think someone is relying on that for the start/stop conditions in the I2C driver.
Cheers.
--Steve
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
May the road rise to meet you; may the sun shine on your back.
May you create something useful, even if it's just a hack.
On a positive note, I found what's causing 0 to be output on the console
Cool. That's a good news! [noparse];)[/noparse] But what's about the timer issue? [noparse];)[/noparse] (Just to add on the pressure) [noparse];)[/noparse]
Jazzed said...
I'll be removing GCOLLECT.
There is no GC on the Javelin. So I think that it's not a big issue. Code done for the Javelin will still work on the Propeller.
Personnally, I prefer to handle the memory myself. It's sometime asking my brain to works a but more, but that's what I like with the dev.
What's a pity because GC is a powerful function...but I understand.
I've got another inquiry, I would be interested by long datas type in my program.
Can you make a version of JVM with long data type by putting a define or it's too early ?
I know I ask you a lot of things...
Good to see you got the I2C issue solved by pulling up SCL.
(slave devices may extend SCL that's why a pullup is required).
Someone mentioned generalizing I2C.
I have already done that using classes I2Cdevice (abstract class), I2CsmFastDevice (extends I2Cdevice and uses shiftIn and shiftOut),
and I2CsmDevice (extends I2Cdevice but does not use shiftOut). I2Cdevice supports both 7-bit and 10-bit addressing.
For example, an rtc and eeprom would be declared as · //rtc · static I2CsmDevice DS1307_CHIP = new I2CsmDevice(pinSDA,pinSCL,0xD0|I2Cdevice.ADDR8,32767,1,1); //DS1307 rtc, no pagewrite delay ··static I2Cmemory backupRam = new I2Cmemory(DS1307_CHIP,8,56); //general memory class · static DS1307 rtc = new DS1307(DS1307_CHIP); · static Calendar cal = new Calendar(); · //eeprom · static I2CsmDevice MC24LC32A_CHIP = new I2CsmDevice(pinSDA,pinSCL,0xA0|I2Cdevice.ADDR16,32,128,105); //MC24LC32A eeprom, 5ms pagewrite delay
Using I2CsmDevice you don't need bother about start() and stop(). That class also supports block read/write using pagewrites to speed up writing.
[noparse][[/noparse]code="Peter"]
For long support, there is already the Int32 class
Thanks for sharing! I have not yet start to code it, so it will save me some time.
Regarding I2C, the only component I'm using so far is the EEPROM. But I have a bunch of Atmega talking I2C that might join my board a day [noparse];)[/noparse]
JM
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Linux? There is worst, but it's more expensive.
Comments
Here is my new home-made test program with a 24LC256 EEPROM chip·that I made quickly and tested.
Have a Look at this and tell me more about it.
See you soon.
I have got a clue because on the version 04_18, it's works.
See you later...
JM
I propose folding all PROP.java code into CPU.java and deprecating PROP.java.
Current PROP.java becomes an alias for CPU.java and can be removed later.
This would allow supporting all existing Javelin code which was written without regards
to the possibility that a new CPU class could be used (an OOP methodology failure).
I've included a new CPU.java, PROP.java, EE24LC256.java and a version of
I2CTest.java that should work fine without GC enabled.
I'm thinking EE24LC256.java should be generalized, however that may be redundant
because the JVM has eeprom code built-in.
Note the first EEPROM read should give 0x04A0B400 for an 80MHz clock program.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
May the road rise to meet you; may the sun shine on your back.
May you create something useful, even if it's just a hack.
Not sure how to used the I2CTest.spin file. Content look strange. Can you please let us know?
Regarding CPI vs PROP, I think it's a good approach.
Thanks,
JM
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
May the road rise to meet you; may the sun shine on your back.
May you create something useful, even if it's just a hack.
JM
Just tried the EEPROM test file, and it's not working for me with the last JVM and you EE class. It'S freezing on eeI2C.isPresent().
I'm using the EEPROM on the PPDB board, and, I promess, there is no wrong wire on the PIN28 and PIN29 holes [noparse];)[/noparse]
JM
Maybe there is some pin configuration missing?
JM
Don't forget to post your test code so I can try to reproduce your problem [noparse]:)[/noparse]
Meanwhile, I'll test your new CPU.java.
Cheers,
--Steve
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
May the road rise to meet you; may the sun shine on your back.
May you create something useful, even if it's just a hack.
Here is my code. It's a cut and past from your's.
EE file is the one you sent too. I'm using JVM 0503.
JM
I think I want to move beyond .zip source sharing and use source control sharing. I'll do that later.
Meanwhile here is an JVM update based on my current directory for you to try. There are few differences.
Please try running the JVM without recompiling the Java code. The jem.bin should show the above output.
Cheers.
--Steve
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
May the road rise to meet you; may the sun shine on your back.
May you create something useful, even if it's just a hack.
I have extracted the entire zip, including the jem, and I have not recomiled anything.
Pins 28, 29, 30 and 31 are free on the board.
I don't really know what to try. Code is quite simple. I tried from the jem file you sent, and tried also to recompile locally. Same result.
Are you testing on the PPDB?
JM
Ok, I was testing on Propeller Protoboard. Tried it on PPDB and got your result.
At least I can reproduce the problem ...
Can you put a 2.2KOhm (up to 10KOhm) pull up resistor on P28? I did this for my PPDB and it works.
I think someone is relying on that for the start/stop conditions in the I2C driver.
Cheers.
--Steve
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
May the road rise to meet you; may the sun shine on your back.
May you create something useful, even if it's just a hack.
It's working now with PCF8591 (Version 05_03 and 05_06), How do you do to enable GCOLLECT under BST ? (Syntax ?)
And I tried JVM 05_06 too without recompiling the Java code.
I get:
LCDTest.java v2.4
Starting EE24LC256 test...
Step 1Step 2Step 3
04C4B400
Marco
I have 8 EEPROMS connected to my Javelin. I will have to see if I have this pull up or not.
So Chim
Just, tell me how do you do to enable GCOLLECT under BST ?
It's already late for me, I'll try another thing tomorow... Tell me what you need to test on JVM yet ? I'll try to help you.
Bye.
it seems to me the GCOLLECT don't work on the last version...
If you could put each version JVM on the file, It would be better too.
See ya
Cool. That's a good news! [noparse];)[/noparse] But what's about the timer issue? [noparse];)[/noparse] (Just to add on the pressure) [noparse];)[/noparse]
There is no GC on the Javelin. So I think that it's not a big issue. Code done for the Javelin will still work on the Propeller.
Personnally, I prefer to handle the memory myself. It's sometime asking my brain to works a but more, but that's what I like with the dev.
JM
I've got another inquiry, I would be interested by long datas type in my program.
Can you make a version of JVM with long data type by putting a define or it's too early ?
I know I ask you a lot of things...
See you later.
THANKS !
In the meantime, I'm learning Spin and Pasm...
JM
Good to see you got the I2C issue solved by pulling up SCL.
(slave devices may extend SCL that's why a pullup is required).
Someone mentioned generalizing I2C.
I have already done that using classes I2Cdevice (abstract class), I2CsmFastDevice (extends I2Cdevice and uses shiftIn and shiftOut),
and I2CsmDevice (extends I2Cdevice but does not use shiftOut). I2Cdevice supports both 7-bit and 10-bit addressing.
http://tech.groups.yahoo.com/group/JavelinCode/files/Javelin%20Stamp%20IDE/lib/stamp/protocol/i2c/
For example, an rtc and eeprom would be declared as
· //rtc
· static I2CsmDevice DS1307_CHIP = new I2CsmDevice(pinSDA,pinSCL,0xD0|I2Cdevice.ADDR8,32767,1,1); //DS1307 rtc, no pagewrite delay
··static I2Cmemory backupRam = new I2Cmemory(DS1307_CHIP,8,56); //general memory class
· static DS1307 rtc = new DS1307(DS1307_CHIP);
· static Calendar cal = new Calendar();
· //eeprom
· static I2CsmDevice MC24LC32A_CHIP = new I2CsmDevice(pinSDA,pinSCL,0xA0|I2Cdevice.ADDR16,32,128,105); //MC24LC32A eeprom, 5ms pagewrite delay
Using I2CsmDevice you don't need bother about start() and stop(). That class also supports block read/write using pagewrites to speed up writing.
For long support, there is already the Int32 class which provides add, sub, mul, div on 32bit numbers.
(it uses 2 int's to represent a long just as jmspaggi suggested).
More math classes (floating point and trig)
http://tech.groups.yahoo.com/group/JavelinCode/files/Javelin%20Stamp%20IDE/lib/stamp/math/
These should all work if the jvm operates correctly.
regards peter
For long support, there is already the Int32 class
Thanks for sharing! I have not yet start to code it, so it will save me some time.
Regarding I2C, the only component I'm using so far is the EEPROM. But I have a bunch of Atmega talking I2C that might join my board a day [noparse];)[/noparse]
JM
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Linux? There is worst, but it's more expensive.