Shop OBEX P1 Docs P2 Docs Learn Events
Some questions regarding the Propeller memory card by Parallax — Parallax Forums

Some questions regarding the Propeller memory card by Parallax

trancefreaktrancefreak Posts: 186
edited 2013-11-01 17:09 in Propeller 1
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
«134567

Comments

  • jazzedjazzed Posts: 11,803
    edited 2013-09-25 13:02
    For SimpleIDE, there is a boards.txt file in propeller-load\boards.txt . It acts as a filter to only display cfg files that match boards.txt contents.

    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.
  • David BetzDavid Betz Posts: 14,516
    edited 2013-09-25 13:14
    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.
    This is supposed to work. If you try it and find that it doesn't, please let me know and I'll fix it.
  • trancefreaktrancefreak Posts: 186
    edited 2013-09-25 13:15
    Hi jazzed,

    That did the trick, thank you!! :-)
    Does anyone else have answers regarding my other questions?

    Christian
  • trancefreaktrancefreak Posts: 186
    edited 2013-09-25 13:17
    Hi David,

    Thanks for your help, that sounds good! I'll try it and let you know the outcome as soon as the board arrived.

    Christian
  • David BetzDavid Betz Posts: 14,516
    edited 2013-09-25 14:08
    Hi David,

    Thanks for your help, that sounds good! I'll try it and let you know the outcome as soon as the board arrived.

    Christian
    In general, the cache drivers including the one for the PMC are supposed to let go of the SPI pins when they are idle. Also, I believe that the PropGCC library uses a small function in hub memory to do the SD card sector read/write accesses and hopefully the SD driver also lets go of the SPI pins when it is idle. These two together should let the cache driver and the filesystem code work with devices on the same SPI bus.
  • trancefreaktrancefreak Posts: 186
    edited 2013-09-25 14:13
    I'm planning to use the sd driver provided by simpletools. I hope that implementation is equal to the propgcc one :-)

    And I forgot to ask how many cogs are needed by the memory card driver?
  • David BetzDavid Betz Posts: 14,516
    edited 2013-09-25 14:16
    I'm planning to use the sd driver provided by simpletools. I hope that implementation is equal to the propgcc one :-)

    And I forgot to ask how many cogs are needed by the memory card driver?
    The PMC driver runs in a single COG. I don't know if the SD card driver that is part of simpletools will work. Why use simpletools if you have lots of XMM memory? It's main purpose was to help shoe horn code into hub memory as I understand it. Why not just use the standard C library?
  • trancefreaktrancefreak Posts: 186
    edited 2013-09-25 14:39
    That's a good point! :-)
    You are right, I'll use the propgcc library, thanks for mentioning this!

    Christian
  • David BetzDavid Betz Posts: 14,516
    edited 2013-09-25 14:43
    That's a good point! :-)
    You are right, I'll use the propgcc library, thanks for mentioning this!

    Christian
    I just went the the SimpleTools documentation and I couldn't find any SD card support. Where did you see a description of it?
  • trancefreaktrancefreak Posts: 186
    edited 2013-09-25 14:53
    I just had a look at the sd example provided by simple ide using the simpletools library:
    /*
      SD Minimal.side
    
    
      Create test.txt, write characters in, read back out, display. 
      
      http://learn.parallax.com/propeller-c-simple-devices/sd-card-data
    */
    
    
    #include "simpletools.h"                      // Include simpletools header    
    
    
    int DO = 22, CLK = 23, DI = 24, CS = 25;      // SD card pins on Propeller BOE
    
    
    int main(void)                                // main function
    {
      sd_mount(DO, CLK, DI, CS);                  // Mount SD card
    
    
      FILE* fp = fopen("test.txt", "w");          // Open a file for writing
      fwrite("Testing 123...\n", 1, 15, fp);      // Add contents to the file
      fclose(fp);                                 // Close the file
      
      char s[15];                                 // Buffer for characters
      fp = fopen("test.txt", "r");                // Reopen file for reading
      fread(s, 1, 15, fp);                        // Read 15 characters
      fclose(fp);                                 // Close the file
    
    
      print("First 15 chars in test.txt:\n");     // Display heading
      print("%s", s);                             // Display characters
      print("\n");                                // With a newline at the end
    }    
    
  • David BetzDavid Betz Posts: 14,516
    edited 2013-09-25 15:04
    I think those are the normal C library functions. They aren't special for simple tools as far as I know. Steve will probably clarify though.
  • trancefreaktrancefreak Posts: 186
    edited 2013-10-04 12:40
    Yesterday I got the memory card and tried it today but can't get it working.
    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:
    Project Directory: C:/Users/Christian/Documents/SimpleIDE/Propeller GCC Demos/hello/
    
    
    propeller-elf-gcc.exe -v GCC 4.6.1 (propellergcc_v1_0_0_2090)
    propeller-elf-gcc.exe -I . -L . -o xmm_split/hello.elf -Os -mxmm-split -fno-exceptions hello.c -ltiny -ltiny -ltiny
    propeller-elf-objdump -h xmm_split/hello.elf
    Done. Build Succeeded!
    
    
    propeller-load.exe -Dreset=dtr -I C:/Program Files (x86)/SimpleIDE/bin/../propeller-gcc/propeller-load/ -b QS-HIB-PMC xmm_split/hello.elf -r -p COM3
    Propeller Version 1 on COM3
    Loading the serial helper to hub memory
    
    
    9568 bytes sent
    
    
    Verifying RAM ... Loading cache driver 'winbond_sqi_flash_sram_xcache.dat'
    
    
    1816 bytes sent             
    Loading program image to flash
    2264 bytes sent             
    Loading .xmmkernel
    1732 bytes sent
    

    The config file for the memory card contains the following:
    # qs-hib-pmc.cfg
    # for the QuickStart board with a Human Interface Board and a Propeller Memory Card
        clkfreq: 80000000
        clkmode: XTAL1+PLL16X
        baudrate: 115200
        rxpin: 31
        txpin: 30
        cache-driver: winbond_sqi_flash_sram_xcache.dat
        cache-size: 512+8K
        cache-param2: (0 << 24) | (7 << 16) | (5 << 8) | 6
        sd-driver: sd_driver.dat
        sdspi-do: 0
        sdspi-clk: 7
        sdspi-di: 1
        sdspi-cs: 4
    

    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:
    20131004_205245.jpg


    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
    1024 x 768 - 110K
  • jazzedjazzed Posts: 11,803
    edited 2013-10-05 08:54
    Hi,

    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.
  • trancefreaktrancefreak Posts: 186
    edited 2013-10-05 09:24
    Hi Jazzed,

    Thanks for your help! Would be great if you could find out what's going wrong. :)

    Thanks,
    Christian
  • trancefreaktrancefreak Posts: 186
    edited 2013-10-06 03:21
    Hi Jazzed,

    May I ask if you had time to look at the driver issue?

    Christian
  • David BetzDavid Betz Posts: 14,516
    edited 2013-10-06 10:21
    Yesterday I got the memory card and tried it today but can't get it working.
    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:
    Project Directory: C:/Users/Christian/Documents/SimpleIDE/Propeller GCC Demos/hello/
    
    
    propeller-elf-gcc.exe -v GCC 4.6.1 (propellergcc_v1_0_0_2090)
    propeller-elf-gcc.exe -I . -L . -o xmm_split/hello.elf -Os -mxmm-split -fno-exceptions hello.c -ltiny -ltiny -ltiny
    propeller-elf-objdump -h xmm_split/hello.elf
    Done. Build Succeeded!
    
    
    propeller-load.exe -Dreset=dtr -I C:/Program Files (x86)/SimpleIDE/bin/../propeller-gcc/propeller-load/ -b QS-HIB-PMC xmm_split/hello.elf -r -p COM3
    Propeller Version 1 on COM3
    Loading the serial helper to hub memory
    
    
    9568 bytes sent
    
    
    Verifying RAM ... Loading cache driver 'winbond_sqi_flash_sram_xcache.dat'
    
    
    1816 bytes sent             
    Loading program image to flash
    2264 bytes sent             
    Loading .xmmkernel
    1732 bytes sent
    

    The config file for the memory card contains the following:
    # qs-hib-pmc.cfg
    # for the QuickStart board with a Human Interface Board and a Propeller Memory Card
        clkfreq: 80000000
        clkmode: XTAL1+PLL16X
        baudrate: 115200
        rxpin: 31
        txpin: 30
        cache-driver: winbond_sqi_flash_sram_xcache.dat
        cache-size: 512+8K
        cache-param2: (0 << 24) | (7 << 16) | (5 << 8) | 6
        sd-driver: sd_driver.dat
        sdspi-do: 0
        sdspi-clk: 7
        sdspi-di: 1
        sdspi-cs: 4
    

    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:
    20131004_205245.jpg


    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
    Can you post the code you're trying to run? If you switched to LMM mode then you aren't even using the qs-hib-pmc driver anymore so any SD card problems must have to do with the main PropGCC SD card driver. Anyway, I have the QS+HIB+PMC combination so I'll try any code you post to see if I can figure out why it isn't working.
  • trancefreaktrancefreak Posts: 186
    edited 2013-10-06 10:50
    Hi David,

    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.
    /*
     * This is a non-traditional hello demo for Propeller-GCC.
     * The demo repeats printing every 100ms with the iteration.
     * It uses waitcnt instead of sleep so it will fit in a COG.
     */
    #include <stdio.h>
    #include <propeller.h>
    
    
    int main(void)
    {
        int n = 1;
    
    
        while(1) {
            waitcnt(CLKFREQ/10+CNT);
            printf("Hello World %d\n", n);
            n++;
        }
        return 0;
    }
    

    To test the SD card I inserted a 4Gb micro sd card formatted with FAT16 and used LMM memory model.

    /*
      SD with Tests.side
    
    
      SD Minimal modified so that it tests for drive and file before performing
      any read/write operations.  
      
      http://learn.parallax.com/propeller-c-simple-devices/sd-card-data
    */
    
    
    #include "simpletools.h"                            // Include simpletools header     
    
    
    int DO = 0, CLK = 7, DI = 1, CS = 4;            // SD card pins on Activity Board
    
    
    int main(void)                                      // main function
    {
      int erc = sd_mount(DO, CLK, DI, CS);              // Mount SD card
      if(!erc)                                          // Error code = 0, good, continue
      {
        FILE* fp = fopen("test.txt", "w");              // Open a file for writing
        
        if(fp)                                          // Nonzero file pointer?  
        {                                               // Good, continue
          fwrite("Test message, hello!\n", 1, 21, fp);  // Add contents to the file
        }
        else                                            // Zero file pinter?
        {                                               // Bad, error message.
          print("File did not open.\n");         
        }                                         
        fclose(fp);                                     // Close the file
      
        fp = fopen("test.txt", "r");                    // Reopen file for reading.
      
        char s[80];                                     // Buffer for characters.
      
        if(fp)                                          // Nonzero file pinter?  
        {                                               // Good, continue.
        print("First 21 chars in test.txt:\n");         // Display heading
        fread(s, 1, 21, fp);                            // Read 21 characters
        print("%s", s);                                 // Display them
        print("\n");                                    // With a newline at the end.
        }
        else                                            // Zero file pointer?
        {                                               // Bad, print error.
          print("File did not open.\n");         
          print("\n");
        }
        fclose(fp);                                     // Close the file.
      }
      else                                              // Mount error code not zero?
      {                                                 // Bad, display code
        print("Error opening card.");
        print("error code = %d\n", erc);
      }
    }    
    

    Both tests failed. The SD test brings up the error code 6 when mounting the SD card.
  • jazzedjazzed Posts: 11,803
    edited 2013-10-06 13:04
    Hi.

    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.
    # pmc.cfg
    # for the QuickStart board with a Human Interface Board and a Propeller Memory Card
        clkfreq: 80000000
        clkmode: XTAL1+PLL16X
        baudrate: 115200
        rxpin: 31
        txpin: 30
        cache-driver: winbond_sqi_flash_sram_xcache.dat
        cache-size: 512+8K
        cache-param2: (0 << 24) | (7 << 16) | (5 << 8) | 6
        sd-driver: sd_driver.dat
        sdspi-do: 1  # original has 0 for DO
        sdspi-clk: 7
        sdspi-di: 0  # original has 1 for DI
        sdspi-cs: 4
    

    Hope this helps.
    --Steve
  • trancefreaktrancefreak Posts: 186
    edited 2013-10-06 13:48
    Hi 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?
  • jazzedjazzed Posts: 11,803
    edited 2013-10-06 15:24
    Hi.

    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.
  • David BetzDavid Betz Posts: 14,516
    edited 2013-10-06 19:30
    Here is a configuration file and cache driver that I've tested with the production Propeller Memory Card and it works in xmmc, xmm-single, and xmm-split modes. Note however that you will need to use it without an SD card inserted into the Propeller Memory Card because it doesn't contain the code to force the SD card out of SDIO mode and that will interfere with SPI transfers to the flash and SRAM chips. I'll look into adding that code sometime soon.

    qs-hib-pmc.zip
  • trancefreaktrancefreak Posts: 186
    edited 2013-10-07 10:41
    Hi David,

    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
  • David BetzDavid Betz Posts: 14,516
    edited 2013-10-07 10:58
    Hi David,

    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
    You can change the pins by modifying the .cfg file:
            ' get the pin definitions (cache-param2)
            ' 0xssccffrr where ss=sio0, cc=clk, ff=flash cs, ss=sram cs
    
  • trancefreaktrancefreak Posts: 186
    edited 2013-10-07 11:11
    These are the current cache param settings:
    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
  • David BetzDavid Betz Posts: 14,516
    edited 2013-10-07 11:25
    These are the current cache param settings:
    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
    Yes those numbers are correct. Basically, cache-param2 is four bytes. The high byte is the SIO0 pin followed by the CLK pin, the flash CS pin, and the SRAM CS pin is the low byte. The numbers after the shift operator just position those values into the appropriate bytes. I think the same expression would work in Spin.
  • jazzedjazzed Posts: 11,803
    edited 2013-10-07 12:04
    Hi 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.
  • David BetzDavid Betz Posts: 14,516
    edited 2013-10-07 12:12
    jazzed wrote: »
    Hi 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.
    Didn't i say that it would only work with the SD card removed? :-)
    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.
  • jazzedjazzed Posts: 11,803
    edited 2013-10-07 12:16
    David Betz wrote: »
    Didn't i say that it would only work with the SD card removed? :-)

    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.
  • David BetzDavid Betz Posts: 14,516
    edited 2013-10-07 12:23
    jazzed wrote: »
    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.
    The C3 driver is for that specific board which is known to have an SD card attached to the SPI bus so it has SD initialization built in. It should probably be optional for the sqi_flash_sram_xcache driver since it may be used on a board that has no SD card. I also said in my earlier message that I intended to add optional support for SD initialization to the sqi_flash_sram_xcache driver that can be enabled when using the qs-hib-pmc configuration.
  • trancefreaktrancefreak Posts: 186
    edited 2013-10-07 12:49
    Hi David and Steve,

    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
Sign In or Register to comment.