![]() |
Forum Index : Microcontroller and PC projects : uM2(+): data logging - cheap fast & easy
![]() ![]() ![]() ![]() |
|||||
Author | Message | ||||
disco4now![]() Guru ![]() Joined: 18/12/2014 Location: AustraliaPosts: 971 |
Peter, Will using the 25Q chip mounted on the LCD and connected to an MM2(+) be a problem as its SPI2 that is wired to the Touch and SD card on the MM2(+) boards? The manual indicates that SPI2 would not be available to Basic, so does the 25Q need to be wired to SPI. Thanks Gerry Latest F4 Latest H7 FotS |
||||
matherp Guru ![]() Joined: 11/12/2012 Location: United KingdomPosts: 10066 |
The code just needs re-compiling for a MM+ to use SPI2. MM+/SPI2 version attached (including Microchip support): option explicit
option default none dim integer i const chipselectpin%=21 'chip select pin ' ' Example program to demonstrate logging to a serial flash chip mounted on a SSD1963 ' Compatible with 64 and 100 pin MM+ processors ' testdata() 'sets up the testdata generator ' formatlog(chipselectpin) 'format the chip ' timer=0 for i=1 to 1000 'log 1,000 strings with timestamps writelog(int2Text(i),chipselectpin%,1) next i print "1,000 records constructed and logged in ",timer\1000," seconds" pause 3000 ' readlog(chipselectpin%) ' read back the log ' end ' '**************************************** ' ' sub formatlog(cspin as integer) 'erase the chip and set up the page index local integer i,bytecount,r(2) local s$ length 10 bytecount = getpagecount(s$,cspin)*256 print "JEDEC ID = ",s$ print "Memory size is ",bytecount\131072," Mbits" if not (erasechip(bytecount,cspin)) then print "erase failed" end endif for i=0 to bytecount\524288 setpagewritten(i,cspin) 'mark the index pages and first real page as used next i print "Format complete" end sub ' sub writelog(s$,cspin as integer,timestamp as integer) 'write a string to the next location on the chip with optional timestamp local integer i,x,buff(63),f,pagecount local d$ length 10 pagecount=getpagecount(d$,cspin) x=getnextfreepage(pagecount,cspin) if x < pagecount-1 then if x<>pagecount\2048 then x=x-1 'point to the previous page to see if it has space readpage(x,buff(0),cspin) 'read in first page readpage(x+1,buff(32),cspin) 'read in the second page f=getfirstfreebyte(buff()) if timestamp then i=loadstring(date$+","+time$+","+s$,buff(),f) else i= loadstring(s$,buff(),f) endif if i>=256 then 'write the bit on the next page and set the page marker as used writepage(x+1,buff(32),cspin) setpagewritten(x+1,cspin) endif writepage(x,buff(0),cspin) else print "Error: Chip full" endif end sub ' sub readlog(cspin as integer) 'read and print the log local integer x,buff(63),f=0, n,i local s$ x=getpagecount(s$,cspin)\2048 'number of indexpages readpage(x,buff(0),cspin) 'read in first two pages readpage(x+1,buff(32),cspin) if buff(0) =-1 then exit sub 'no data endif n=getstring(s$, buff(0),f) print s$ do while n<>&HFF 'repeat until no more data if f>=256 then x=x+1 readpage(x,buff(0),cspin) 'read in next two pages readpage(x+1,buff(32),cspin) f=f-256 endif n=getstring(s$, buff(0),f) print s$ loop end sub ' sub setpagewritten(pageno as integer, cspin as integer) 'set a page as partially or completely written local integer buff(31),i local integer mappage=pageno\2048 'we have 2048 bits per page local integer wordno=(pageno-mappage*2048)\64 'locate the word in the page local integer bitno= 1<<(pageno mod 64) 'locate the bit in the word in the page readpage(mappage,buff(),cspin) buff(wordno) =buff(wordno) XOR bitno writepage(mappage,buff(),cspin) end sub ' CFunction getnextfreepage 00000000 27BDFEC8 AFB7012C AFBF0134 AFBE0130 AFB60128 AFB50124 AFB40120 AFB3011C AFB20118 AFB10114 AFB00110 8C830004 8C820000 8CB60000 000327C3 308407FF 00821021 0044B82B 02E3B821 000212C2 0017BD40 02E2B825 24030001 3C02BF80 AC435A30 1AE00048 0000A021 3C159D00 3C10BF80 241E0003 27B20110 24130020 8EA2001C 02C02021 0040F809 24050005 00141A00 AE1E5A20 8E025A10 30420080 1040FFFD 7C623C00 8E045A20 AE025A20 8E025A10 30420080 1040FFFD 7C623A00 8E045A20 AE025A20 8E025A10 30420080 1040FFFD 00000000 306300FF 8E025A20 AE035A20 8E025A10 30420080 1040FFFD 00000000 8E025A20 27A30010 AE115A20 8E025A10 30420080 1040FFFD 00000000 8E115A20 7C118C20 A0710000 24630001 1472FFF6 02C02021 8EA2001C 0040F809 24050006 8FA20010 8FA30014 00431025 14400012 00002021 27A20018 24040001 8C430000 8C450004 00651825 1460000B 24420008 24840001 5493FFFA 8C430000 26940001 0297102A 5440FFC2 8EA2001C 10000002 24040100 00002021 27A30010 000410C0 00621021 8C460000 8C450004 30C30001 14600011 00001021 24020001 00055840 240A0040 00024827 00461806 012B4804 30480020 00453807 01231825 00E8180B 30630001 54600005 0014A140 24420001 144AFFF5 00024827 0014A140 02842021 8FBF0134 00042180 00441021 00021FC3 8FBE0130 8FB7012C 8FB60128 8FB50124 8FB40120 8FB3011C 8FB20118 8FB10114 8FB00110 03E00008 27BD0138 End CFunction ' CFunction getpagecount 00000000 27BDFFC8 AFB30028 AFBF0034 AFB50030 AFB4002C AFB20024 AFB10020 AFB0001C 8CB10000 3C029D00 8C420088 00111880 00621021 8C420000 24030008 10430007 00809821 3C029D00 8C420010 02202021 24050008 0040F809 00003021 3C02BF81 8C44F220 3C029D00 8C430088 3C020580 7C84D800 3442B053 00821026 24050014 24040030 00A2200B 00831021 8C430000 24020065 1062006F 3C02BF81 8C45F220 3C030580 3C029D00 8C420010 3463B053 7CA5D800 00A32826 24040005 2403000C 0065200A 00003021 0040F809 24050008 3C02BF81 8C45F220 3C030580 3C029D00 8C420010 3463B053 7CA5D800 00A32826 24040005 2403000C 0065200A 00003021 0040F809 24050064 3C02BF81 8C45F220 3C030580 3C029D00 8C420010 3463B053 7CA5D800 00A32826 2404002F 2403000B 0065200A 00003021 0040F809 24050002 3C02BF81 8C45F220 3C030580 3C029D00 8C420010 3463B053 7CA5D800 00A32826 2404002F 2403000B 0065200A 00003021 0040F809 24050064 3C02BF81 8C45F220 3C030580 3C029D00 8C420010 3463B053 7CA5D800 00A32826 24040004 2403000A 0065200A 00003021 0040F809 24050008 3C02BF81 8C45F220 3C030580 3C029D00 8C420010 3463B053 7CA5D800 00A32826 24040004 2403000A 0065200A 00003021 0040F809 24050064 3C02BF81 8C43F220 3C020580 3442B053 7C63D800 1462000C 3C03BF81 8C64FA90 24050001 3C02BF81 7CA41804 AC64FA90 8C43FCA0 24040006 7C831804 AC43FCA0 1000000B 3C029D00 8C64FA90 24050007 3C02BF81 7CA41804 AC64FA90 8C43FC9C 24040006 7C831804 AC43FC9C 3C029D00 8C42001C 02202021 0040F809 24050006 3C02BF80 34038060 24040C00 AC435A00 AC445A40 24040001 AC445A30 3C03BF80 AC405A20 8C625A10 30420080 1040FFFD 3C029D00 8C42001C 3C10BF80 02202021 24050005 8E125A20 0040F809 00000000 2402009F AE025A20 3C03BF80 8C625A10 30420080 1040FFFD 3C02BF80 8C435A20 3C03BF80 AC405A20 8C625A10 30420080 1040FFFD 3C02BF80 8C505A20 3C03BF80 AC405A20 8C625A10 30420080 1040FFFD 3C02BF80 8C555A20 3C03BF80 AC525A20 8C625A10 30420080 1040FFFD 3C129D00 8E42001C 3C03BF80 02202021 24050006 8C745A20 0040F809 00108200 24020010 AFA20010 02158021 8E420030 00108200 02148021 26640001 02003021 0040F809 00103FC3 3C02FF40 3442D9BF 02021021 24030006 2C420002 10400027 A2630000 3C029D00 8C42001C 02202021 0040F809 24050005 24030006 3C02BF80 AC435A20 3C03BF80 8C625A10 30420080 1040FFFD 3C129D00 8E42001C 3C13BF80 02202021 24050006 8E635A20 0040F809 00000000 8E42001C 02202021 0040F809 24050005 24020098 AE625A20 3C03BF80 8C625A10 30420080 1040FFFD 3C029D00 8C42001C 3C03BF80 02202021 24050006 8C635A20 0040F809 00000000 3C0200BF 24422642 24044000 12020012 00002821 3C0200BF 24422602 1202000E 3C0200BF 24422641 1202000B 24042000 3C0200BF 24422601 12020006 2694FFF8 24020001 0282A004 02802021 10000002 00142FC3 00002821 8FBF0034 00801021 00A01821 8FB50030 8FB4002C 8FB30028 8FB20024 8FB10020 8FB0001C 03E00008 27BD0038 End CFunction ' CFunction erasechip 00000000 27BDFFD8 AFB40020 AFB00010 AFBF0024 AFB3001C AFB20018 AFB10014 8CB30000 3C029D00 8C42001C 24030001 3C10BF80 AE035A30 0080A021 24050005 0040F809 02602021 24020006 AE025A20 3C03BF80 8C625A10 30420080 1040FFFD 3C109D00 8E02001C 3C11BF80 02602021 24050006 8E235A20 0040F809 00000000 8E02001C 02602021 0040F809 24050005 240200C7 AE225A20 3C03BF80 8C625A10 30420080 1040FFFD 3C029D00 8C42001C 02602021 24050006 3C03BF80 8C635A20 0040F809 3C119D00 3C10BF80 8E220004 0040F809 3404C350 8E22001C 02602021 0040F809 24050005 24020005 AE025A20 8E025A10 30420080 1040FFFD 00000000 8E025A20 AE125A20 8E025A10 30420080 1040FFFD 00000000 8E125A20 8E22001C 02602021 7C129420 0040F809 24050006 32420001 5440FFE6 8E220004 3C029D00 8C42001C 02602021 0040F809 24050005 24030003 3C02BF80 AC435A20 3C03BF80 8C625A10 30420080 1040FFFD 3C02BF80 8C435A20 3C03BF80 AC405A20 8C625A10 30420080 1040FFFD 3C02BF80 8C435A20 3C03BF80 AC405A20 8C625A10 30420080 1040FFFD 3C02BF80 8C435A20 3C03BF80 AC405A20 8C625A10 30420080 1040FFFD 00000000 8E820004 3C03BF80 8C635A20 5C400006 3C02BF80 14400014 3C029D00 8E820000 10400010 3C02BF80 AC525A20 3C03BF80 8C625A10 30420080 1040FFFD 3C029D00 8C42001C 02602021 24050006 3C03BF80 8C635A20 0040F809 00000000 10000007 00001021 3C029D00 8C42001C 02602021 0040F809 24050006 24020001 8FBF0024 8FB40020 8FB3001C 8FB20018 8FB10014 8FB00010 03E00008 27BD0028 End CFunction ' Csub writepage 00000000 27BDFFD8 AFB3001C AFB10014 AFB00010 AFBF0024 AFB40020 AFB20018 8CD30000 3C029D00 8C42001C 8C940000 24030001 3C11BF80 AE235A30 00A08021 02602021 0040F809 24050005 24020006 0014A200 AE225A20 3C03BF80 8C625A10 30420080 1040FFFD 3C119D00 8E22001C 3C12BF80 02602021 24050006 8E435A20 0040F809 00000000 8E22001C 02602021 0040F809 24050005 24020002 AE425A20 3C03BF80 8C625A10 30420080 1040FFFD 3C02BF80 7E843C00 8C435A20 3C03BF80 AC445A20 8C625A10 30420080 1040FFFD 3C02BF80 7E943A00 8C435A20 3C03BF80 AC545A20 8C625A10 30420080 1040FFFD 3C02BF80 8C435A20 3C03BF80 AC405A20 8C625A10 30420080 1040FFFD 3C02BF80 8C425A20 00002021 3C03BF80 240500FF 02041021 80420000 AC625A20 8C625A10 30420080 1040FFFD 00000000 8C625A20 10850003 3C029D00 1000FFF5 24840001 8C42001C 02602021 0040F809 24050006 24120100 3C119D00 3C10BF80 8E220004 0040F809 240400FA 8E22001C 02602021 0040F809 24050005 24020005 AE025A20 8E025A10 30420080 1040FFFD 00000000 8E025A20 AE125A20 8E025A10 30420080 1040FFFD 00000000 8E125A20 8E22001C 02602021 0040F809 24050006 32420001 5440FFE7 8E220004 8FBF0024 8FB40020 8FB3001C 8FB20018 8FB10014 8FB00010 03E00008 27BD0028 End Csub ' Csub readpage 00000000 27BDFFD8 AFB3001C AFB20018 AFB10014 AFBF0024 AFB40020 AFB00010 8CD20000 3C029D00 8C42001C 8C940000 24030001 3C13BF80 AE635A30 00A08821 02402021 0040F809 24050005 24020003 0014A200 AE625A20 3C03BF80 8C625A10 30420080 1040FFFD 3C02BF80 7E843C00 8C435A20 3C03BF80 AC445A20 8C625A10 30420080 1040FFFD 3C02BF80 7E943A00 8C435A20 3C03BF80 AC545A20 8C625A10 30420080 1040FFFD 3C02BF80 8C435A20 3C03BF80 AC405A20 8C625A10 30420080 1040FFFD 3C02BF80 8C425A20 00002021 3C03BF80 24050100 AC705A20 8C625A10 30420080 1040FFFD 00000000 8C705A20 02241021 24840001 7C108420 1485FFF6 A0500000 3C029D00 8C42001C 02402021 0040F809 24050006 8FBF0024 8FB40020 8FB3001C 8FB20018 8FB10014 8FB00010 03E00008 27BD0028 End Csub ' CFunction getfirstfreebyte 00000000 90830000 240200FF 00003021 10620014 00003821 90830001 1062000A 24020001 24020002 240500FF 24080100 00821821 90630000 54650006 24420001 10000002 00403021 00403021 10000005 00023FC3 5448FFF7 00821821 24060100 00003821 00C01021 03E00008 00E01821 End CFunction ' CFunction loadstring 00000000 8CC30000 90820000 00621021 0043302A 14C0000A 24660001 00A31821 90870000 24C60001 24C5FFFF 0045282A A0670000 24840001 10A0FFF9 24630001 03E00008 00021FC3 End CFunction ' CFunction getstring 00000000 8CC20000 00A21821 90690000 01224821 0122182A 5460000C 25220001 24430001 00A21021 90480000 24630001 2467FFFF 0127382A A0880000 24420001 10E0FFF9 24840001 25220001 00021FC3 ACC30004 ACC20000 00A92821 90A20001 03E00008 00001821 End CFunction ' '**************************** ' test data generation ' 'small sub testdata DATA "one", "two", "three", "four", "five", "six", "seven", "eight", "nine", "ten" DATA "eleven", "twelve", "thirteen", "fourteen", "fifteen", "sixteen", "seventeen", "eighteen", "nineteen" 'tens DATA "twenty", "thirty", "forty", "fifty", "sixty", "seventy", "eighty", "ninety" 'big DATA "thousand", "million", "billion" dim small(19) AS STRING length 10, tens(7) AS STRING length 10, big(2) AS STRING length 10 FOR i = 1 TO 19 READ small(i) NEXT FOR i = 0 TO 7 READ tens(i) NEXT FOR i = 0 TO 2 READ big(i) NEXT ' end sub . FUNCTION int2Text(number AS integer) as string local num AS integer, outP AS STRING length 60, unit AS INTEGER local tmpLng1 AS integer IF 0 = number THEN int2Text = "zero" EXIT FUNCTION END IF num = ABS(number) DO tmpLng1 = num MOD 100 SELECT CASE tmpLng1 CASE 1 TO 19 outP = small(tmpLng1) + " " + outP CASE 20 TO 99 SELECT CASE tmpLng1 MOD 10 CASE 0 outP = tens((tmpLng1 \ 10) - 2) + " " + outP CASE ELSE outP = tens((tmpLng1 \ 10) - 2) + "-" + small(tmpLng1 MOD 10) + " " + outP END SELECT END SELECT tmpLng1 = (num MOD 1000) \ 100 IF tmpLng1 THEN outP = small(tmpLng1) + " hundred " + outP END IF num = num \ 1000 IF num < 1 THEN EXIT DO tmpLng1 = num MOD 1000 IF tmpLng1 THEN outP = big(unit) + " " + outP unit = unit + 1 LOOP IF number < 0 THEN outP = "negative " + outP Do WHILE ASC(RIGHT$(outp,1))<=32 outp = LEFT$(outp,len(outp)-1) loop int2Text = outP END FUNCTION '********************************* |
||||
MicroBlocks![]() Guru ![]() Joined: 12/05/2012 Location: ThailandPosts: 2209 |
Hi Peter, I have added a winbond chip footprint to my 44 pinner module and i would like to ask you if i can get away with using a single 10k pullup resistor for both the HOLD and WRITE PROTECT pins. Space is getting tight and dropping a resistor gives just enough room for the traces. I think it is not a problem. Not much is mentioned in the datasheet, i even think i can directly connect it to VDD as both pins are probably only input pins and will not draw much current. I don't have a chip in my possession yet so i can not test it at the moment. Microblocks. Build with logic. |
||||
matherp Guru ![]() Joined: 11/12/2012 Location: United KingdomPosts: 10066 |
On the TFT displays they are connected direct to VDD and it works fine. Can't easily measure current but I would assume it is negligible |
||||
MicroBlocks![]() Guru ![]() Joined: 12/05/2012 Location: ThailandPosts: 2209 |
Thanks Peter! Microblocks. Build with logic. |
||||
Grogster![]() Admin Group ![]() Joined: 31/12/2012 Location: New ZealandPosts: 9483 |
Yeah, the datasheet does not specify if those pins need pull-ups. At the moment, I am treating them like EEPROM chips and assuming they have internal pull-ups, meaning that WP can be left floating, and just pulled down to deck to enable WP mode. My chips arrived today, so I will try to get one hooked up to test. Smoke makes things work. When the smoke gets out, it stops! |
||||
MicroBlocks![]() Guru ![]() Joined: 12/05/2012 Location: ThailandPosts: 2209 |
This is how i wired them in the schematic. ![]() If you could do a little test that would be great as i don't have the parts yet. Microblocks. Build with logic. |
||||
piclover Senior Member ![]() Joined: 14/06/2015 Location: FrancePosts: 134 |
I don't see why you use a pull up on ~HOLD and ~WP: these could be tied up directly to Vcc. On the other hand, there should be a pullup resistor on ~CS, so that on power on and before the Micromite pins are properly configured (and thus the CS pin properly driven), there is no risk of spurious writes to the flash chip, due to floating pins. |
||||
MicroBlocks![]() Guru ![]() Joined: 12/05/2012 Location: ThailandPosts: 2209 |
Peters configuration was with a pullup on both ~HOLD and ~WP. The datasheet does not specify if a pullup is needed or if it can be tied to Vdd directly, hence my question as the only way to find out is to test it. The snippet from the schematic has to be changed to work correctly. I agree about the pullup on the ~CS, i not like floating pins at all. It could be however that that pin has an internal pullup. Back to the datasheet again..... Microblocks. Build with logic. |
||||
matherp Guru ![]() Joined: 11/12/2012 Location: United KingdomPosts: 10066 |
I'm pretty certain when I was doing the development I tried this and it didn't work - a proper external pullup was needed, either resistor or tied to VDD. Agreed: I just think it is good practice to always use a resistor - just protects the chip and makes it easier to connect a uP pin at a later date Agreed |
||||
MicroBlocks![]() Guru ![]() Joined: 12/05/2012 Location: ThailandPosts: 2209 |
Ok, i have updated the schematics. The datasheet does not mention an internal pullup on the ~CS pin. ![]() Microblocks. Build with logic. |
||||
Grogster![]() Admin Group ![]() Joined: 31/12/2012 Location: New ZealandPosts: 9483 |
...the bloody datasheet does not mention the requirements for pull-ups at all on any pins, and it is something that really should be there in the PDF. The fact it was missing, made me think that it must therefore have internal pull-ups, and you don't need to worry about them. If it was important, they would have written about that in the datasheet. False logic? Perhaps..... I use jumpers or solder-blob pads to pull WP to deck(ground) on the I2C EEPROM type chips pretty much as standard design, so that you can choose between writeable and write-protected modes easily later, and this concept requires pull-ups rather then direct connection to supply(or you would short out the supply), unless this is documented and allowed for in the PDF(device has internal pull-ups kind of thing). Again, if the datasheet was to have been kind enough to have enlightened us on that aspect of the device, that would have been nice. ![]() My design will therefore use three 10k pull-ups: WP, HOLD and CS. I have space, but I realise this is not quite for you, MB. @ matherp - did you have pull-ups on the data lines, or just WP, CS and HOLD? Smoke makes things work. When the smoke gets out, it stops! |
||||
MicroBlocks![]() Guru ![]() Joined: 12/05/2012 Location: ThailandPosts: 2209 |
There is one hint in the datasheet: WARNING: if the /WP or /HOLD pins are tied directly to the power supply or ground during standard SPI or DUAL SPI operation, the QE bit should never be set to a 1. The QE bit stands for 'Quad Enable'. If that bit is set then the /WP and /HOLD pin will be IO pins that can cause a short. That is settled then. Use a pullup resistor on each one of them. Bummer, now i have to find some more space...... Microblocks. Build with logic. |
||||
Grogster![]() Admin Group ![]() Joined: 31/12/2012 Location: New ZealandPosts: 9483 |
Nice find, buddy. What a cryptic way of saying: 'Suitable pull-up resistors should be used on WP, HOLD and CS pins." You can get those tiny resistor arrays in 1206 or even 0805 - usually four resistors in one, the size of the 1206 or 0805 package. That is an option for you if you are really squeezed for space. Smoke makes things work. When the smoke gets out, it stops! |
||||
MicroBlocks![]() Guru ![]() Joined: 12/05/2012 Location: ThailandPosts: 2209 |
Now to squeeze in those two resistors. Not much room to play with. ![]() ![]() I will have a look at those arrayss. I need five resistors. two for the I2C pullup, and three for the winbond chip. It might be possible as i can move the I2C pullups to another area of the PCB. Oh boy, this is going to be some rework.... Microblocks. Build with logic. |
||||
Grogster![]() Admin Group ![]() Joined: 31/12/2012 Location: New ZealandPosts: 9483 |
Just in case you don't know what I am getting at: 0805 resistor array, 10k x 4 The total size is 0805, made up out of 4x 0402 10k resistors - VERY tiny. The link above is an example only - one euro per 0805 + postage is a bit rich for my blood..... EDIT: Element14 actually have them MUCH cheaper then the eBay price, which is not something often said. ![]() Element14 10x x 4 0805 SMD resistor array 4c each in our NZ dollars, MOQ of 150 pcs, so six bucks in my money for 150 arrays. Your local Element14 probably uses the same part number, if you wanted to try them. Smoke makes things work. When the smoke gets out, it stops! |
||||
MicroBlocks![]() Guru ![]() Joined: 12/05/2012 Location: ThailandPosts: 2209 |
Yeah those are a great find. I was looking but somehow my google fu is letting me down a bit this week. Not only a great space saver but also when placing it, it is much more easy and less time consuming. One placement instead of four. My concern now is that i planned on those parts to be optional. The memory chips are soic's so still not to difficult to add later. I am not sure about the resistor array, although it looks like the spacing is about 0.5mm which is not too bad. edit: I did get those two extra resistor squeezed in, but now i am intrigued by those resistor arrays as they can be a real timesaver. Microblocks. Build with logic. |
||||
Grogster![]() Admin Group ![]() Joined: 31/12/2012 Location: New ZealandPosts: 9483 |
@ matherp - If I wanted to use your code as a method to store my database for a system I have, but NOT use it as a logger per-se, can I just use the raw Cfunctions? I don't care about wasted or unused space on any one page, and every single entry in the database would have it's own page. As the chip has 4096 pages, there are plenty of pages for my purposes without caring at all about wasted space on any one page. So, essentially, just pagewriting and page reading to strings. With that in mind, and if the answer to that is 'Yes', the other thing I want to know is that does the Cfunction 'Erasechip' format and write the indexes, or are the indexes handled by the rest of the BASIC code? I think it is the latter, based on a quick look. I don't even need indexes, as the pages would be memory-mapped, and certain data would be stored on certain pages and would never change as far as addressing is concerned. I am going to have a play with this tomorrow with any luck, but while I sleep, you might be able to answer if I can pervert your concept to use it like this or not. Smoke makes things work. When the smoke gets out, it stops! |
||||
piclover Senior Member ![]() Joined: 14/06/2015 Location: FrancePosts: 134 |
Nice find !... On the data sheet I found (http://www.farnell.com/datasheets/1674439.pdf), there is not even a "warning" word used (CTRL F + "warning" -> no result)... Plus, on page 12, figure 5 (block diagram), both W# (=WP) and H# (=HOLD) are clearly represented as inputs only, while DQ0/DQ1 are indeed represented as I/O... Go figure ! ![]() |
||||
matherp Guru ![]() Joined: 11/12/2012 Location: United KingdomPosts: 10066 |
Yes: the usage should be obvious from the Basic code. You can use a string variable as the buffer but it must be length 255 The latter, erasechip just erases and checks that the erase has worked (all bytes =&HFF) |
||||
![]() ![]() ![]() ![]() |
![]() |
![]() |
The Back Shed's forum code is written, and hosted, in Australia. | © JAQ Software 2025 |