![]() |
Forum Index : Microcontroller and PC projects : Picomite(VGA) V5.07.06 betas - flash drive support
Page 1 of 3 ![]() ![]() |
|||||
Author | Message | ||||
matherp Guru ![]() Joined: 11/12/2012 Location: United KingdomPosts: 10067 |
Version 5.07.06b5 https://geoffg.net/Downloads/picomite/PicoMite_Beta.zip Support for a full file system on the Pico's flash which will always be available. All SD file commands are supported. Flash drive is "A:" An SDcard if configured is drive "B:" By default the system restarts with the active drive as drive "A:" even if the SDcard is configured Use the command: "DRIVE drive$" to change drive, drive$ can be "A:" or "B:" In general file commands can specify the disk irrespective of the active disk e.g "OPEN "B:/mydir/myfile.dat" or "PLAY WAV "A:mywav.wav" exceptions are MKDIR, CHDIR, RMDIR and RENAME which operate on the active disk On first installation the firmware will automatically create the flash drive. The firmware reads the size of the flash and uses this to determine the drive size. Flash chips > 2Mb are fully supported The disk size will be 806916bytes == 788Kb with the PicoMiteVGA firmware on a standard Raspberry Pi Pico and 692Kb with the PicoMite firmware. Use DRIVE "A:/FORMAT" to re-initialise it if required Use mm.info(drive) to get the current active drive - returns A: or B: Use mm.info(free space) to see how much space is left on the active drive Use mm.info(disk size) to see the size of the active drive New functions MATH(CRC8 array(), length, [polynome,] [startmask,] [endmask,] [reverseIn,] [reverseOut] MATH(CRC12 array(), length, [polynome,] [startmask,] [endmask,] [reverseIn,] [reverseOut] MATH(CRC16 array(), length, [polynome,] [startmask,] [endmask,] [reverseIn,] [reverseOut] MATH(CRC32 array(), length, [polynome,] [startmask,] [endmask,] [reverseIn,] [reverseOut] defaults for startmask, endmask reverseIn, and reversOut are all zero defaults for polynomes are CRC8=&H07, CRC12=&H80D, CRC16=&H1021, crc32=&H04C11DB7 e.g. for crc16_CCITT use MATH(CRC16 array(), n,, &HFFFF) so: DIM a%(8)=(49,50,51,52,53,54,55,56,57) PRINT HEX$(MATH(CRC16 a%(),9,,&HFFFF)) gives &H29B1 Changed commands: SPI command now takes the channel e.g. "SPI 1 OPEN 1000000,3" or "SPI 2 OPEN 50000,0" the SPI2 command is deprecated The firmware will automatically convert old style commands to the new format which will show when the program is listed and saved The maximum program size for the PicoMite is now 116Kb (down from 120kB) The maximum program size for the PicoMiteVGA remains 100Kb The number of flash slots in both versions is now 5 Installing this version will clear all current options and flash slots. Clearing all the flash before installation is recommended |
||||
Volhout Guru ![]() Joined: 05/03/2018 Location: NetherlandsPosts: 4854 |
Thanks Peter, I will try tonight !! Volhout EDIT: 300ms for pico at 126MHz. This is GREAT !!!! Edited 2022-12-21 02:05 by Volhout PicomiteVGA PETSCII ROBOTS |
||||
matherp Guru ![]() Joined: 11/12/2012 Location: United KingdomPosts: 10067 |
Next beta will also allow strings and not just numerical arrays as input to the CRC calcs |
||||
Volhout Guru ![]() Joined: 05/03/2018 Location: NetherlandsPosts: 4854 |
Sorry... 300us of coarse !!! PicomiteVGA PETSCII ROBOTS |
||||
matherp Guru ![]() Joined: 11/12/2012 Location: United KingdomPosts: 10067 |
@126MHz ![]() Edited 2022-12-21 02:10 by matherp |
||||
Tinine Guru ![]() Joined: 30/03/2016 Location: United KingdomPosts: 1646 |
This is insane....matherp must be an AI construct of some sort ![]() ![]() Craig |
||||
JohnS Guru ![]() Joined: 18/11/2011 Location: United KingdomPosts: 3998 |
Nah, they're not that good! John |
||||
Volhout Guru ![]() Joined: 05/03/2018 Location: NetherlandsPosts: 4854 |
Looks like the algorithm is solid. All tested outputs so far match exactly. 'MATH CRC evaluation option base 1 'determine timer set/read time timer=0 tr=timer ? tr*1000;" us" 'test string a$="123456789" l%=len(a$) 'convert test string to array (needed in V50706b5) dim b%(l%) for i=1 to l% : b%(i)=asc(mid$(a$,i,1)) : next i 'perform CRC validation dim CRC% 'check CCITT CRC16 timer=0 CRC% = math (crc16 b%(),l%,,&hffff) t=timer ? "CRC16-CCITT ";(t-tr)*1000;" us, CRC = &h"; hex$(CRC%) 'check MODBUS CRC16 timer=0 CRC% = math (crc16 b%(),l%,&h8005,&hffff,0,1,1) t=timer ? "CRC16-MODBUS ";(t-tr)*1000;" us, CRC = &h"; hex$(CRC%) 'check XMODEM CRC16 timer=0 CRC% = math (crc16 b%(),l%) t=timer ? "CRC16-XMODEM ";(t-tr)*1000;" us, CRC = &h"; hex$(CRC%) 'check MAXIM CRC8 (used in DALLAS signle wire devices) timer=0 CRC% = math (crc8 b%(),l%,&h31,,,1,1) t=timer ? "CRC8-MAXIM ";(t-tr)*1000;" us, CRC = &h"; hex$(CRC%) 'check standard CRC32 timer=0 CRC% = math (crc32 b%(),l%,,&hffffffff,&hffffffff,1,1) t=timer ? "CRC32 ";(t-tr)*1000;" us, CRC = &h"; hex$(CRC%) And it really fast.... RUN 48 us CRC16-CCITT 199 us, CRC = &h29B1 CRC16-MODBUS 208 us, CRC = &h4B37 CRC16-XMODEM 137 us, CRC = &h31C3 CRC8-MAXIM 224 us, CRC = &hA1 CRC32 259 us, CRC = &hCBF43926 Edited 2022-12-21 04:44 by Volhout PicomiteVGA PETSCII ROBOTS |
||||
Tinine Guru ![]() Joined: 30/03/2016 Location: United KingdomPosts: 1646 |
![]() ![]() |
||||
Tinine Guru ![]() Joined: 30/03/2016 Location: United KingdomPosts: 1646 |
These developments are all very well but they inspire (really good) feature creep for my machine controller. ![]() No turkey for this guy (again). More like a chicken butty while I type. ![]() |
||||
Turbo46![]() Guru ![]() Joined: 24/12/2017 Location: AustraliaPosts: 1636 |
Thank you for your work on the CRCs Peter and thank you Voulhout for raising it again. It's great to see the CRC getting some TLC at last. ![]() Now is it possible for it to migrate to other 'mites when the dust settles? ![]() A CSUB or CFUNCTION for the good old MX170 where the speed gain would be most appreciated? ![]() ![]() Bill Keep safe. Live long and prosper. |
||||
Volhout Guru ![]() Joined: 05/03/2018 Location: NetherlandsPosts: 4854 |
Hi Peter, I found a flaw in the 50706b5 (but probably also in earlier). SETPIN gp8,FIN When you run this code WHILE a input signal is present the pico locks up (USB stops communicating). At 100kHz and higher the pico locks up Below 10kHz the pico works This is on the normal pico, not VGA (VGA uses gp8 for keyboard). Maybe a small delay in in the init will solve this ? I assume the pin interrupt is enabled, before the interrupt handler is active. Maybe due to installing the handler in RAM. Regards, Volhout Edited 2022-12-21 23:57 by Volhout PicomiteVGA PETSCII ROBOTS |
||||
matherp Guru ![]() Joined: 11/12/2012 Location: United KingdomPosts: 10067 |
Version 5.07.06b6 https://geoffg.net/Downloads/picomite/PicoMite_Beta.zip Fixes bug in setpin fin,per,cin when fast signal is established before the setpin Changes the priority of the CIN,FIN,PER interrupt to improve accuracy - tests accurate at 500KHz with CPU speed of 378MHz and 200KHz at default CPU speed MATH(CRCn function now accepts a string as the input e.g. a$="123456789" ? math(crc16 a$,9,,&H1021) Edited 2022-12-22 00:47 by matherp |
||||
Volhout Guru ![]() Joined: 05/03/2018 Location: NetherlandsPosts: 4854 |
Hi Peter, - Counter FIN/CIN improved dramatically ! Thanks - Strings in MATH CRC: works great (and again faster), Thanks !! Volhout PicomiteVGA PETSCII ROBOTS |
||||
phil99![]() Guru ![]() Joined: 11/02/2018 Location: AustraliaPosts: 2417 |
If FIN is working I must be doing something wrong. Measured 333 Hz on gp14 and gp6. > option list PicoMiteVGA MMBasic Version 5.07.06b6 OPTION SYSTEM I2C GP4,GP5 OPTION COLOURCODE ON OPTION KEYBOARD US OPTION SDCARD GP13, GP10, GP11, GP12 OPTION RTC AUTO ENABLE OPTION COUNT GP6,GP7,GP14,GP15 >setpin gp0, pwm > setpin gp14,fin > pwm 0,333,50 > do :pause 1000 :? pin(gp14):loop 0 0 0 0 0 0 0 0 > setpin gp6,fin > do :pause 1000 :? pin(gp6):loop 0 0 0 0 0 0 |
||||
matherp Guru ![]() Joined: 11/12/2012 Location: United KingdomPosts: 10067 |
Are you connecting the correct pins? ![]() Edited 2022-12-22 17:59 by matherp |
||||
Volhout Guru ![]() Joined: 05/03/2018 Location: NetherlandsPosts: 4854 |
@Peter, On the standard picomite it works. I can cionfirm. Phil is running the VGA version, not using the default configuration Default: gp6,gp7=audio, gp14,gp15=I2C Phils board: gp6,gp7,gp14,gp15 = COUNT Maybe there is something not going well becuase this different pin assignment. I have used Phils OPTION LIST (no RTC AUTO, since I have no RTC) on a bare picomite prograqmmed with the VGA firmware, and see the same. Regards, Volhout Edited 2022-12-22 19:13 by Volhout PicomiteVGA PETSCII ROBOTS |
||||
matherp Guru ![]() Joined: 11/12/2012 Location: United KingdomPosts: 10067 |
OK found the cause. It happened between 5.07.05RC6 and RC7 and is to do with a change I made to the keyboard handling. The problem only arises when OPTION KEYBOARD is set (default on the VGA version) hence seeing it on the VGA version. Can replicate on the ordinary version by setting OPTION KEYBOARD UK Now just need to fix ![]() UPDATE: I've replaced the firmware in the latest download, please re-download and test Edited 2022-12-22 20:45 by matherp |
||||
phil99![]() Guru ![]() Joined: 11/02/2018 Location: AustraliaPosts: 2417 |
Thank you for the updated version. Perfect. |
||||
Mixtel90![]() Guru ![]() Joined: 05/10/2019 Location: United KingdomPosts: 7505 |
Crikey, Peter, you're on a roll at the moment aren't you? :) Nice work! Mick Zilog Inside! nascom.info for Nascom & Gemini Preliminary MMBasic docs & my PCB designs |
||||
Page 1 of 3 ![]() ![]() |
![]() |
![]() |
The Back Shed's forum code is written, and hosted, in Australia. | © JAQ Software 2025 |