Hi, Please post your full sample code here, I'll have a look. The word and dword procedures haven't been used much, so I wouldn't be surprised if there may be a bug in there somewhere. I assume the sample is working for you? It does have a word/dword test in it.
The code on justanotherlanguage.org tutorial should still be valid, but use the sample in the package or on SVN. SVN is always the newest. I believe you can use either SPI mode 00 or 11 with 23k256. > var byte addr[4] at address If the top bytes of this array are not used, the compiler will ignore them. Matt. On Thursday, August 30, 2012 9:51:08 AM UTC-4, PDSACAA wrote: > > Hello All > I am working with 23k256 sram and seem to have found problems with > 23k256_sram.jal include library procedures while executing > 16F877a_23k256.jal sample. > > In general all seems to work in principle , however:- > when using the word and dword read/write array pseudo variable > procedures with large data values (I am afraid I cannot be more > specific) say 0xDDFF in the case of word or 0xAABBCCDD in the case of > dword, problems seem to occur. > > i.e. data seems to be either written to sram incorrectly or > incorrectly read back again using the array pseudo variables. I have > used alternative single byte read calls supplied in sram_23k256.jal to > examine consecutive sram addresses and whereas things appear fine with > most data values with other large data values problems show up. For > example the 16F877a_23k256.jal sample as coded in the library I do not > think gives the expected results. > > The use of pseudo-variable arrays was discussed in jallist recently > with some reservations, however Kyle confirmed that their use was now > fully supported by the compiler. > The code in 16F877a_23k256.jal sample as distributed only used > constant values for the pseudo array indexes. I tried using assigned > (word) variables for indexes but it didn't make any difference (no > surprise there!!) > > I have downloaded the 23k256_sram.jal library module supplied in svn/ > trunk/include/external/storage/ram assuming that this is the latest > version. I am correct in this or will there be a later version? > > I have sample code (which to be honest is really no more than a cut > down version of 16F877a_23k256.jal ) which shows up problems but I am > not sure how to submit this to JALLIB for examination. How does one > post code to JALLIB forum? Does one just include it in the post? > > I have examined the code in the pseudo variable procedures in > 23k256_sram.jal and it looks good to me. There are some subtle lines > of code that I find confusing but which I do not think can the cause > of the problem. > > One of these is the repeated use of :- > > var byte addr[4] at address > > where address is a word value and we clearly only require access to > the 2 bytes addr[0] and addr[1]. Presumably addr[2] and addr[3] just > point to other non-relevant storage locations but why is this done? I > am obviously missing something here! > > Can I also mention that Tutorial p104 says "23k256 uses SPI mode > 1,1" ,it dosen't it uses mode 0,0 as borne out by code in > 16F877a_23k256.jal. > as provided by the JAL distribution. > > It also appears that the code in the tutorial differs from distributed > 16F877a_23k256.jal to which it refers. This is not necessarily a > problem but the references on p101 and p104 to "const bit > SRAM_23K256_ALWAYS_SET_SPI_MODE = TRUE" are confusing when in fact > this is not the way that the SPI mode for the 23k256 is asserted in > 16F877a_23k256.jal and other samples. I just think this is confusing > for the novice and think the reference would be better removed. > > Can I ask members to check these issues and confirm or reject these > problems I experience? > > Many Thanks > Dave Paxton > > > > > -- You received this message because you are subscribed to the Google Groups "jallib" group. To view this discussion on the web visit https://groups.google.com/d/msg/jallib/-/idJzh6zrAckJ. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/jallib?hl=en.
