Some questions regarding the Propeller memory card by Parallax
trancefreak
Posts: 186
Hi,
I bought the Propeller Memory Card because I think I could get out of memory with my pinball project and only hub ram.
I plan to run the code in XMM-Split mode (code in flash, data in sram). When doing this, is it possible to also use the sd card to read data from it?
In one thread I saw an example that sd card and memory access is possible, but the person did manually access the flash, sram and sd card one at a time.
When running in XMM-Split mode, the driver from David Betz does the flash, ram access while I want to access the SD card via my code. Is that possible?
I'm asking this because the different memory types share pins.
I copied the pmc.cfg and winbond_sqi_flash_sram_xcache.dat files into the C:\Program Files (x86)\SimpleIDE\propeller-gcc\propeller-load directory. But in SimpleIDE
the new board type does not appear. Refreshing the board list or restarting simpleIDE did not work. What do I have to do to be able to see the new board from pmc.cfg
within the simpleIDE board list?
And last question :-)
I plan to play 2 different wav files (16 bit, 44 kHz or 32 kHz) from SD card and play a "video" from SD which is displayed via a LED DMD.
The LED DMD has 128x32 LED's. I plan to use 2 bits per pixel which gives me 4 different shades. Which means 1 Kb of data for a full DMD.
The DMD video sequences needs to be refreshed 18 - 24 times per second (I don't mean the refresh rate from a buffer to the DMD which is much higher and done by a cogc program).
Is the SD card read speed fast enough to fetch the wav data and dmd sequences? I plan to do that all via 1 cog (not a plain cogc program). Would that be feasable?
I know, tricky questions, but I would appreciate any input or help :-)
Thx,
Christian
I bought the Propeller Memory Card because I think I could get out of memory with my pinball project and only hub ram.
I plan to run the code in XMM-Split mode (code in flash, data in sram). When doing this, is it possible to also use the sd card to read data from it?
In one thread I saw an example that sd card and memory access is possible, but the person did manually access the flash, sram and sd card one at a time.
When running in XMM-Split mode, the driver from David Betz does the flash, ram access while I want to access the SD card via my code. Is that possible?
I'm asking this because the different memory types share pins.
I copied the pmc.cfg and winbond_sqi_flash_sram_xcache.dat files into the C:\Program Files (x86)\SimpleIDE\propeller-gcc\propeller-load directory. But in SimpleIDE
the new board type does not appear. Refreshing the board list or restarting simpleIDE did not work. What do I have to do to be able to see the new board from pmc.cfg
within the simpleIDE board list?
And last question :-)
I plan to play 2 different wav files (16 bit, 44 kHz or 32 kHz) from SD card and play a "video" from SD which is displayed via a LED DMD.
The LED DMD has 128x32 LED's. I plan to use 2 bits per pixel which gives me 4 different shades. Which means 1 Kb of data for a full DMD.
The DMD video sequences needs to be refreshed 18 - 24 times per second (I don't mean the refresh rate from a buffer to the DMD which is much higher and done by a cogc program).
Is the SD card read speed fast enough to fetch the wav data and dmd sequences? I plan to do that all via 1 cog (not a plain cogc program). Would that be feasable?
I know, tricky questions, but I would appreciate any input or help :-)
Thx,
Christian
Comments
Rename that file to boards_old.txt, and reload by pressing the green jigsaw puzzle piece in the SImpleIDE project manager. After that you should see all board types.
Leaving the other questions for someone else to answer ... I'm out of time.
That did the trick, thank you!! :-)
Does anyone else have answers regarding my other questions?
Christian
Thanks for your help, that sounds good! I'll try it and let you know the outcome as soon as the board arrived.
Christian
And I forgot to ask how many cogs are needed by the memory card driver?
You are right, I'll use the propgcc library, thanks for mentioning this!
Christian
I just used a simple example code from the propgcc demos (hello.side) and set the memory model to xmm-split.
I use the memory card in a breadboard connected to the propeller pins 0 - 7.
Connection diagram:
P0 => IO0/DI
P1 => IO1/DO
P2 => IO2
P3 => IO3/HOLD
P4 => SD CS
P5 => Flash CS
P6 => SRAM CS
P7 => CLK
Also I connected each Vss pin to GND and each 3.3V pin to 3.3V output from propeller quickstart board.
In simpleIDE I can use the Run in Terminal button. The code gets sent to the propeller correctly. If I disconnect pin 7 (CLK) for example, I get an error when sending the code to the propeller, so I think
it is correctly wired up.
When using "Run in Terminal", I get the following output in SimpleIDE:
The config file for the memory card contains the following:
But I don't get any output in the terminal window.
If I use memory model LMM / CMM everything works well.
Does anyone have an idea what I'm doing wrong?
Christian
Image of the quickstart board connected to the memory card on a breadboard:
EDIT: (Additional info)
SD card access is also not working. I loaded the SimpleIDE sd card access example project (SimpleIDE\Learn\Examples\Devices\Memory\SD with Tests.side) and
changed the sd pins to match the ones from the driver.
int DO = 0, CLK = 7, DI = 1, CS = 4;
I changed the memory model to LMM and tried to execute the program on the propeller.
I get the following error when trying to mount the sd card:
Error opening card.error code = 6
Could it be possible that the memory card driver isn't working correctly? I used the one David Betz posted in one of the memory card threads with the pmc.config (content posted above) which should contain the
production memory card settings and the winbond_sqi_flash_sram_xcache.dat driver which also was in the zip file.
Does anyone have an idea whats going wrong?
Any help would be appreciated.
Thx,
Christian
Yes it is possible the driver is broken. I haven't tested it yet, but will have time to do that later today.
Thanks for your patience.
Thanks for your help! Would be great if you could find out what's going wrong.
Thanks,
Christian
May I ask if you had time to look at the driver issue?
Christian
I tried the following code in XMM-SPLIT mode which did not show any output in the terminal window. In LMM / CMM Mode it worked.
To test the SD card I inserted a 4Gb micro sd card formatted with FAT16 and used LMM memory model.
Both tests failed. The SD test brings up the error code 6 when mounting the SD card.
Sorry it took so long to get back to this. I've been very busy.
I tried both the hello example and the SD Card access example on my PMC equipped quick-start.
I'm using the package David posted here for tests:
http://forums.parallax.com/showthread.php/149654-Interesting-New-Product-Propeller-Memory-Card?p=1202771&viewfull=1#post1202771
The hello example works in all memory models.
The SDCARD example "as written" fails with all memory models and standard Quickstart+HID+PMC board..
The SDCARD example works in CMM, LMM, and XMMC, if change the pins to this:
int DO = 1, CLK = 7, DI = 0, CS = 4; // SD card pins on Activity Board
The SDCARD example using the default PropellerGCC library setup also failed the same way.
When I changed the pmc.cfg file to look like this, CMM, LMM, and XMMC modes worked.
Hope this helps.
--Steve
Thanks for your help! After changing the two SD pins, I got the SD example working in LMM/CMM model.
The hello world example still does not run in XMM-Split, XMMC memory model. Interestingly I get it working in XMM-Single model. XMM-Single is code and data in SRAM, is that right?
Looks like accessing flash does not work. Is there an easy way to test if flash ram can be correctly accessed? Downloading the program via SimpleIDE does not bring up any error.
And is the PropellerPin to MemoryCard mapping correct how I did it?
P0 => IO0/DI
P1 => IO1/DO
P2 => IO2
P3 => IO3/HOLD
P4 => SD CS
P5 => Flash CS
P6 => SRAM CS
P7 => CLK
Thx,
Christian
EDIT:
When I compile the SD card example in XMM-Single or XMM-Split model, I get the following compiler errors:
Project Directory: C:/Users/Christian/Documents/SimpleIDE/Learn/Examples/Devices/Memory/
propeller-elf-gcc.exe -v GCC 4.6.1 (propellergcc_v1_0_0_2090)
propeller-elf-gcc.exe -I . -L . -I C:/Users/Christian/Documents/SimpleIDE/Learn/Simple Libraries/Utility/libsimpletools -L C:/Users/Christian/Documents/SimpleIDE/Learn/Simple Libraries/Utility/libsimpletools/xmm_single/ -I C:/Users/Christian/Documents/SimpleIDE/Learn/Simple Libraries/Text Devices/libsimpletext -L C:/Users/Christian/Documents/SimpleIDE/Learn/Simple Libraries/Text Devices/libsimpletext/xmm_single/ -I C:/Users/Christian/Documents/SimpleIDE/Learn/Simple Libraries/Protocol/libsimplei2c -L C:/Users/Christian/Documents/SimpleIDE/Learn/Simple Libraries/Protocol/libsimplei2c/xmm_single/ -o xmm_single/SD with Tests.elf -Os -mxmm-single -m32bit-doubles -fno-exceptions -std=c99 SD with Tests.c -lm -lsimpletools -lsimpletext -lsimplei2c -lm -lsimpletools -lsimpletext -lm -lsimpletools -lm
c:/program files (x86)/simpleide/propeller-gcc/bin/../lib/gcc/propeller-elf/4.6.1/../../../../propeller-elf/bin/ld.exe: cannot find -lsimpletools
c:/program files (x86)/simpleide/propeller-gcc/bin/../lib/gcc/propeller-elf/4.6.1/../../../../propeller-elf/bin/ld.exe: cannot find -lsimpletext
c:/program files (x86)/simpleide/propeller-gcc/bin/../lib/gcc/propeller-elf/4.6.1/../../../../propeller-elf/bin/ld.exe: cannot find -lsimplei2c
c:/program files (x86)/simpleide/propeller-gcc/bin/../lib/gcc/propeller-elf/4.6.1/../../../../propeller-elf/bin/ld.exe: cannot find -lsimpletools
c:/program files (x86)/simpleide/propeller-gcc/bin/../lib/gcc/propeller-elf/4.6.1/../../../../propeller-elf/bin/ld.exe: cannot find -lsimpletext
c:/program files (x86)/simpleide/propeller-gcc/bin/../lib/gcc/propeller-elf/4.6.1/../../../../propeller-elf/bin/ld.exe: cannot find -lsimpletools
collect2: ld returned 1 exit status
Am I missing some libraries?
Not all libraries are built for XMM SINGLE/SPLIT in the distribution by default. Andy hasn't had time for those yet.
I built these libraries with xmm single/split for testing the hello example in this order: libsimpletext, libsimpletools, then libsimplei2c.
XMMC should work out of the box for the hello and sdcard examples.
qs-hib-pmc.zip
I just tried your driver without having the sd card inserted and it didn't work. I cannot use XMM-Split model nor XMMC and XMM-Single, which worked yesterday a few times, does not work any longer.
Because it works well for you and Steve, I think it might be a hardware problem. To sort out if one of the Propeller I/O's has a problem or the memory board itself, I want to try the memory card with
other pins than 0 - 7.
Is there an easy way to update the config file to use the pins 8 - 15 for the cache driver or needs the driver be modified? I wanna try this first before I get in contact with Parallax asking for a replacement...
David, do you know if changing Pins is possible?
Regards,
Christian
cache-param2: (0 << 24) | (7 << 16) | (5 << 8) | 6
Are these settings correct when using pins 8 - 15?:
cache-param2: (8 << 24) | (15 << 16) | (13 << 8) | 14
Do you know what the numbers after the left shift symbol mean?
Regards,
Christian
I've been doing some experiments this morning, and it looks like there is an issue with having the SD Card plugged in.
Test programs run in xmm-split and xmm-single without the SD Card.
With the SD Card, i can't get xmm-split or xmm-single programs to run most of the time.
This is likely due to not having the SD Card initialization in the flash+sram spi driver.
I'm beginning to wonder about the wisdom of having the SD card share pins with other SPI devices. It isn't itself a SPI device at power up.
I didn't notice. Just call it confirmation then.
C3 seems to work well enough with SD Card init code. Seems that PMC should too.
I have changed the Prop pin to memory card mapping starting at pin 8 of the propeller. But that didn't change anything. The SD test example works in LMM model, the hello world example does not work in any
XMM mode. I have tested it without sd card inserted into the sd card holder but my test also fails.
To test if I will get error messages from the propeller loader when loading the hello world example to the propeller in xmm-split mode, I disconnected the 4 data wires one at a time.
If I disconnect data 0 or data 1, the loader can't load the program to flash memory and brings up an error message. If I disconnect data 3 and/or data 4, no error message comes up.
The loader tells me that everything worked well.
So there could be an issue with the data 3 and data 4 pins of the memory card which I can't test because the loader "ignores" errors even if these are disconnected so I can't verify that
data communication on all 4 ports is working.
I want to say a big thanks to both of you for being patient and helping me out!!!
I think I will get in contact with parallax asking if they are willing to give me a replacement.
Do you know a contact person at parallax who is responsible for replacing products?
Cheers,
Christian