Home  |  Contents 

Microcontroller and PC projects
  Forum Index : Microcontroller and PC projects         Section
Subject Topic: uM2(+): data logging - cheap fast & easy Post ReplyPost New Topic
<< Prev Page of 9 Next >>
Author
Message << Prev Topic | Next Topic >>
drkl
Senior Member
Senior Member
Avatar

Joined: 18 October 2015
Location: Hungary
Online Status: Offline
Posts: 102
Posted: 27 March 2016 at 7:36pm | IP Logged Quote drkl

Hello,

Why not use the Microchip SST26VF032B flash? I try: JEDEC code, size ok,
write ok , but read back is nothing.

drkl


Back to Top View drkl's Profile Search for other posts by drkl Visit drkl's Homepage
 
matherp
Guru
Guru


Joined: 11 December 2012
Location: United Kingdom
Online Status: Offline
Posts: 2340
Posted: 27 March 2016 at 9:43pm | IP Logged Quote matherp

Quote:
Why not use the Microchip SST26VF032B flash? I try: JEDEC code, size ok,
write ok , but read back is nothing.


One problem is that the JEDEC ID doesn't give the flash size in the same format as Winbond. For Winbond the last part of the ID specifies the size as 2^ID2 bytes so for ID &HEF4016 &H16=4Mbyte, EF4017 = 8Mb, EF4014=1Mb etc.

The software uses this to set the size of the index.

The Microchip part sets the "size " as &H42. 2^&H42 means that the whole flash is dedicated to the index and nothing can be written.

To cater for this the full Microchip ID would have to be hardcoded in the pagecount CFunction then it might work if there is nothing else incompatible.

UPDATE

drkl

Please could you substitute this version of the CFunction in the code and see if it works with the Microchip flash

CFunction pagecount
    00000000
    27BDFFC8 AFB20024 AFBF0034 AFB50030 AFB4002C AFB30028 AFB10020 AFB0001C 
    8CB00000 3C029D00 8C420088 00101880 00621021 8C420000 24030008 10430007 
    00809021 3C029D00 8C420010 02002021 24050008 0040F809 00003021 3C029D00 
    8C42001C 02002021 0040F809 24050005 2403009F 3C02BF80 AC435820 3C03BF80 
    8C625810 30420080 1040FFFD 3C02BF80 8C435820 3C03BF80 AC405820 8C625810 
    30420080 1040FFFD 3C02BF80 8C545820 3C03BF80 AC405820 8C625810 30420080 
    1040FFFD 3C02BF80 8C555820 3C03BF80 AC405820 8C625810 30420080 1040FFFD 
    3C119D00 8E22001C 02002021 24050006 3C03BF80 8C735820 0040F809 00148200 
    24020010 AFA20010 02158021 8E220030 00108200 02138021 26440001 02003021 
    0040F809 00103FC3 24020006 A2420000 3C0200BF 24422642 24044000 1202000B 
    00002821 3C0200BF 24422602 12020006 2673FFF8 24020001 02629804 02602021 
    10000002 00132FC3 00002821 8FBF0034 00801021 00A01821 8FB50030 8FB4002C 
    8FB30028 8FB20024 8FB10020 8FB0001C 03E00008 27BD0038 
End CFunction


Edited by matherp on 28 March 2016 at 9:20am
Back to Top View matherp's Profile Search for other posts by matherp
 
drkl
Senior Member
Senior Member
Avatar

Joined: 18 October 2015
Location: Hungary
Online Status: Offline
Posts: 102
Posted: 28 March 2016 at 9:33pm | IP Logged Quote drkl

Dear Peter,

Thank you so much to deal with Microchip SST26VF032 memory.
We have prepared a Micromite practices panel:
https://shop.chipcad.hu/Welcome/Default.aspx?scenarioID=301&StockCode=SAJ790&ViewProduct=true&pid=1551#TabControl-2

and that it is such a chip.

I wrote to a chip testprogram, but there is also a specialty.
Shall be used:

CONST ULBPL=& H98 'GLOBAL UNLOCK PROTECTION BLOCK
SNDCMD (ULBPL)

before format and write.

ULBPL SOORCE: http://electronics.stackexchange.com/questions/156429/cant-seem-to-write-to-spi-flash

The amendment which was sent, the result:

> RUN
JEDEC ID = BF2642
Memory size is 32 Mbits
Format complete
1,000 records constructed and logged in 9 seconds
>
Reading is nothing (due to lack ULBPL-by my opinion)

Best regards

drkl

Back to Top View drkl's Profile Search for other posts by drkl Visit drkl's Homepage
 
matherp
Guru
Guru


Joined: 11 December 2012
Location: United Kingdom
Online Status: Offline
Posts: 2340
Posted: 29 March 2016 at 4:10pm | IP Logged Quote matherp

Why do Microchip have to make things so difficult

Please try this version and let me know if it works.

NB for anyone using Winbond chips, stick with the original SMALLER version

CFunction pagecount
    00000000
    27BDFFC8 AFB30028 AFBF0034 AFB50030 AFB4002C AFB20024 AFB10020 AFB0001C 
    8CB00000 3C029D00 8C420088 00101880 00621021 8C420000 24030008 10430007 
    00809821 3C029D00 8C420010 02002021 24050008 0040F809 00003021 3C029D00 
    8C42001C 02002021 0040F809 24050005 2403009F 3C02BF80 AC435820 3C03BF80 
    8C625810 30420080 1040FFFD 3C02BF80 8C435820 3C03BF80 AC405820 8C625810 
    30420080 1040FFFD 3C02BF80 8C515820 3C03BF80 AC405820 8C625810 30420080 
    1040FFFD 3C02BF80 8C555820 3C03BF80 AC405820 8C625810 30420080 1040FFFD 
    3C129D00 8E42001C 3C03BF80 02002021 24050006 8C745820 0040F809 00118A00 
    24020010 AFA20010 02358821 8E420030 00118A00 02348821 26640001 02203021 
    0040F809 00113FC3 24020006 A2620000 3C0200BF 24422642 24124000 12220030 
    00009821 3C0200BF 24422602 1222002B 3C029D00 8C42001C 02002021 0040F809 
    24050005 24030006 3C02BF80 AC435820 3C03BF80 8C625810 30420080 1040FFFD 
    3C119D00 8E22001C 3C15BF80 02002021 24050006 8EA35820 0040F809 00000000 
    8E22001C 02002021 0040F809 24050005 24020098 AEA25820 3C03BF80 8C625810 
    30420080 1040FFFD 3C029D00 8C42001C 02002021 24050006 3C03BF80 8C635820 
    0040F809 2694FFF8 24020001 0282A004 02809021 10000002 00149FC3 00009821 
    8FBF0034 02401021 02601821 8FB50030 8FB4002C 8FB30028 8FB20024 8FB10020 
    8FB0001C 03E00008 27BD0038 
End CFunction
Back to Top View matherp's Profile Search for other posts by matherp
 
drkl
Senior Member
Senior Member
Avatar

Joined: 18 October 2015
Location: Hungary
Online Status: Offline
Posts: 102
Posted: 29 March 2016 at 6:05pm | IP Logged Quote drkl

Hello Peter,

It operates!!!

Many, many thanks for you.
You are an always helpful, (and very clever) man.

drkl







Back to Top View drkl's Profile Search for other posts by drkl Visit drkl's Homepage
 
paceman
Guru
Guru


Joined: 07 October 2011
Location: Australia
Online Status: Offline
Posts: 1170
Posted: 06 April 2016 at 10:59am | IP Logged Quote paceman

matherp wrote:
I should have mentioned in the original post that the spare pad on the back of many TFT displays will take one of the 25Q series chips and, at least on the displays I've checked, is correctly wired. The only additional connection is to the F_CS chip select pin on the display.

Peter, would putting a 25Q on these panels then allow an "in-built" touch calibration to be made permanently available, say on page 1, rather than having to re-calibrate when e.g. firmware is updated, libraries erased, processors changed etc.

Greg
Back to Top View paceman's Profile Search for other posts by paceman
 
panky
Guru
Guru
Avatar

Joined: 02 October 2012
Location: Australia
Online Status: Offline
Posts: 549
Posted: 07 April 2016 at 12:28am | IP Logged Quote panky

Peter,

Could you expand a little more on using the 25Q chip please? My 7" display has an unoccupied chip position labelled U2 adjacent to the SD card connector - is that what you are referring to?

Cheers,
Doug.


__________________
DonTSM1,Duinomite,CGCMM1,CGCMM2,2xDimitech,3xWWuMites,MicksMuP,Grogster1A,4xPeterMuM+,Zonker DIP-600,3xCGuKits,CGuBoard2,SnadPic100,SCBP64 & Exp100,PMMZ144,PMMZ100 .. and loving it![:D
Back to Top View panky's Profile Search for other posts by panky
 
matherp
Guru
Guru


Joined: 11 December 2012
Location: United Kingdom
Online Status: Offline
Posts: 2340
Posted: 07 April 2016 at 8:17am | IP Logged Quote matherp

Quote:
My 7" display has an unoccupied chip position labelled U2 adjacent to the SD card connector - is that what you are referring to?


Yes - just solder the 25Q onto those pads and connect the Micromite to the F_CS pin to use as the chip se3lect
Back to Top View matherp's Profile Search for other posts by matherp
 
disco4now
Senior Member
Senior Member


Joined: 18 December 2014
Location: Australia
Online Status: Offline
Posts: 281
Posted: 07 April 2016 at 10:20am | IP Logged Quote disco4now

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
Back to Top View disco4now's Profile Search for other posts by disco4now
 
matherp
Guru
Guru


Joined: 11 December 2012
Location: United Kingdom
Online Status: Offline
Posts: 2340
Posted: 07 April 2016 at 11:28am | IP Logged Quote matherp

Quote:
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.






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 
'********************************* 


Edited by matherp on 07 April 2016 at 3:58pm
Back to Top View matherp's Profile Search for other posts by matherp
 
MicroBlocks
Guru
Guru
Avatar

Joined: 12 May 2012
Location: Thailand
Online Status: Offline
Posts: 2190
Posted: 27 April 2016 at 4:51pm | IP Logged Quote MicroBlocks

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.
Back to Top View MicroBlocks's Profile Search for other posts by MicroBlocks
 
matherp
Guru
Guru


Joined: 11 December 2012
Location: United Kingdom
Online Status: Offline
Posts: 2340
Posted: 27 April 2016 at 5:19pm | IP Logged Quote matherp

Quote:
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


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

Edited by matherp on 27 April 2016 at 5:20pm
Back to Top View matherp's Profile Search for other posts by matherp
 


<< Prev Page of 9 Next >>
In the news...
 
Post ReplyPost New Topic
Printable version Printable version
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum

Powered by Web Wiz Forums version 7.8
Copyright ©2001-2004 Web Wiz Guide

This page was generated in 0.1406 seconds.
Privacy Policy     Process times : 0, 0, 0, 0.14