![]() |
Forum Index : Microcontroller and PC projects : Armmite F4: programming the firmware
![]() ![]() |
|||||
Author | Message | ||||
Chopperp![]() Guru ![]() Joined: 03/01/2018 Location: AustraliaPosts: 529 |
@ TassyJim Have you had a chance to look at this issue yet? My work around, when I remember, is to click "Set MM Time" which will bring back the prompt. I'm not game to update another F4 yet to see if that has the same problem. Brian ChopperP |
||||
TassyJim![]() Guru ![]() Joined: 07/08/2011 Location: AustraliaPosts: 3136 |
I haven't been able to replicate your problem. I assume that you are in VT mode in MMEdit which is very flaky. Jim It all started with the ZX81.... VK7JH http://www.c-com.com.au/MMedit.htm |
||||
Chopperp![]() Guru ![]() Joined: 03/01/2018 Location: AustraliaPosts: 529 |
OK I switched over to ASCII mode & that worked OK & much better in some respects, especially with scrolling. Never really tried it before. (I did introduce some problems with loading the program. I had been experimenting with the line delay. All good now). Thanks. Brian EDIT Just flashed another F4. Same symptoms in VT mode. Edited 2019-11-17 10:55 by Chopperp ChopperP |
||||
RonnS Regular Member ![]() Joined: 16/07/2015 Location: GermanyPosts: 96 |
Hello MatherP, what about access to the winbond chip? it should be spi3 .. so I found out as i tried to try the code of CaptainBoing however, this is not supported yet ???? thx Ron Edited 2019-11-28 08:52 by RonnS |
||||
TassyJim![]() Guru ![]() Joined: 07/08/2011 Location: AustraliaPosts: 3136 |
THis is the code I used: 'armite F4 Flash test OPTION BASE 1 DIM AS INTEGER F_CS = 35 DIM AS INTEGER x DIM AS INTEGER myArray(256) SETPIN F_CS, DOUT SPI OPEN 10000000,0,8 x = WB.ID%() PRINT "Device ID = ";HEX$(x) x = WB.JEDECID%() PRINT "JEDEC ID = ";HEX$(x) PRINT "Pagecount = ";WB.PAGECOUNT%() x = WB.SERIAL%() PRINT "Serial No = ";HEX$(x) x = WB.Write_Disable() PRINT "Status registers:" FOR n = 1 TO 3 x = WB.READSTATUS(n) PRINT STR$(n);" ";BIN$(x,8) NEXT n x = WB.READPAGE(1, myArray()) FOR n = 1 TO 100 PRINT myArray(n);" "; IF n MOD 10 = 0 THEN PRINT NEXT n z$ = WB.READSTRING$(2) IF LEN(z$)<>255 THEN PRINT z$ TIMER = 0 x = WB.Write_Enable() x = WB.ERASE() PAUSE 1000 PRINT BIN$(WB.READSTATUS(1),8) DO PAUSE 100 x = WB.READSTATUS(1)AND 1 LOOP UNTIL x = 0 PRINT "Erased in ";TIMER; "mS" PRINT BIN$(WB.READSTATUS(1),8) x = WB.Write_Enable() x = WB.WRITESTRING(2,"Freddy is here!!") DO PAUSE 100 x = WB.READSTATUS(1)AND 1 LOOP UNTIL x = 0 x = WB.Write_Enable() x = WB.WRITESTRING(2,"Barney is here!!", 20) DO PAUSE 100 x = WB.READSTATUS(1)AND 1 LOOP UNTIL x = 0 z$ = WB.READSTRING$(2) PRINT z$ PRINT WB.READSTRING$(2,20) x = WB.READPAGE(2, myArray()) FOR n = 1 TO 100 PRINT myArray(n);" "; IF n MOD 10 = 0 THEN PRINT NEXT n FOR n = 1 TO 100 myArray(n) = n NEXT n x = WB.Write_Enable() x = WB.WRITEPAGE(1, myArray()) PAUSE 1000 FOR n = 1 TO 100 myArray(n) = 0 NEXT n x = WB.READPAGE(1, myArray()) FOR n = 1 TO 100 PRINT myArray(n);" "; IF n MOD 10 = 0 THEN PRINT NEXT n 'x = WB.Write_Enable() 'x = WB.READSTATUS(2) 'x = WB.Write_Enable() 'x = x and &B11111101 'y = WB.WRITESTATUS(2, x) 'pause 1000 'for n = 1 to 3 'x = WB.READSTATUS(n) 'print str$(n);" ";bin$(x,8) 'next n ' SPI CLOSE FUNCTION WB.Write_Enable() 'SPI OPEN 1000000,0,8 PIN(F_CS)=0 SPI WRITE 1, &H06 PIN(F_CS)=1 ' SPI CLOSE END FUNCTION FUNCTION WB.Write_Volatile_Enable() ' SPI OPEN 1000000,0,8 PIN(F_CS)=0 SPI WRITE 1, &H50 PIN(F_CS)=1 ' SPI CLOSE END FUNCTION FUNCTION WB.Write_Disable() ' SPI OPEN 1000000,0,8 PIN(F_CS)=0 SPI WRITE 1, &H04 PIN(F_CS)=1 ' SPI CLOSE END FUNCTION FUNCTION WB.READSTATUS(reg) LOCAL adr SELECT CASE reg CASE 1 : adr = &H05 CASE 2 : adr = &H35 CASE 3 : adr = &H15 END SELECT 'SPI OPEN 1000000,0,8 PIN(F_CS)=0 SPI WRITE 1, adr WB.READSTATUS=SPI(0) PIN(F_CS)=1 ' SPI CLOSE END FUNCTION FUNCTION WB.WRITESTATUS(reg, myData) LOCAL adr SELECT CASE reg CASE 1 : adr = &H01 CASE 2 : adr = &H31 CASE 3 : adr = &H11 END SELECT ' SPI OPEN 1000000,0,8 PIN(F_CS)=0 SPI WRITE 2, adr, myData PIN(F_CS)=1 ' SPI CLOSE END FUNCTION FUNCTION WB.ID%() 'W25Q64FV &HEF16 'W25Q16JV &HEF14 LOCAL AS INTEGER mybyte(5) ' SPI OPEN 1000000,0,8 PIN(F_CS)=0 SPI WRITE 1, &H90 SPI READ 5, mybyte() PIN(F_CS)=1 'SPI CLOSE WB.ID%=mybyte(4)*256+mybyte(5) END FUNCTION FUNCTION WB.JEDECID%() 'W25Q64FV &HEF4017 'W25Q16JV &HEF4015 LOCAL AS INTEGER mybyte(3) ' SPI OPEN 1000000,0,8 PIN(F_CS)=0 SPI WRITE 1, &H9F SPI READ 3, mybyte() PIN(F_CS)=1 ' SPI CLOSE WB.JEDECID%=mybyte(1)*256*256+mybyte(2)*256+mybyte(3) END FUNCTION FUNCTION WB.PAGECOUNT%() 'W25Q64FV &HEF4017 'W25Q16JV &HEF4015 LOCAL AS INTEGER mybyte(3) ' SPI OPEN 1000000,0,8 PIN(F_CS)=0 SPI WRITE 1, &H9F SPI READ 3, mybyte() PIN(F_CS)=1 ' SPI CLOSE WB.PAGECOUNT%=1 << (mybyte(3)-8) END FUNCTION FUNCTION WB.SERIAL%() LOCAL AS INTEGER mybyte(8) LOCAL AS FLOAT n ' SPI OPEN 1000000,0,8 PIN(F_CS)=0 SPI WRITE 5, &H4B,0,0,0,0 SPI READ 8, mybyte() PIN(F_CS)=1 'SPI CLOSE WB.SERIAL%=mybyte(1) FOR n = 2 TO 8 WB.SERIAL%=WB.SERIAL%*256+mybyte(n) NEXT n END FUNCTION FUNCTION WB.READPAGE(adr, my%()) LOCAL adr1, adr2,adr3 adr = adr<<8 adr1 = (adr>>16) AND &HFF adr2 = (adr>>8) AND &HFF adr3 = adr AND &HFF ' SPI OPEN 1000000,0,8 PIN(F_CS)=0 SPI WRITE 4, &H03, adr1, adr2, adr3 SPI READ 256, my%() PIN(F_CS)=1 ' SPI CLOSE END FUNCTION FUNCTION WB.WRITEPAGE(adr, my%()) LOCAL adr1, adr2,adr3 adr = adr<<8 adr1 = (adr>>16) AND &HFF adr2 = (adr>>8) AND &HFF adr3 = adr AND &HFF ' SPI OPEN 1000000,0,8 PIN(F_CS)=0 SPI WRITE 4, &H02, adr1, adr2, adr3 SPI WRITE 256, my%() PIN(F_CS)=1 ' SPI CLOSE END FUNCTION FUNCTION WB.READSTRING$(adr, offset = 0) LOCAL adr1, adr2,adr3,strLen,my%(256),n adr = (adr<<8) + offset adr1 = (adr>>16) AND &HFF adr2 = (adr>>8) AND &HFF adr3 = adr AND &HFF ' SPI OPEN 1000000,0,8 PIN(F_CS)=0 SPI WRITE 4, &H03, adr1, adr2, adr3 strLen = SPI(0) SPI READ strLen, my%() PIN(F_CS)=1 IF strLen > 0 THEN FOR n = 1 TO strLen WB.READSTRING$ = WB.READSTRING$ + CHR$(my%(n)) NEXT n ENDIF ' SPI CLOSE END FUNCTION FUNCTION WB.WRITESTRING(adr, myStr$, offset = 0) LOCAL adr1, adr2,adr3,strLen ',my%(256),n adr = (adr<<8) + offset adr1 = (adr>>16) AND &HFF adr2 = (adr>>8) AND &HFF adr3 = adr AND &HFF strLen = LEN(myStr$) ' my%(1) = strLen ' for n = 1 to strLen ' my%(n+1) = asc(mid$(myStr$,n,1)) ' next n ' SPI OPEN 1000000,0,8 PIN(F_CS)=0 SPI WRITE 4, &H02, adr1, adr2, adr3 SPI WRITE 1, strLen SPI WRITE strLen, myStr$ 'spi write strLen+1, my%() PIN(F_CS)=1 ' SPI CLOSE END FUNCTION FUNCTION WB.ERASE() PIN(F_CS)=0 SPI WRITE 1, &HC7 PIN(F_CS)=1 ' SPI CLOSE END FUNCTION using SPI1 not SPI3 Jim It all started with the ZX81.... VK7JH http://www.c-com.com.au/MMedit.htm |
||||
RonnS Regular Member ![]() Joined: 16/07/2015 Location: GermanyPosts: 96 |
thanks Jim, your code works for me too |
||||
Chopperp![]() Guru ![]() Joined: 03/01/2018 Location: AustraliaPosts: 529 |
Thanks Jim, Also tried it & seemed to do stuff OK. First time I've looked at this sort of thing so will take a bit of time to work out what is going on. (Worked out some of it) I do have an immediate need to store & retrieve data so RonnS's query & your code were both very timely. Brian ChopperP |
||||
matherp Guru ![]() Joined: 11/12/2012 Location: United KingdomPosts: 2973 |
Minor configuration tweak to allow the ArmmiteF4 to run ceptimus' chess program. Now who is going to do a graphical user I/F for it ![]() ArmmiteF4.zip |
||||
![]() ![]() |
![]() |