Home
JAQForum Ver 20.06
Log In or Join  
Active Topics
Local Time 02:03 26 Apr 2024 Privacy Policy
Jump to

Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.

Forum Index : Microcontroller and PC projects : Armmite F4: programming the firmware

     Page 13 of 16    
Author Message
Chopperp

Guru

Joined: 03/01/2018
Location: Australia
Posts: 1032
Posted: 07:47am 16 Nov 2019
Copy link to clipboard 
Print this post

@ 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: Australia
Posts: 5900
Posted: 07:37pm 16 Nov 2019
Copy link to clipboard 
Print this post

I haven't been able to replicate your problem.
I assume that you are in VT mode in MMEdit which is very flaky.

Jim
VK7JH
MMedit   MMBasic Help
 
Chopperp

Guru

Joined: 03/01/2018
Location: Australia
Posts: 1032
Posted: 10:44pm 16 Nov 2019
Copy link to clipboard 
Print this post

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
Senior Member

Joined: 16/07/2015
Location: Germany
Posts: 120
Posted: 10:45pm 27 Nov 2019
Copy link to clipboard 
Print this post

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: Australia
Posts: 5900
Posted: 07:15am 28 Nov 2019
Copy link to clipboard 
Print this post

  RonnS said  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

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)
 
 PRINT
 x = WB.Write_Disable()
 PRINT "Status registers:"
 FOR n = 1 TO 3
   x = WB.READSTATUS(n)
   PRINT STR$(n);"  ";BIN$(x,8)
 NEXT n
 PRINT
 
 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
 'print
 '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
VK7JH
MMedit   MMBasic Help
 
RonnS
Senior Member

Joined: 16/07/2015
Location: Germany
Posts: 120
Posted: 09:25am 28 Nov 2019
Copy link to clipboard 
Print this post

thanks Jim, your code works for me too
 
Chopperp

Guru

Joined: 03/01/2018
Location: Australia
Posts: 1032
Posted: 01:22pm 28 Nov 2019
Copy link to clipboard 
Print this post

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 Kingdom
Posts: 8578
Posted: 09:24am 29 Nov 2019
Copy link to clipboard 
Print this post

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
 
goc30

Guru

Joined: 12/04/2017
Location: France
Posts: 425
Posted: 04:59am 17 Dec 2019
Copy link to clipboard 
Print this post

for info

excel file with all pins and TFT connector to LCD 3.2p ili9341


F407VE_PINS.zip
Edited 2019-12-17 15:15 by goc30
 
ceptimus
Senior Member

Joined: 05/07/2019
Location: United Kingdom
Posts: 130
Posted: 07:15pm 17 Dec 2019
Copy link to clipboard 
Print this post

I've got some PCBs I designed that adapt/mount the STM board to the 34-pin display.  I've got about 8 of the PCBs left and I can 3D-print some of the joiner plates (blue in the photos) if anyone wants one of those too.  I've also got three spare ILI9341 16-bit 240x320 3.2-inch displays (with touch interface) to suit, so I could supply three kits of PCB/joiner plate/display.  I suppose I could throw in the PCB female headers too.

You solder the PCB direct to the STM board pins.  The PCB has female headers soldered to it - and the display then plugs into those headers and can be easily removed.  The spacer plate (3D printed part) is the correct depth to suit the plugged-together assembly, so the whole thing becomes a compact, rigid stable block - no floppy display that will move or crack when the touch panel is being used.

The display fixes to the joiner plate with some small self-tappers, and then you can put bolts though the mounting holes either to provide 'legs and feet' as I've done, or to panel mount the whole thing.  I used plastic bolts and nuts - I think they're M2.5 size.

These displays have a full-size SD card slot on their back side so I've routed the SD-card select pin to the header pin hole labelled SDCS in case anyone wants to use it.  I've not bothered - I use the micro SD card slot on the STM board itself.

Let me know if you're interested. PCB £1 each, 3D-printed mount/joiner £2 each, displays £15 each.  Plus shipping which will depend where you are in the world - I'm in the UK.








Edited 2019-12-18 05:30 by ceptimus
 
Volhout
Guru

Joined: 05/03/2018
Location: Netherlands
Posts: 3519
Posted: 09:20am 12 Mar 2020
Copy link to clipboard 
Print this post

After much hesitance, I decided to re-order an F4 board. Received it yesterday, and am up and running now. This board is OK, has the latest ArmiteF4. Thanks Matherp.

Now let's see what it can do....

Volhout
PicomiteVGA PETSCII ROBOTS
 
Volhout
Guru

Joined: 05/03/2018
Location: Netherlands
Posts: 3519
Posted: 12:06pm 01 May 2020
Copy link to clipboard 
Print this post

Dear Matherp,

The F4 works great, but I noticed something weird that you might be able to shed some light on.

When I use the USB port to use the build in edit command, all works fine.
When I load a larger program (5k or so) from SD card (something written on it by the PC) all works fine.

But when I use the autosave function to copy and paste a larger program into the F4 I end up with a corrupted program.

I noticed the F4 uses really high speed on the USB (serial?) port, and this speed is not affected by the baudrate setting. Changing the serial port to use RTS/CTS hardware handshaking also does not improve.

It is as if the serial input buffer is overflowing by the immense speed that is possible on this USB (serial) port.

Did you ever see this ?

Is there any work around ?

Regards,

Volhout

I used the "game of life" program in the conway thread.
PicomiteVGA PETSCII ROBOTS
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 8578
Posted: 06:24pm 01 May 2020
Copy link to clipboard 
Print this post

  Quote  It is as if the serial input buffer is overflowing by the immense speed that is possible on this USB (serial) port.


Sounds like it. The workround is to use Xmodem, direct or with MMEDit. I'll try and have a look in the next few days
 
TassyJim

Guru

Joined: 07/08/2011
Location: Australia
Posts: 5900
Posted: 09:43pm 01 May 2020
Copy link to clipboard 
Print this post

IF you are using TeraTerm, try a 100mS line delay
That slows things down enough for the mite to keep up.

Jim
VK7JH
MMedit   MMBasic Help
 
CaptainBoing

Guru

Joined: 07/09/2016
Location: United Kingdom
Posts: 1985
Posted: 08:19am 02 May 2020
Copy link to clipboard 
Print this post

yes I experienced this early on. I think Jim's line delay thing may well be a solution for you.

There was a lot of talk about it here with all sorts of oddness with the USB interface, mystery disconnects, failures to reconnect (forcing PC restarts), only connecting alternate attempts after resetting the F4 - I think the blisteringly fast H7 (god I love that board!!!) is similarly affected.

I must say I never found a proper solution with the onboard USB and gave up in the end as it was taking too much time from other tasks (like actually getting to use the thing). I ended up cutting some trace-jumpers if memory serves and going directly onto the console pins with my normal, bombproof, setup of a CH340. I go this way for *all* my mites
 
Volhout
Guru

Joined: 05/03/2018
Location: Netherlands
Posts: 3519
Posted: 02:56pm 02 May 2020
Copy link to clipboard 
Print this post

Dear matherp,

Looked into the corruption of a program pasted in terminal in autosave mode.
I use linux. Below the terminal programs I tried:

Putty: does not have an option to add an end-of-line delay

GTKterm: this program has the option to set an end of line delay, but whatever you program in the field, it does not slow down the transfer. Maybe this is due to the fact that the F4 is not an actual UART. Corruptions remain.

GFXterm: (by robert.rosee) slows down the communication to such a degree that there are no corruptions left (*). The only problems I saw where lines that where longer than 80 characters, these continue on the next line, and may cause errors when executing. Annoying, but understandable. In my test I used the 32 bit version (by JohnS) of GFXterm64.

Volhout

(*) I have no idea if you can switch the delays off. They seem "always ON".
Edited 2020-05-03 00:59 by Volhout
PicomiteVGA PETSCII ROBOTS
 
robert.rozee
Guru

Joined: 31/12/2012
Location: New Zealand
Posts: 2286
Posted: 01:38am 03 May 2020
Copy link to clipboard 
Print this post

hi Volhout,
   GFXterm monitors the responses from the micromite while pasting. there are two paste modes (FAST and SLOW), with any paste operation starting off in SLOW mode, then switching to FAST mode if no VT escape sequences have been seen for 1000ms.

the SLOW mode is to allow pasting into the micromite's inbuilt editor. after each carriage return is sent, it waits for 300ms of silence from the micromite before sending the next line.

in FAST mode, after each carriage-return (chr$(13)) is sent, GFXterm waits for the micromite to respond with a line-feed (chr$(10)) character. there is also a 180ms timeout on this wait, and lines are sent at no faster than every 15ms.

FAST mode is for pasting using AUTOSAVE, and should be able to load up a 50k BASIC program in around 40 seconds.


so there are no major delays as such, but rather the pace of any paste operation is dictated largely by the rate at which the micromite 'digests' the lines being pasted.


cheers,
rob   :-)


addendum: although you will see long lines appear to be split when using AUTOSAVE, they are not split when saved to flash within the micromite. you can check this using the inbuilt editor, which will complain when you move onto the long line and try changing it.
Edited 2020-05-03 11:43 by robert.rozee
 
CaptainBoing

Guru

Joined: 07/09/2016
Location: United Kingdom
Posts: 1985
Posted: 09:27am 03 May 2020
Copy link to clipboard 
Print this post

  robert.rozee said  
addendum: although you will see long lines appear to be split when using AUTOSAVE, they are not split when saved to flash within the micromite. you can check this using the inbuilt editor, which will complain when you move onto the long line and try changing it.


Yes I see that all the time... worried me when I first saw it (and still catches me occasionally today) but as you say, all OK
 
cdeagle
Senior Member

Joined: 22/06/2014
Location: United States
Posts: 261
Posted: 10:09pm 26 May 2020
Copy link to clipboard 
Print this post

Can someone point me to the Armmite F4 manual?

Thanks
 
Chopperp

Guru

Joined: 03/01/2018
Location: Australia
Posts: 1032
Posted: 10:32pm 26 May 2020
Copy link to clipboard 
Print this post

Hi,
You have to refer to the H7 manual (along with all the other various MM manuals).
Also alot of info in the F4 threads.
There was no specific manual produced.

Also LIST COMMANDS &  LIST FUNCTIONS gives the commands & functions available. (I think that's the correct syntax) (Edit Corrected)

Brian
Edited 2020-05-27 08:43 by Chopperp
ChopperP
 
     Page 13 of 16    
Print this page
© JAQ Software 2024