It's a limit of the math operations. Do you think we should make it work with lower bauds?
What is the smart pin Baud Limit ?
What is the code cost, of extending toward that ?
I just have a natural aversion to limits that are 'self imposed' ie not set by hardware
I'm known to complain to vendors who limit their Clock or Baud choices, for example, to less than what they could have.
That said, I've not used low baud rates to move large blocks of data, but I have used low baud rates to test system margins, and for easy clock measurements/calibration.
Looking at recent UARTS/HW I've used, one was limited to 184 Baud, and another to 50 Baud, and another could go to 8 Baud. Those are all HW limits, not maths imposed limits.
For a possible growing low baud arena, look at the new LoRa network standard. That trades off speed. to get power and distance gains.
I can think of one immediate/useful P2 use of low baud, which would be to connect at a low baud rate, and query the Baud capture timer, to measure the RC Oscillator Frequency, using the UART timebase.
It's a limit of the math operations. Do you think we should make it work with lower bauds?
I can think of one immediate/useful P2 use of low baud, which would be to connect at a low baud rate, and query the Baud capture timer, to measure the RC Oscillator Frequency, using the UART timebase.
One application where this gets interesting, is extreme environment operation, where you want minimal external analog and prefer to avoid flash.
(eg down drill holes / bores ). In this area, you would have no crystal, & no local flash, but instead (re)measure the RC osc, and use that live value in downloaded code, tracking any variations.
Expanding on that use example, at the RCFAST speeds, I get numbers like this for 16b resolution capture of Osc Speed, for the raw baud 7b capture value
7*20M/2^16 = 2136 Baud
7*30M/2^16 = 3204 Baud
I'm thinking it would be useful to store the raw 7b baud value (as that has highest precision) in some HUB location, so user code could access that. Such-calibrate-values-in-memory-map, are quite common in other MCUs, even very cheap ones.
and these, if that 7b value is not so easily available, so users have to use the baud-bit-time.
20M/2^16 = 306 Baud
30M/2^16 = 458 Baud
If users can autobaud at speeds in that region, they can then (easily?) interrogate for the raw Baud capture value, and extract a calibrate number.
It would be nice if the Serial loader could echo the calibrate baud value, but I think the Full ROM anyway allows some pathway to read any location ?
Q : What is the simplest Serial string to : Autobaud the part, then read the calibrate baud value ?
Applying the patch and using the R command still hangs when the filename is spelled correctly. If it's misspell the monitor responds with "!", as expected.
Peter, I loaded your TAQOZ extensions (very cool!) and the output looks like there may be a card issue of some sort:
TAQOZ# lsio
P:00000000001111111111222222222233333333334444444444555555555566
P:01234567890123456789012345678901234567890123456789012345678901
=:ddd~~~~d~~~~~~~~~~~d~~~~d~~~~~d~~~~~~~~~~~~~~~~~~~~~~~~hhhhhhh ok
TAQOZ# MOUNT
Mounted 6B43_C07C-0000_0000 [PHSD01G] 0MB (0kB/cluster) ok
TAQOZ#
I've only got the one microSD available for testing, so I'll pick up a couple of different brand to try.
Garry,
Since the SD is checking for a file and if it's not found the program returns with "!" then I suspect when the file is found that the file is corrupt or has a bug.
Have you tried replacing the file?
It may be worthwhile deleting the file first and then copying the new file as W10 seems to be more interested in the long filenames and I think that sometimes the 8.3 directory doesn't get updated correctly.
The files I posted above flash pins (leds) on specific pins. I know they work.
As I mentioned in another post, if you want to find out what is happening in hardware, such as "why doesn't my SD card work", then jump to TAQOZ and paste in this file using line delays of ~20ms. This will give you full FAT32 access as well as low-level access so there is no need to guess, TAQOZ is the TOOL, that's why it is in ROM so it is there when you need it and nothing else seems to work.
After loading TAQOZ.FTH you can MOUNT the SD card and some information about the card type and format is printed. Then ls (or DIR) will list the directory. All good so far, now open a file with FOPEN _BOOT_P2.BIX and you can handle that file like any other memory use FS style words such as FS@ or FSC!. In this case we dump the start of the file as longs and make sure DUMP knows to use FS (file-system) memory. You could also dump SD memory, that is the first 4GB of a raw card.
Garry,
Since the SD is checking for a file and if it's not found the program returns with "!" then I suspect when the file is found that the file is corrupt or has a bug.
Have you tried replacing the file?
It may be worthwhile deleting the file first and then copying the new file as W10 seems to be more interested in the long filenames and I think that sometimes the 8.3 directory doesn't get updated correctly.
The files I posted above flash pins (leds) on specific pins. I know they work.
Yes, I copied the red/blu/grn to the SD and all failed to load in the same manner I described. I just picked up a couple of microSD cards to add to the test pool.
As I mentioned in another post, if you want to find out what is happening in hardware, such as "why doesn't my SD card work", then jump to TAQOZ and paste in this file using line delays of ~20ms.
Sorry I didn't specify, Peter, but I had successfully copied/pasted loaded your TAQOZ.FTH prior to generating the above output. Now that I've got more than one card I might be able to get a better idea of what's going on.
Thanks to you both for the help you've provided so far.
@garryj - it looks as if you are trying to use an old 1GB non-SDHC card and I would recommend not bothering otherwise we would have to cater for paper-tape readers as well (just to keep Heater happy).
@garryj - it looks as if you are trying to use an old 1GB non-SDHC card and I would recommend not bothering otherwise we would have to cater for paper-tape readers as well (just to keep Heater happy).
Yep, I'm guilty of trying to get a little more use out of an antique With the new microSD card, the monitor "R" command is working fine and getting sensible dir output with TOQAZ.FTH. The only thing that's not working yet is startup boot using the _BOOT_P2.BIX/BIY files. I probed the CS line of the SDCard and the pull-up is there, but I have to hang it up for the night. But it's good knowing that it's 99% there
My code used to handle original SD cards correctly. Since we are passing the boot and dir phase, and it's just the actual final sector reading and executing that is failing, I am fairly sure it's not an initialisation problem.
@garryj - it looks as if you are trying to use an old 1GB non-SDHC card and I would recommend not bothering otherwise we would have to cater for paper-tape readers as well (just to keep Heater happy).
Yep, I'm guilty of trying to get a little more use out of an antique With the new microSD card, the monitor "R" command is working fine and getting sensible dir output with TOQAZ.FTH. The only thing that's not working yet is startup boot using the _BOOT_P2.BIX/BIY files. I probed the CS line of the SDCard and the pull-up is there, but I have to hang it up for the night. But it's good knowing that it's 99% there
I just spoke to tubular and they had a problem booting from an SD card. They found it had 8K clusters rather than the 32K clusters. It reported MSDOS5.0 and was FAT32.
The cluster size could perhaps be a problem. I don't verify the cluster size so perhaps my file start position is incorrect.
:cool:
Got SD running on my P123-A9 today.
Now Botting a 330K image in 6 seconds!
Using SD boot changes the "personality" of P2 big time.
Nice work Cluso.
In looking at the 4800 baud problem (it doesn't auto-baud that low), I see the problem.
Within autobaud_isr, the max measurement allowed is $58E4 ('limit'). This gets multiplied by $1_0000/7 = $2492 ('baud0'). The product is $0CB2C208. The top 16 bits become the bit period in system clocks: ...
Is that a limit in the Smart Hardware (eg 16b Divider ?), or just a limit in the maths of a fitting the scale into a 32b result ?
It's a limit of the math operations. Do you think we should make it work with lower bauds?
Who has tested the SD Boot and the Monitor Run commands?
If so, what board(s) do you have?
Should the booter and monitor be able to run on the BeMicro CV A2 (there appears to be a 32b .jic for that board, available)? That board, unlike the DE0-Nano has 128k of RAM...
I just spoke to tubular and they had a problem booting from an SD card. They found it had 8K clusters rather than the 32K clusters. It reported MSDOS5.0 and was FAT32.
The cluster size could perhaps be a problem. I don't verify the cluster size so perhaps my file start position is incorrect.
Can you check the cluster size please Garry?
Cluster size is 32KB. Regarding SD, the only thing that isn't working for me now is the auto load/run at startup. I've got a Prop123-A9 and I've been using Chip's "all_cogs_blink.spin2" program as the test file. After the program fails to run at boot I can bring up the monitor and execute R_BOOT_P2.BIX the file is loaded and run. So it looks like it may be a card detection issue of some sort. I'm using the Parallax #32312 microSD breakout board, which is an older part#. Unfortunately, my play time today is short, so I'll have to dig into it later.
Garry, since you can run the .bix file, it's really likely the extra pullups on the breakout board that are putting the P2 into a different boot mode
I've found we have to remove all the pullups and pulldowns and just rely on the CS pullup in the card itself.
Doh! And yet another senior moment :sick:
All is good now on the sd card boot/load front. Thanks to all for the help to get this geezer over the finish line.
I wonder whether all these timeouts need to be exactly 60 seconds, or whether we could spread them apart eg 40/50/60/70 seconds, to indicate what path we've gone down. For a while there the 'cog run' led was our only clue as to what was going on
Who has tested the SD Boot and the Monitor Run commands?
If so, what board(s) do you have?
I had SD boot working and also have been using the R command from the monitor.
I also saved files on the SD with no extensions i.e 'DEMO' and used 'RDEMO' to run Ok.
I also tried different cluster sizes 8,16,32 and 64k and found only 32k works.
Who has tested the SD Boot and the Monitor Run commands?
If so, what board(s) do you have?
I had SD boot working and also have been using the R command from the monitor.
I also saved files on the SD with no extensions i.e 'DEMO' and used 'RDEMO' to run Ok.
I also tried different cluster sizes 8,16,32 and 64k and found only 32k works.
I have a fix for the cluster bug. I had hard-coded the cluster size
There is a filename problem if the decimal in the first 4 bytes.
I have a fix for the cluster bug. I had hard-coded the cluster size
There is a filename problem if the decimal in the first 4 bytes.
These small cluster sizes normally only happen when a card is reformatted in an incorrect format and technically shoudn't be as they are optimized to operate with their default format. The SD card association has SD card formatter software that anyone can use so why do you have to cater for what I would essentially regard as "faulty" cards? All cards from 4GB to 32GB have 4.2MB free before the FAT32 partition and the cluster size is 32kB. This is the normal specification for SD cards, what is wrong with specifying that after all?
Any cards I find that are incorrectly formatted I will reformat with a Panasonic SD Card Formatter but MS and Mac formatters are readily available from sdcard.org
Actually now that I'm thinking about it, I could build in a compact SD card formatter in TAQOZ itself.
You should put that one in there. Seriously Peter.
Doing that will provide a "we know they have the tool" fix for a bunch of future problems. No brainer.
I am dealing with SD cards right now, and improper formatting leads to very rapid failure and or numerous little problems.
Yes, I have the low level tools and virtual memory for SD already built in so I am checking formats of cards and I will devise a suitable method. The formatter will check the card itself first and if it is suitable will proceed to format it firstly with 4.2MB free then FAT32 with 32k clusters. Hopefully I can fit it all in.
Comments
What is the smart pin Baud Limit ?
What is the code cost, of extending toward that ?
I just have a natural aversion to limits that are 'self imposed' ie not set by hardware
I'm known to complain to vendors who limit their Clock or Baud choices, for example, to less than what they could have.
That said, I've not used low baud rates to move large blocks of data, but I have used low baud rates to test system margins, and for easy clock measurements/calibration.
Looking at recent UARTS/HW I've used, one was limited to 184 Baud, and another to 50 Baud, and another could go to 8 Baud. Those are all HW limits, not maths imposed limits.
For a possible growing low baud arena, look at the new LoRa network standard. That trades off speed. to get power and distance gains.
I can think of one immediate/useful P2 use of low baud, which would be to connect at a low baud rate, and query the Baud capture timer, to measure the RC Oscillator Frequency, using the UART timebase.
Surely that's an integral feature of TAQOZ?
One application where this gets interesting, is extreme environment operation, where you want minimal external analog and prefer to avoid flash.
(eg down drill holes / bores ). In this area, you would have no crystal, & no local flash, but instead (re)measure the RC osc, and use that live value in downloaded code, tracking any variations.
Expanding on that use example, at the RCFAST speeds, I get numbers like this for 16b resolution capture of Osc Speed, for the raw baud 7b capture value
7*20M/2^16 = 2136 Baud
7*30M/2^16 = 3204 Baud
I'm thinking it would be useful to store the raw 7b baud value (as that has highest precision) in some HUB location, so user code could access that.
Such-calibrate-values-in-memory-map, are quite common in other MCUs, even very cheap ones.
and these, if that 7b value is not so easily available, so users have to use the baud-bit-time.
20M/2^16 = 306 Baud
30M/2^16 = 458 Baud
If users can autobaud at speeds in that region, they can then (easily?) interrogate for the raw Baud capture value, and extract a calibrate number.
It would be nice if the Serial loader could echo the calibrate baud value, but I think the Full ROM anyway allows some pathway to read any location ?
Q : What is the simplest Serial string to : Autobaud the part, then read the calibrate baud value ?
Peter, I loaded your TAQOZ extensions (very cool!) and the output looks like there may be a card issue of some sort: I've only got the one microSD available for testing, so I'll pick up a couple of different brand to try.
Since the SD is checking for a file and if it's not found the program returns with "!" then I suspect when the file is found that the file is corrupt or has a bug.
Have you tried replacing the file?
It may be worthwhile deleting the file first and then copying the new file as W10 seems to be more interested in the long filenames and I think that sometimes the 8.3 directory doesn't get updated correctly.
The files I posted above flash pins (leds) on specific pins. I know they work.
After loading TAQOZ.FTH you can MOUNT the SD card and some information about the card type and format is printed. Then ls (or DIR) will list the directory. All good so far, now open a file with FOPEN _BOOT_P2.BIX and you can handle that file like any other memory use FS style words such as FS@ or FSC!. In this case we dump the start of the file as longs and make sure DUMP knows to use FS (file-system) memory. You could also dump SD memory, that is the first 4GB of a raw card.
Thanks to you both for the help you've provided so far.
1. It is available on Peter's dropbox
2. Attached here
Just checked it against p2asm, all good as it doesn't matter if this part gets clobbered by anything that needs that area.
I just spoke to tubular and they had a problem booting from an SD card. They found it had 8K clusters rather than the 32K clusters. It reported MSDOS5.0 and was FAT32.
The cluster size could perhaps be a problem. I don't verify the cluster size so perhaps my file start position is incorrect.
Can you check the cluster size please Garry?
Got SD running on my P123-A9 today.
Now Botting a 330K image in 6 seconds!
Using SD boot changes the "personality" of P2 big time.
Nice work Cluso.
LOL, nope, just use software bit banging.
If so, what board(s) do you have?
Should the booter and monitor be able to run on the BeMicro CV A2 (there appears to be a 32b .jic for that board, available)? That board, unlike the DE0-Nano has 128k of RAM...
dgately
I've found we have to remove all the pullups and pulldowns and just rely on the CS pullup in the card itself.
All is good now on the sd card boot/load front. Thanks to all for the help to get this geezer over the finish line.
I wonder whether all these timeouts need to be exactly 60 seconds, or whether we could spread them apart eg 40/50/60/70 seconds, to indicate what path we've gone down. For a while there the 'cog run' led was our only clue as to what was going on
I also saved files on the SD with no extensions i.e 'DEMO' and used 'RDEMO' to run Ok.
I also tried different cluster sizes 8,16,32 and 64k and found only 32k works.
I have a fix for the cluster bug. I had hard-coded the cluster size
There is a filename problem if the decimal in the first 4 bytes.
These small cluster sizes normally only happen when a card is reformatted in an incorrect format and technically shoudn't be as they are optimized to operate with their default format. The SD card association has SD card formatter software that anyone can use so why do you have to cater for what I would essentially regard as "faulty" cards? All cards from 4GB to 32GB have 4.2MB free before the FAT32 partition and the cluster size is 32kB. This is the normal specification for SD cards, what is wrong with specifying that after all?
Any cards I find that are incorrectly formatted I will reformat with a Panasonic SD Card Formatter but MS and Mac formatters are readily available from sdcard.org
Actually now that I'm thinking about it, I could build in a compact SD card formatter in TAQOZ itself.
Doing that will provide a "we know they have the tool" fix for a bunch of future problems. No brainer.
I am dealing with SD cards right now, and improper formatting leads to very rapid failure and or numerous little problems.
Yes, I have the low level tools and virtual memory for SD already built in so I am checking formats of cards and I will devise a suitable method. The formatter will check the card itself first and if it is suitable will proceed to format it firstly with 4.2MB free then FAT32 with 32k clusters. Hopefully I can fit it all in.
Also, there's a new Prop123_A9_8cogs_v32h.rbf which has the CORDIC (the last version was missing the CORDIC). This version also allows ROM rewriting.
Here's the link the new .zip:
https://drive.google.com/file/d/13X3cXH2-O3hx-ldjroR78m5c_MPM1fqB/view?usp=sharing