Here's my P2ASM version if its of help, synchronous serial mode does the work, but synchronizing all the clocks might be tricky without assembler.
' Smartpin I2S DAC driver proof of concept, 3 smartpins for MCLK, BCLK, DOUT, plus LRCLK bit-banged
' Mark Tillotson 2019-01-12
CON
OSCMODE = $010c3f04
FREQ = 160_000_000
NCO_FREQ =%0000_0000_000_00000_00000000_01_00110_0
SYNC_TX = %0000_1001_000_00000_00000000_01_11100_0 ' sync serial tx using pin+1 as clk
DOUT_PIN_NUM = 48
CLOCK_PIN_NUM = DOUT_PIN_NUM + 1
MCLK_PIN_NUM = 50
LRCLK_PIN_NUM = 51
' must be a multiple of 8 for MCLK = 4*BCLK
CLKS_PER_BIT = 64 ' for 39.0625kHz samplerate (1.5MHz bitclk) (would be 48kHz for sysclk = 12.288MHz x 16)
' 40 will give 62.5kSPS at 160MHz sysclk
PUB demo | i, a
clkset(OSCMODE, FREQ)
pausems (1000) ' time for 'scope capture setup
cognew (@tx_output)
repeat
pausems (1)
DAT
org 0
tx_output
wrpin ##NCO_FREQ, #CLOCK_PIN_NUM
wxpin ##CLKS_PER_BIT/2, #CLOCK_PIN_NUM ' every 64 cycles (32 instructions), bit clock
wypin ##$80000000, #CLOCK_PIN_NUM ' toggle every other
wrpin ##NCO_FREQ, #MCLK_PIN_NUM
wxpin ##CLKS_PER_BIT/8, #MCLK_PIN_NUM ' every 16 cycles (8 instructions), master clock
wypin ##$80000000, #MCLK_PIN_NUM ' toggle every other
dirh ##CLOCK_PIN_NUM
dirh ##MCLK_PIN_NUM ' start clocks together
mov left, ##$80FFF000 ' test pat with bot 8 bits zero
mov t, left
rev t
shl t, #1
dirh lrclk_pin
wrpin ##SYNC_TX, dout_pin
wxpin ##%011111, dout_pin
wypin t, dout_pin
GETCT time
dirh dout_pin
ADDCT1 time, idelay
outl lrclk_pin
jmp #.skipy ' compensate for truncated first bit shifted by smartpin sync serial mode
.loop ' left channel
outl lrclk_pin ' drive left/right clock
.skipy
WAITCT1
ADDCT1 time, delay
sub right, #$37 ' testing pattern, 31 bits used, decrementing
mov t, right ' preload right
rev t
shl t, #1 ' I2S justification, top bit is delayed 1 place
wypin t, dout_pin
WAITCT1
ADDCT1 time, delay
' right channel
outh lrclk_pin ' drive left/right clock
WAITCT1
ADDCT1 time, delay
add left, #$100 ' testing pattern, strictly 24 bits
mov t, left ' preload left
rev t
shl t, #1
wypin t, dout_pin
WAITCT1
ADDCT1 time, delay
jmp #.loop
left long 0
right long 0
lrclk_pin long LRCLK_PIN_NUM
dout_pin long DOUT_PIN_NUM
delay long 16 * CLKS_PER_BIT
idelay long 15 * CLKS_PER_BIT
time res 1
t res 1
@Mark_T - Thanks for that Mark, I might see what I can do with that as well. I think Fred wanted to see what he could do with bit-bashing but unfortunately BCLK is not just for shifting data so not only does it need to be precise, it also needs to be continuous. I'm thinking that at the TAQOZ level if he wanted to do this it should be possible to setup up two pins that output the clocks and then any data that needs to be sent can be synch'd to these.
This is what I would call the "quick n dirty" way, but still a way
Yes, I2S devices are very fussy about their clocks and expect MCLK and BCLK (if both are used) to be phase locked
to each other as a minimum, and all clocks to be quartz stable and jitter-free. BCLK falling edge needs to match LRCLK transitions reasonably well too.
LRCLK needs to be 16kHz but I have to send the two 16 bit samples with BCLK during that time.
I tried putting the pin in NCO Frequency and synching with Z overflow but at that speed it cannot keep up, I lose a couple cycles between each loop.
It works really well at lower speed though.
12 PIN L
%1_00110_0 WRPIN
74 WXPIN
$8000_0000 WYPIN
BEGIN WAITPIN AKPIN 10 HIGH 10 LOW KEY UNTIL
By the way, when I read the smartpin Z result with RDPIN or RQPIN I don't understand the results I get.
From the doc :
Y[31:0] will be added into Z[31:0] at each base period.
The pin output will reflect Z[31].
During reset (DIR=0), IN is low, the output is low, and Z is set to zero.
So I expect Z[31] to alternate evenly between 0 and 1.
here is what I get :
TAQOZ# 10 WXPIN --- ok
TAQOZ# $0000_0001 WYPIN --- ok
TAQOZ# RDPIN .L --- $FEF1_E50E ok
TAQOZ# $FEF1_E50E ok
TAQOZ# $FEF1_E50E ok
TAQOZ# $FEF1_E50E ok
TAQOZ# $FEF1_E50E ok
TAQOZ# $FEF1_E50E ok
TAQOZ# F --- ok
TAQOZ# RDPIN .L --- $FEF1_E50E ok
TAQOZ# $FEF1_E50E ok
TAQOZ# $FEF1_E50E ok
TAQOZ# $FEF1_E50E ok
TAQOZ# $FEF1_E50E ok
TAQOZ# L --- ok
TAQOZ# RDPIN .L --- $FEF1_E50E ok
TAQOZ# $FEF1_E50E ok
TAQOZ# $FEF1_E50E ok
TAQOZ# $FEF1_E50E ok
TAQOZ# $FEF1_E50E ok
I'm always getting the same result (ctrl-x to print multiple RDPIN .L) and I would expect Z value to be 0 when I put the DIR low,
CHECK & FORMAT SD CARDS
After many many days of testing and refining I now have FAT32 formatting working correctly so that PCs are happy. We like it when our PCs are happy because if they are not then there is usually not much we can do about it. I've had to switch-off my forum mode to do this and get it done as my permanently recovering chemo head only lets me get so much done in a day and it is too much of a struggle to "interface" as well
The new FORMAT utility includes full SD and FAT32 reporting and diagnostics and also allows cards to be formatted in different cluster sizes from 512 to 64KB (tested). I am referring to TAQOZ as Extensible Firmware since that is what it is. You can even format the MBR by itself or other individual parts of the card if needed or extend the firmware for custom requirements.
I had a chat with Chip the other day and decided that where we have the MBR signature "ProP" etc we can also have another signature such as "TaqO" where instead of a sector and a byte count, we simply have a vector which the SD loader calls. This is normally the TAQOZ decompress into hub memory routine which starts up TAQOZ but it may also check the buffered MBR for a clock config word to HUBSET with etc. I am also treating the first 512 bytes of the Flash the same a the MBR in SD so that this signature can also exist there. "TaqO" in SD takes priority over Flash so that a system can be overridden.
If the TaqO signature does not exist then TAQOZ never boots unless called from the serial loader with the autobaud escape sequence. Once in TAQOZ the user can specify the clock mode easily and lock that and the baud rate into an MBR if so desired. Other features can be enabled and locked in as well including using the PS/2 keyboard and VGA monitor as the console at reboot.
Cluso99 rang up today and we agreed on this method, he doesn't even have to worry about any hubset, just jumps to my code if there is a signature and there are no further delays. The decompress routine can even read a clock config before anything else thus speeding up reboots.
I will have some new images later on once I add the file create routines via FOPEN with RWC permissions (RO=read-only, RW=read/write, RWC=read/write/create/delete).
If for nothing else TAQOZ is useful for checking and formatting SD cards (and even the Flash) as FAT32.
Format a 32GB Sandisk Ultra with 64KB clusters and then backup TAQOZ into the MBR (and check)
NOTE: SDXC seems to need a little some more testing to allow writes (reading is fine) since they are setup with special speed class recording which we don't need.
These are the forms for BACKUP:
BACKUP <filename> --- backup to the specified file if found (does not create a file)
BACKUP BIX --- backup to _BOOT_P2.BIX
BACKUP MBR --- backup to sector 1 and set MBR signature (FAT32 not required)
BACKUP FLASH --- backup to serial Flash (^R restores but does not boot yet, needs 2nd stage loader or new ROM)
P.S. Don't expect me to be too chatty, I will have my head down to the keyboard since we need a ROM before next week.
Write Current @VDD min.......... 60ma
Write Current @VDD max.......... 10ma
Why is max current lower than min current?
It's a mystery, I read the CSD bit fields, look-up the table, and report the values. Some of these seem to reflect values you would see with an internal charge-pump that seems to kick in, otherwise normal, but some brands can't be trusted either as they have weird manufactured dates etc. I've combed the documents and what is there is according to the letter of the document.
Here's a 4G Sandisk manufactured in 2010.
Read Current @VDD min........... 10ma
Read Current @VDD max........... 45ma
Write Current @VDD min.......... 25ma
Write Current @VDD max.......... 10ma
Presume FAT32 LBA has the identifier $0C while the older is FAT32 CHS which has $0B IIRC.
Have you seen any FAT32 CHS formatted cards?
I saw exFAT uses $07 shich is the same as NTFS ???
I was reading exFAT and it seems that the hash patent is for hashing the filename to do a fast lookup to see if it exists. If so, then it seems to do a slow crawl thru the DIR looking for the filename, just like FAT32. If i get time to onfirm this, then maybe I can search for tbe filenames and load too.
Yes, DC-DC conversion inside the SDcard will be very inefficient if Vdd is 1.8V or lower, compared to 3.3V.
The interface normally starts at 3.3V and negotiates a lower voltage for higher speed operation, IIRC
Thanks Peter, great work. The more I work with Taqoz, the more I enjoy it. It is actually easier to learn than I thought at first. It's just a matter of diving in and taking the time to learn the basics.
I work with a OneNote notebook open beside my terminal window, I write a little bit of code in my notebook first and test it as I go. If something is wrong, I can start debugging right away in the terminal. That reminds me the way I work with Python, with a REPL prompt always open.
When you'll be done with the ROM, it think it would be a good investment to start that GitHub repo. I've took a lot of notes so far and I would like to contribute back what I'm doing so that everyone can benefit from it. That way you can invest your time adding new features while the "Taqoz team" can help with improving the docs and example code.
Today is D Day, where the letter D is for Deliver the ROM. While there are a ton of things I'd still like to do I find I must stop right where I am and prepare. Now I am trimming the file to reclaim unneeded private names from the dictionary, zeroing out unused space, inserting conditional compile statements in the source to remove less important code etc so that I can end up with a target of around 12kB of compressed code. Most of the stuff is still in it with 14kB compressed so I will judiciously working it to come up with the magic 12kB number I need to squeeze into ROM. The decompress routine should hopefully take up no more than 200 bytes but I need to test that today. Once I have ROM files ready to go and I still have time I will add the extra mailbox functions and double check some timings.
The FORMAT option is quite flexible but TAQOZ can still be extended quite easily with simple one-liners.
Here's a terminal grab showing the detailed directory listing where it reports the exact size of the file as well as the size allocated in the cluster chain, as well as the contents of the file header. The 1.4G ISO file took a couple of seconds to report the allocated size since the cluster chain had to be scanned for 352,000 4k cluster chain entries to determine the allocated space
Today is D Day, where the letter D is for Deliver the ROM. While there are a ton of things I'd still like to do I find I must stop right where I am and prepare. Now I am trimming the file to reclaim unneeded private names from the dictionary, zeroing out unused space, inserting conditional compile statements in the source to remove less important code etc so that I can end up with a target of around 12kB of compressed code. Most of the stuff is still in it with 14kB compressed so I will judiciously working it to come up with the magic 12kB number I need to squeeze into ROM. The decompress routine should hopefully take up no more than 200 bytes but I need to test that today. Once I have ROM files ready to go and I still have time I will add the extra mailbox functions and double check some timings.
Do you have a list/mapping of supported TAQOZ operations, to Smart Pin modes ?
I've seen a few go past, and used a couple, but a full set would be useful to many users.
P2 Docs list:
%MMMMM: 00000 = smart pin off (default)
00001 = long repository (P[12:10] != %101)
00010 = long repository (P[12:10] != %101)
00011 = long repository (P[12:10] != %101)
00001 = DAC noise (P[12:10] = %101)
00010 = DAC 16-bit dither, noise (P[12:10] = %101)
00011 = DAC 16-bit dither, PWM (P[12:10] = %101)
00100* = pulse/cycle output
00101* = transition output
00110* = NCO frequency
00111* = NCO duty
01000* = PWM triangle
01001* = PWM sawtooth
01010* = PWM switch-mode power supply, V and I feedback
01011 = periodic/continuous: A-B quadrature encoder
01100 = periodic/continuous: inc on A-rise & B-high
01101 = periodic/continuous: inc on A-rise & B-high / dec on A-rise & B-low
01110 = periodic/continuous: inc on A-rise {/ dec on B-rise}
01111 = periodic/continuous: inc on A-high {/ dec on B-high}
10000 = time A-states
10001 = time A-highs
10010 = time X A-highs/rises/edges -or- timeout a-/high/rise/edge
10011 = for X periods, count time
10100 = for X periods, count states
10101 = for periods in X+ clocks, count time
10110 = for periods in X+ clocks, count states
10111 = for periods in X+ clocks, count periods
11000* = USB host, low-speed (even/odd pin pair = DM/DP)
11001* = USB host, full-speed (even/odd pin pair = DM/DP)
11010* = USB device, low-speed (even/odd pin pair = DM/DP)
11011* = USB device, full-speed (even/odd pin pair = DM/DP)
11100* = sync serial transmit (A-data, B-clock)
11101 = sync serial receive (A-data, B-clock)
11110* = async serial transmit (baudrate)
11111 = async serial receive (baudrate)
Peter, any idea when you will send me the BIG source file with all of our code in it? I will compile final FPGA images when I get it. And, I will compose the final ROM file for ON Semi.
Tonight I am working on the layout change recipe to tweak the PLL loop filter, so that it works more like it ought to.
These are the final things that need to be done, in order to complete Parallax' input for the next silicon. After this, ON Semi runs with it and tapes out on March 1st. Prototypes should be back on May 20th.
@FredBlais - Sweet! Great work! But where's the code?
TAQOZ ROM UPDATE
I'm under pressure and need to get this finished but I am squeezing TAQOZ down so it can fit in a 12k compressed image. I made a big mistake early on and didn't fully check the requirements of LMZA and it seems like a 14kB image needs a 8MB dictionary!!! At least that is what the header is telling me but I am checking through that properly since it does have great compression as the only other alternative I see is to use LZ4 (which I initially confused with LZM) but while that is lean and fast to decompress, the image size is larger which requires more aggressive "squeezing" of the code.
I had to leave out all the VGA and PS/2 stuff because I wanted to make sure that TAQOZ would be able to diagnose and fix SD card problems. It can FORMAT any SDHC and SDXC card as FAT32 with any sector/cluster size of 512 to 64KB. I thought I had a problem with trying to format a 64GB SDXC card but that turned out to be a faulty card since it wouldn't format in other PCs either although it reads fine. Doing a bit of research on why it wouldn't format led me to some people complaining that this is what happens to these Sandisk Ultra 64GB cards in that you can read them but can't write to them anymore, as if the integrated charge-pump failed or something. I seem to remember that this card was in a phone but eventually became faulty for some reason.
So in the meantime I am busy squeezing and testing LZ4 and LZMA methods. I'd appreciate feedback from anybody with experience in this area but obviously time is not a luxury we can afford.
NOTE: DO NOT BUY SANDISK ULTRA 64GB - I've always had problems with them and from my research it seems so does everybody else. Otherwise smaller Sandisk cards are good.
I have one SanDIsk Ultra SDHC 64GB (red/grey) in exFAT. No problems yet.
Funny that I didn't even think to try to format it on a PC since I have such high regard for SanDisk, yet this card failed in a phone and I think I had another one do the same in another.
Could you display the internal register data on your unit?
Here's the current image for the P2D2 if that helps.
@Cluso99 - can you boot with that P2.ROM image and see if you can format it to FAT32 using "0 FORMAT" to select autosized clusters then paste the result back? Sounds like a different type of Sandisk 64GB from what I have "SL64G" vs "SU64G". I would really like to make sure that this works fine on a 64GB since this is why I implemented the disk utilities. Those $14 64GB are local from MSY so I will test them as soon as I can but not before committing the ROM.
If you want 32kB clusters you can type:
32 KB FORMAT
Smaller clusters take longer to format as there are more FAT32 table entries that have to be initialized.
I've put some examples files on my OneDrive
Here is the code :
[code]
{
WAVE FILE PLAYBACK FOR PROPELLER 2 WITH ADAFRUIT MAX98357 I2S CLASS D MONO AMPLIFIER
Impressive.
What sample rate.resolution or BCLK MHz, can the code manage up to, before the software is too slow to keep up ?
I see a cryptic FOPEN MARIO.WAV, but no comments saying how large that is, or where it resides, or how the user loads that WAV file ?
The file is 5344 KB large and is sitting on the SD card along with the _BOOT_P2.BIX that is TAQOZ release from january 27 with the meta compiled extension file.
FOPEN is Peter magic, it opens the file on the SD and then all the rest is done with the SDW@ (SD word get).
pre FOPEN
GET$
pub FOPEN$ ( str -- )
>F83 DROP FINDSD ?DUP IF FSECT ELSE 0 THEN FOPENS
;
--- Lookup starting sector from dir entry
pub FSECT ( diradr -- sector )
--- cluster low and cluster high
fcl OVER+ W@ SWAP fch + W@ W>L
pub C>S --- convert cluster to to starting sector
rootcl @ - sectclust C@ * @ROOT +
;
--- find current f83 name and return with file offset to directory entry
pri FINDSD ( -- sdrel )
ROOT
0 BEGIN DUP SDADR FNAME= NOT WHILE DUP SDADR C@ 0= IF DROP 0 EXIT THEN 32 + REPEAT
SDADR
;
For the speed, I've got 31.25us per sample to do my stuff and getting the 16 bit word from the SD card takes 13us.
Going from 16 bit to 32 bit resolution should be easy because that part is all done by the smartpin.
When I change the clock speed to 360MHZ, it takes 3us to read a word or a long from the SD Card
TAQOZ# 44 LAP SDW@ LAP .LAP --- 1,056 cycles= 2,933ns @360MHz ok
TAQOZ# 44 LAP SD@ LAP .LAP --- 1,064 cycles= 2,955ns @360MHz ok
the max sample rate for the amplifier is 96kHz. That gives me 5.2us to send the data.
So it seems totally possible to achieve the amplifier top speed and top resolution.
@Cluso99 - Just rename P2.ROM to _BOOT_P2.BIX etc and put it onto a FAT32 card, boot it, then swap cards. This version will automount as soon as you insert the 64GB card so it should report the verbose CID details. Then try 0 FORMAT to auto format the card to FAT32 after which it will perform a .DISK which will display all the card and FAT32 info.
Just to be on the safe side, here is the latest P2D2 image (.BIN attachments aren't accepted by the forum anyway)
@cluso99 - you may have an earlier version that had a buggy automount and would loop. Essentially the automounter checks that the card is inserted, the serial number matches, and if none if these are right it will unmount. So once the card is inserted and it detects the card (in the console keypoll loop) and it knows it isn't mounted, it will perform the automount.
PNut doesn't handle binary files but loadp2 does or put it onto a card.
Comments
This is what I would call the "quick n dirty" way, but still a way
to each other as a minimum, and all clocks to be quartz stable and jitter-free. BCLK falling edge needs to match LRCLK transitions reasonably well too.
LRCLK needs to be 16kHz but I have to send the two 16 bit samples with BCLK during that time.
I tried putting the pin in NCO Frequency and synching with Z overflow but at that speed it cannot keep up, I lose a couple cycles between each loop.
It works really well at lower speed though.
By the way, when I read the smartpin Z result with RDPIN or RQPIN I don't understand the results I get.
From the doc :
So I expect Z[31] to alternate evenly between 0 and 1.
here is what I get :
I'm always getting the same result (ctrl-x to print multiple RDPIN .L) and I would expect Z value to be 0 when I put the DIR low,
After many many days of testing and refining I now have FAT32 formatting working correctly so that PCs are happy. We like it when our PCs are happy because if they are not then there is usually not much we can do about it. I've had to switch-off my forum mode to do this and get it done as my permanently recovering chemo head only lets me get so much done in a day and it is too much of a struggle to "interface" as well
The new FORMAT utility includes full SD and FAT32 reporting and diagnostics and also allows cards to be formatted in different cluster sizes from 512 to 64KB (tested). I am referring to TAQOZ as Extensible Firmware since that is what it is. You can even format the MBR by itself or other individual parts of the card if needed or extend the firmware for custom requirements.
I had a chat with Chip the other day and decided that where we have the MBR signature "ProP" etc we can also have another signature such as "TaqO" where instead of a sector and a byte count, we simply have a vector which the SD loader calls. This is normally the TAQOZ decompress into hub memory routine which starts up TAQOZ but it may also check the buffered MBR for a clock config word to HUBSET with etc. I am also treating the first 512 bytes of the Flash the same a the MBR in SD so that this signature can also exist there. "TaqO" in SD takes priority over Flash so that a system can be overridden.
If the TaqO signature does not exist then TAQOZ never boots unless called from the serial loader with the autobaud escape sequence. Once in TAQOZ the user can specify the clock mode easily and lock that and the baud rate into an MBR if so desired. Other features can be enabled and locked in as well including using the PS/2 keyboard and VGA monitor as the console at reboot.
Cluso99 rang up today and we agreed on this method, he doesn't even have to worry about any hubset, just jumps to my code if there is a signature and there are no further delays. The decompress routine can even read a clock config before anything else thus speeding up reboots.
I will have some new images later on once I add the file create routines via FOPEN with RWC permissions (RO=read-only, RW=read/write, RWC=read/write/create/delete).
If for nothing else TAQOZ is useful for checking and formatting SD cards (and even the Flash) as FAT32.
Format a 32GB Sandisk Ultra with 64KB clusters and then backup TAQOZ into the MBR (and check)
NOTE: SDXC seems to need a little some more testing to allow writes (reading is fine) since they are setup with special speed class recording which we don't need.
These are the forms for BACKUP:
BACKUP <filename> --- backup to the specified file if found (does not create a file)
BACKUP BIX --- backup to _BOOT_P2.BIX
BACKUP MBR --- backup to sector 1 and set MBR signature (FAT32 not required)
BACKUP FLASH --- backup to serial Flash (^R restores but does not boot yet, needs 2nd stage loader or new ROM)
P.S. Don't expect me to be too chatty, I will have my head down to the keyboard since we need a ROM before next week.
Write Current @VDD max.......... 10ma
Why is max current lower than min current?
It's a mystery, I read the CSD bit fields, look-up the table, and report the values. Some of these seem to reflect values you would see with an internal charge-pump that seems to kick in, otherwise normal, but some brands can't be trusted either as they have weird manufactured dates etc. I've combed the documents and what is there is according to the letter of the document.
Here's a 4G Sandisk manufactured in 2010.
you can just not use it and if you need it just make your own
patched "lsio" which skips scanning your communication pins.
the code is there.
Presume FAT32 LBA has the identifier $0C while the older is FAT32 CHS which has $0B IIRC.
Have you seen any FAT32 CHS formatted cards?
I saw exFAT uses $07 shich is the same as NTFS ???
I was reading exFAT and it seems that the hash patent is for hashing the filename to do a fast lookup to see if it exists. If so, then it seems to do a slow crawl thru the DIR looking for the filename, just like FAT32. If i get time to onfirm this, then maybe I can search for tbe filenames and load too.
I'm guessing those are the required currents when Vdd is at min or max.
The interface normally starts at 3.3V and negotiates a lower voltage for higher speed operation, IIRC
I work with a OneNote notebook open beside my terminal window, I write a little bit of code in my notebook first and test it as I go. If something is wrong, I can start debugging right away in the terminal. That reminds me the way I work with Python, with a REPL prompt always open.
When you'll be done with the ROM, it think it would be a good investment to start that GitHub repo. I've took a lot of notes so far and I would like to contribute back what I'm doing so that everyone can benefit from it. That way you can invest your time adding new features while the "Taqoz team" can help with improving the docs and example code.
The FORMAT option is quite flexible but TAQOZ can still be extended quite easily with simple one-liners.
Here's a terminal grab showing the detailed directory listing where it reports the exact size of the file as well as the size allocated in the cluster chain, as well as the contents of the file header. The 1.4G ISO file took a couple of seconds to report the allocated size since the cluster chain had to be scanned for 352,000 4k cluster chain entries to determine the allocated space
Do you have a list/mapping of supported TAQOZ operations, to Smart Pin modes ?
I've seen a few go past, and used a couple, but a full set would be useful to many users.
P2 Docs list:
I don't think you will see any answers from Peter until TAQOZ is done.
Tonight I am working on the layout change recipe to tweak the PLL loop filter, so that it works more like it ought to.
These are the final things that need to be done, in order to complete Parallax' input for the next silicon. After this, ON Semi runs with it and tapes out on March 1st. Prototypes should be back on May 20th.
I know Peter is working on it. He said he would not be on the forum so I'll send him an SMS.
Ray
16kHz sample rate, 16bit resolution
1 cog, 2 nco frequency smartpin, 1 synchronous serial smartpin, TAQOZ reading wav file from SD card @ 80MHz
TAQOZ ROM UPDATE
I'm under pressure and need to get this finished but I am squeezing TAQOZ down so it can fit in a 12k compressed image. I made a big mistake early on and didn't fully check the requirements of LMZA and it seems like a 14kB image needs a 8MB dictionary!!! At least that is what the header is telling me but I am checking through that properly since it does have great compression as the only other alternative I see is to use LZ4 (which I initially confused with LZM) but while that is lean and fast to decompress, the image size is larger which requires more aggressive "squeezing" of the code.
I had to leave out all the VGA and PS/2 stuff because I wanted to make sure that TAQOZ would be able to diagnose and fix SD card problems. It can FORMAT any SDHC and SDXC card as FAT32 with any sector/cluster size of 512 to 64KB. I thought I had a problem with trying to format a 64GB SDXC card but that turned out to be a faulty card since it wouldn't format in other PCs either although it reads fine. Doing a bit of research on why it wouldn't format led me to some people complaining that this is what happens to these Sandisk Ultra 64GB cards in that you can read them but can't write to them anymore, as if the integrated charge-pump failed or something. I seem to remember that this card was in a phone but eventually became faulty for some reason.
So in the meantime I am busy squeezing and testing LZ4 and LZMA methods. I'd appreciate feedback from anybody with experience in this area but obviously time is not a luxury we can afford.
NOTE: DO NOT BUY SANDISK ULTRA 64GB - I've always had problems with them and from my research it seems so does everybody else. Otherwise smaller Sandisk cards are good.
Funny that I didn't even think to try to format it on a PC since I have such high regard for SanDisk, yet this card failed in a phone and I think I had another one do the same in another.
Could you display the internal register data on your unit?
Here's the current image for the P2D2 if that helps.
If you want 32kB clusters you can type:
32 KB FORMAT
Smaller clusters take longer to format as there are more FAT32 table entries that have to be initialized.
Ill try in the morning if i get time before work. I have a dentist appt after work so will be late home.
I've put some examples files on my OneDrive
Here is the code :
Impressive.
What sample rate.resolution or BCLK MHz, can the code manage up to, before the software is too slow to keep up ?
I see a cryptic FOPEN MARIO.WAV, but no comments saying how large that is, or where it resides, or how the user loads that WAV file ?
The file is 5344 KB large and is sitting on the SD card along with the _BOOT_P2.BIX that is TAQOZ release from january 27 with the meta compiled extension file.
FOPEN is Peter magic, it opens the file on the SD and then all the rest is done with the SDW@ (SD word get).
For the speed, I've got 31.25us per sample to do my stuff and getting the 16 bit word from the SD card takes 13us.
Going from 16 bit to 32 bit resolution should be easy because that part is all done by the smartpin.
When I change the clock speed to 360MHZ, it takes 3us to read a word or a long from the SD Card
the max sample rate for the amplifier is 96kHz. That gives me 5.2us to send the data.
So it seems totally possible to achieve the amplifier top speed and top resolution.
Just to be on the safe side, here is the latest P2D2 image (.BIN attachments aren't accepted by the forum anyway)
PNut doesn't handle binary files but loadp2 does or put it onto a card.