Home  |  Contents 
Microcontroller and PC projects
  Forum Index : Microcontroller and PC projects         Section
Subject Topic: MM+: Pictures on serial flash Post ReplyPost New Topic
Page of 2 Next >>
Author
Message << Prev Topic | Next Topic >>
matherp
Guru
Guru


Joined: 11 December 2012
Location: United Kingdom
Online Status: Offline
Posts: 1851
Posted: 16 September 2016 at 3:55pm | IP Logged Quote matherp

In this thread we developed code to use a serial flash chip (e.g.Winbond 25Q32) for some data logging activities.

These chips are particularly convenient because they can be mounted on the back of many TFT displays



For an application I'm writing I need to display some images but don't want to use an SD card for the runtime code so it seemed sensible to store them on the serial flash chip.

To do this I have written a program that reads an image off SD card and then stores it on the flash.

There is only one function:

storepic(1000,"leopardA.ppm")


This takes the image file "leopardA.ppm" and stores it from page 1000 upwards on the flash chip. The image file on the SDcard must be in ASCII .PPM format.

A 800x480 24-bit image file takes 88 seconds to write to the flash card and takes 4717 pages of the flash (a 32Mbit flash chip has 16384 pages). You can store as many images as there is space on the flash chip but it is your responsibility to make sure the pages used don't overlap. The storepic routine reports flash usage to help with this.

To display the picture there is a similarly simple function

displaypicture(1000,0,0)


1000 is the start page of the picture in the flash as defined in the storepic example command and the two zeroes are the x,y coordinates of the top left of the picture.

The displaypicture command only takes 2.7 seconds for a 800x480 24-bit image, much faster (5x) than displaying from SDcard.

The programs should run on any Micromite+ but note you need to uncomment the appropriate display CFunctions for 64 or 100-pin.

In both programs you need to define the MM+ pin that is connected to the F-CS connection on the display (see picture). Version 1A of the Explore100 ties this pin high and won't work - I haven't got a later version to test with.

The flash handling CFunctions are exactly the same as those in the logging thread with the exception that the read command has been turned from a subroutine into a function returning a string which is now possible since V5.2 of the MM+ firmware.

Store program

option explicit    
option default none    
dim integer i    
const cspin=21 'chip select pin for serial flash chip 
'    
'  Example program to demonstrate storing pictures on a serial flash chip mounted on a SSD1963   
'  Compatible with 64 and 100 pin MM+ processors   
'    
    print "Initialising memory chip with"; 
    print initchip(1,cspin), " pages" 'iniitialise the chip with full erase 
    timer=0
    storepic(1000,"leopardA.ppm")
    print timer
end    
'    
'****************************************    
'  
'  
function initchip(eraseit as integer, cspin as integer) as integer
  local d$
  local integer i=getpagecount(d$,cspin)*256 
  if eraseit then 
    if not (erasechip(i,cspin)) then   
      print "erase failed"   
      end   
    endif   
'    print "Erase complete"  
  endif 
  initchip=i\256
end function

Sub storepic(location%, PIC$) 
  LOCAL inbuff$,binbuff$,outbuff$=""
  local p%=0
  print "Starting picture at page ",location%
  open pic$ for input as #1
  line input #1,inbuff$
  if inbuff$="P3" then
    writepage(location%,"P6",cspin): location%=location%+1
    do 
      line input #1,inbuff$
      if len(inbuff$)<40 then 
        writepage(location%,inbuff$,cspin): location%=location%+1
      endif
    loop while len(inbuff$)<40
    binstring(inbuff$,outbuff$)
    do while not eof(#1)
      line input #1,inbuff$
      binstring(inbuff$,binbuff$)
      if len(outbuff$)+len(binbuff$)>255 then
        writepage(location%,outbuff$,cspin): location%=location%+1
        p%=p%+len(outbuff$)
        outbuff$=binbuff$
      else
        outbuff$=outbuff$+binbuff$
      endif
    loop
    writepage(location%,outbuff$,cspin)
    p%=p%+len(outbuff$)
    print "Ending picture at page ",location%, " ",p%," bytes written"
  else
    print "Invalid picture format - should be ASCII .PPM"
  endif
end sub
'
CSub binstring
    00000000
    90820000 00821821 90660000 24030020 10C30004 24060020 24420001 00821821 
    A0660000 28430002 14600015 240A0001 24030001 240B0020 00003021 00833821 
    90E70000 00064840 000640C0 01284021 24630001 10EB0005 24E9FFD0 1462FFF7 
    01283021 10000009 00AA1021 00AA4021 0062382A A1060000 14E0FFEF 254A0001 
    2544FFFF 03E00008 A0A40000 A0460000 1000FFFB 254A0001 
End CSub

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 

CSUB writepage 
    00000000 
    27BDFFD8 AFB3001C AFB10014 AFB00010 AFBF0024 AFB40020 AFB20018 8CD30000  
    3C029D00 8C42001C 8C940000 24030001 3C10BF80 AE035A30 00A08821 02602021  
    0040F809 24050005 24020006 0014A200 AE025A20 3C03BF80 8C625A10 30420080  
    1040FFFD 3C109D00 8E02001C 3C12BF80 02602021 24050006 8E435A20 0040F809  
    00000000 8E02001C 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 00008021 3C03BF80 24040100 02301021  
    80420000 AC625A20 8C625A10 30420080 1040FFFD 00000000 26100001 8C625A20  
    1604FFF7 02301021 3C029D00 8C42001C 02602021 0040F809 24050006 3C129D00  
    3C11BF80 8E420004 0040F809 24040064 8E42001C 02602021 0040F809 24050005  
    24020005 AE225A20 8E225A10 30420080 1040FFFD 00000000 8E225A20 AE305A20  
    8E225A10 30420080 1040FFFD 00000000 8E305A20 8E42001C 02602021 0040F809  
    24050006 32020001 5440FFE7 8E420004 8FBF0024 8FB40020 8FB3001C 8FB20018  
    8FB10014 8FB00010 03E00008 27BD0028  
End CSUB 
'


Display program

option explicit
option default none
'
const cspin=21
'
const forread=1
const forwrite=0
'
initchip(0,cspin)
cls
timer=0
displaypicture(1000,0,0)
print timer
end

Sub Displaypicture(l%, StartX%, StartY%)   
  LOCAL Buffer$
  local a%,numbytes%
  buffer$=readpage$(l%,cspin):l%=l%+1  
  if buffer$="P6" then  
    buffer$=readpage$(l%,cspin):l%=l%+1  
    if left$(buffer$,1)="#" then  
        buffer$=readpage$(l%,cspin):l%=l%+1  
    endif
    a%=instr(buffer$,chr$(32)) ' look for the space between dimensions   
    local width%=val(left$(buffer$,a%-1))   
    buffer$=right$(buffer$,len(buffer$)-a%)   
    LOCAL height%=val(left$(buffer$,a%-1))  
    numbytes%=width%*height%*3 
    buffer$=readpage$(l%,cspin):l%=l%+1   'skip past the colour depth
    if (StartX%+width%>MM.HRES) OR (StartY%+height%>MM.VRES) then    
      print pic$," too big", width%," x",height%   
    else  
      defineregionSSD StartX%, StartY%, width%, height%, forwrite
      do 
          buffer$=readpage$(l%,cspin):l%=l%+1  
          DisplaybufferSSD(buffer$)
          numbytes%=numbytes%-len(buffer$)
      loop while numbytes%
    endif   
  else   
     Print "Invalid File Format"   
  endif
end sub
'
sub initchip(eraseit as integer, cs as integer) 
  local d$
  local integer i=getpagecount(d$,cs)*256 
  if eraseit then 
    if not (erasechip(i,cs)) then   
      print "erase failed"   
      end   
    endif   
    print "Erase complete"  
  endif 
end sub 
'
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
'
CFunction readpage$(integer, integer) string
    00000000
    27BDFFD8 AFBF0024 AFB40020 AFB20018 AFB10014 AFB3001C AFB00010 3C129D00
    8E420040 0080A021 24040100 0040F809 8CB30000 00408821 8E42001C 8E940000
    24030001 3C12BF80 AE435A30 02602021 0040F809 24050005 24020003 0014A200
    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 02202021 26250100
    3C03BF80 AC705A20 8C625A10 30420080 1040FFFD 00000000 8C705A20 A0900000
    24840001 1485FFF7 3C029D00 8C42001C 02602021 0040F809 24050006 8FBF0024
    02201021 8FB40020 8FB3001C 8FB20018 8FB10014 8FB00010 03E00008 27BD0028
End CFunction
'
' 64-pin routines
'
CSub DisplayBufferSSD
    00000000
    14A00003 90880000 10000004 24050001 8CA80000 00002821 2508FFFF 00A8102A
    10400017 00852021 3C02BF88 24030800 90870000 24A50003 00A8302A 34E71800
    AC476430 AC436134 AC436138 90870001 34E71800 AC476430 AC436134 AC436138
    90870002 24840003 34E71800 AC476430 AC436134 AC436138 54C0FFEE 90870000
    03E00008 00000000
End CSub
'
CSub DefineRegionSSD
    00000000
    3C029D00 8C420090 8C830000 8CA50000 8CC40000 24081000 8CE60000 3C07BF88
    ACE86134 80420015 24A7FFFF 2468FFFF 00E63821 24060001 10460004 01042021
    24060003 14460005 3C029D00 00604821 00804021 10000008 00E01821 8C420094
    00A04821 00E04021 8C420000 2442FFFF 00442823 00431823 00096202 00085A02
    3C02BF88 24060800 24071000 00052202 00035202 35081800 358C1800 35291800
    356B1800 240D022A AC4D6430 34841800 AC466134 34A51800 AC466138 354A1800
    AC476138 34631800 AC4C6430 AC466134 AC466138 AC496430 AC466134 AC466138
    AC4B6430 AC466134 AC466138 AC486430 2408022B AC466134 AC466138 AC476134
    AC486430 AC466134 AC466138 AC476138 AC446430 AC466134 AC466138 AC456430
    AC466134 AC466138 AC4A6430 AC466134 AC466138 AC436430 AC466134 AC466138
    AC476134 8FA20010 8C420000 10400006 2403022C 2403022E 3C02BF88 AC436430
    10000004 3C02BF88 3C02BF88 AC436430 3C02BF88 24030800 AC436134 AC436138
    24031000 AC436138 03E00008 00000000
End CSub
'
' 100-pin routines
'
'CSub DisplayBufferSSD
'    00000000
'    14A00003 90880000 10000004 24050001 8CA80000 00002821 2508FFFF 00A8102A 
'    10400017 00852021 3C02BF88 24030200 90870000 24A50003 00A8302A 34E70300 
'    AC476430 AC436434 AC436438 90870001 34E70300 AC476430 AC436434 AC436438 
'    90870002 24840003 34E70300 AC476430 AC436434 AC436438 54C0FFEE 90870000 
'    03E00008 00000000 
'End CSub
''
'CSub DefineRegionSSD
'    00000000
'    3C029D00 8C420090 8C830000 8CA50000 8CC40000 24080100 8CE60000 3C07BF88 
'    ACE86434 80420015 24A7FFFF 2468FFFF 00E63821 24060001 10460004 01042021 
'    24060003 14460005 3C029D00 00604821 00804021 10000008 00E01821 8C420094 
'    00A04821 00E04021 8C420000 2442FFFF 00442823 00431823 00096202 00085A02 
'    3C02BF88 24060200 24070100 00052202 00035202 35080300 358C0300 35290300 
'    356B0300 240D022A AC4D6430 34840300 AC466434 34A50300 AC466438 354A0300 
'    AC476438 34630300 AC4C6430 AC466434 AC466438 AC496430 AC466434 AC466438 
'    AC4B6430 AC466434 AC466438 AC486430 2408022B AC466434 AC466438 AC476434 
'    AC486430 AC466434 AC466438 AC476438 AC446430 AC466434 AC466438 AC456430 
'    AC466434 AC466438 AC4A6430 AC466434 AC466438 AC436430 AC466434 AC466438 
'    AC476434 8FA20010 8C420000 10400006 2403022C 2403022E 3C02BF88 AC436430 
'    10000004 3C02BF88 3C02BF88 AC436430 3C02BF88 24030200 AC436434 AC436438 
'    24030100 AC436438 03E00008 00000000 
'End CSub





Edited by matherp on 16 September 2016 at 6:04pm



Back to Top View matherp's Profile Search for other posts by matherp
 
lew247
Guru
Guru
Avatar

Joined: 23 December 2015
Location: United Kingdom
Online Status: Offline
Posts: 790
Posted: 16 September 2016 at 6:10pm | IP Logged Quote lew247

You said "ASCII .PPM format"
I presume this isn't the same as the binary.PPM I use currently to read from the SD card?
Back to Top View lew247's Profile Search for other posts by lew247
 
matherp
Guru
Guru


Joined: 11 December 2012
Location: United Kingdom
Online Status: Offline
Posts: 1851
Posted: 16 September 2016 at 6:22pm | IP Logged Quote matherp

Quote:
I presume this isn't the same as the binary.PPM I use currently to read from the SD card?


No it is a variant in which all the data is in ascii format. See this post

I use PaintShopPro V7.04 for all my file manipulation. Came out in 1999 but still works perfectly on W10 and I think is now available for free download

Edited by matherp on 16 September 2016 at 6:23pm
Back to Top View matherp's Profile Search for other posts by matherp
 
Phil23
Guru
Guru


Joined: 27 March 2016
Location: Australia
Online Status: Offline
Posts: 1168
Posted: 16 September 2016 at 9:01pm | IP Logged Quote Phil23

matherp wrote:
I use PaintShopPro V7.04 for all my file manipulation. Came out in 1999 but still works perfectly on W10 and I think is now available for free download


It's worth taking a look at XnView for basic file manipulation too,
for those who don't have something.
Freeware for personal use; No ads or rubbish.

It's like the ASCII programmer Vs MP Labs; Instant load Vs wait.

I've got various versions of PS & PS Elements on different PC's here, but with XnView, all the basic functions are just a right click of the mouse away;
instantly loads, & I can open, crop, resize & convert an image in under 30 seconds.

Supports over 500 formats, ppm ASCII included.

Full download with all features is 17Meg. It's on all PC's here and it behaves like a natural extension of the Windows Shell.

Right Click can add this to the context menu, if desired.

XnView.




Phil.
Back to Top View Phil23's Profile Search for other posts by Phil23
 
jman
Guru
Guru
Avatar

Joined: 12 June 2011
Location: New Zealand
Online Status: Offline
Posts: 662
Posted: 16 September 2016 at 9:11pm | IP Logged Quote jman

matherp wrote:

To do this I have written a program that reads an image off SD card and then stores it on the flash.


Thanks Peter this great well done

Regards
Jman
Back to Top View jman's Profile Search for other posts by jman
 
Grogster
Guru
Guru
Avatar

Joined: 31 December 2012
Location: New Zealand
Online Status: Offline
Posts: 5166
Posted: 17 September 2016 at 7:00am | IP Logged Quote Grogster

matherp wrote:
Version 1A of the Explore100 ties this pin high and won't work - I haven't got a later version to test with.


Yes, version 1A of the E100 board has the F_CS pin tied high with one of the internal layers of the board, so not really easy or practicial to hack one of those for the F_CS pin access. 1A is the prototype run of boards, so......

Version 1B or greater are the first production-run boards, and F_CS was brought out and pulled high via a 10k resistor, so you can get at F_CS in the later versions of the board.

__________________
Smoke makes things work. When the smoke gets out, it stops!
Back to Top View Grogster's Profile Search for other posts by Grogster Visit Grogster's Homepage
 
lew247
Guru
Guru
Avatar

Joined: 23 December 2015
Location: United Kingdom
Online Status: Offline
Posts: 790
Posted: 06 December 2017 at 4:01am | IP Logged Quote lew247

Peter
I've started trying to get this working instead of the SD card as the SD card sometimes fails to read.

If I try and run the program to load the picture into the flash you posted above then I get the error
Quote:
[23] If Not (erasechip(i,cspin)) Then
Error: Function or array ERASECHIP not declared

IF I then add the erase function in the read program below I get this
Quote:
> RUN
Initialising memory chip with

and the programs just does nothing, I left it for almost an hour in case it was doing something.

The only difference is I used my own picture - converted to ASCII.ppm format
2017-12-06_040040_picture.zip

Any ideas where I've gone wrong?

I'm using an Explore 100 version B board and I used const cspin=21 'chip select pin for serial flash chip as I believe pin 58 is correct for the E100 board
Back to Top View lew247's Profile Search for other posts by lew247
 
lew247
Guru
Guru
Avatar

Joined: 23 December 2015
Location: United Kingdom
Online Status: Offline
Posts: 790
Posted: 06 December 2017 at 6:07am | IP Logged Quote lew247

I reconverted the picture to ASCII.PPM format and it now gets a "bit" further but still doesn't seem to finish loading the picture
It now gets this far
> RUN
Initialising memory chip with 32768      pages
Starting picture at page       1000


Edited by lew247 on 06 December 2017 at 6:07am
Back to Top View lew247's Profile Search for other posts by lew247
 
Grogster
Guru
Guru
Avatar

Joined: 31 December 2012
Location: New Zealand
Online Status: Offline
Posts: 5166
Posted: 06 December 2017 at 7:21am | IP Logged Quote Grogster

Lew247 wrote:
I've started trying to get this working instead of the SD card as the SD card sometimes fails to read.


I'm not Peter, but I was intrigued by that statement. I have never had read problems with the SD card - or write ones for that matter. Can you elaborate on your issue? I'm just curious.

__________________
Smoke makes things work. When the smoke gets out, it stops!
Back to Top View Grogster's Profile Search for other posts by Grogster Visit Grogster's Homepage
 
lew247
Guru
Guru
Avatar

Joined: 23 December 2015
Location: United Kingdom
Online Status: Offline
Posts: 790
Posted: 06 December 2017 at 7:29am | IP Logged Quote lew247

When I am running the weather station it gets the weather icon codes from Openweathermap for today and the next few days
It then displays todays icon on the screen and does this everytime it updates the online conditions.
Occasionally it will throw up an SD card error like this
[728] SDcard readfile,buff(),-1,4095,NumBytes%
Error: Disk Error


Which is why I wanted to get this working, it would both remove the having to have an sd card in and also make it neater because the card wouldn't be sticking out of the bottom


Edited by lew247 on 06 December 2017 at 5:19pm
Back to Top View lew247's Profile Search for other posts by lew247
 
lew247
Guru
Guru
Avatar

Joined: 23 December 2015
Location: United Kingdom
Online Status: Offline
Posts: 790
Posted: 06 December 2017 at 5:20pm | IP Logged Quote lew247

Grogster updated my post, it threw the error overnight, I had the wrong message before
Back to Top View lew247's Profile Search for other posts by lew247
 
Grogster
Guru
Guru
Avatar

Joined: 31 December 2012
Location: New Zealand
Online Status: Offline
Posts: 5166
Posted: 06 December 2017 at 5:24pm | IP Logged Quote Grogster

Interesting.

I have my images as completely separate image files(BMP), and just use LOAD IMAGE.
I have a system that loads a logo from the SD card and puts it in a random position on the LCD over and over, and I never had read problems. But that's just the way I am doing mine.

__________________
Smoke makes things work. When the smoke gets out, it stops!
Back to Top View Grogster's Profile Search for other posts by Grogster Visit Grogster's Homepage
 


Page of 2 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.1250 seconds.
Privacy Policy     Process times : 0, 0, 0, 0.12