Shop OBEX P1 Docs P2 Docs Learn Events
Help with Mods to HX512 card Driver wnd interface to Demo board (fixed) — Parallax Forums

Help with Mods to HX512 card Driver wnd interface to Demo board (fixed)

Ron SutcliffeRon Sutcliffe Posts: 420
edited 2009-10-18 02:40 in Propeller 1
I have just received a Hydra Extreme 512K , Demo board and micro Sdcard adapter this week, and have set it up so that I can use my·10" laptop running Tera Term (VT100 emulator) instead of a separate Keyboard and VDU. I am looking to use it as a general purpose rig for Emulation, Catalina and Forth.
I have kept the pins 31, 30 available for the standard Serial IO port and pins 0..4 for the SDcard.
Only the following pins have been changed.
· Xmm························· card Prop
·· 19······························ 26 ……….changed from Pin 30
··· 9································ 25………..changed from Pin 1
·· 10······························· 24 changed from Pin 0
I have changed the constants in the standard SPIN Driver to reflect the above changes. I have tested the card via the Spin API, I wrote my own tests and they worked just fine.
This morning I changed HX512KSRAM_ASM_DRV_010 to reflect these changes.
The driver initializes the card and waits in run mode, the 4 Leds are on, (at the top right of the board) and the read LED·is also·on, but I can’t write to the card.


I have made the following changes to the ASM Driver.
CON
SRAM_CTRL_0 = 24 ' NET_RX_CLK (expansion pin 10)
SRAM_CTRL_1 = 25 ' NET_TX_DATA (expansion pin 9)
SRAM_STROBE = 26 ' USB_RXD (Prop TX ----> USB_RXD Host) (expansion pin 19)
 
These contants below are at the end of the Spin wrapper
 
SRAM_DBUS_BIT_SHIFT = 16 
SRAM_CTRL_BIT_SHIFT = 24 ‘ ??????????
SRAM_STROBE_BIT_SHIFT = 26 ‘ Also ???????
 
The Mask are at the end of ASM code Modified
 
SRAM_CTRL_MASK long              %0000_0011_0000_0000_0000_0000_0000_0000
SRAM_DBUS_MASK long              %0000_0000_1111_1111_0000_0000_0000_0000 
SRAM_STROBE_MASK long            %0000_0100_0000_0000_0000_0000_0000_0000
SRAM_DBUS_CTRL_STROBE_MASK long  %0000_0111_1111_1111_0000_0000_0000_0000
nSRAM_CTRL_MASK long             %1111_1100_1111_1111_1111_1111_1111_1111
nSRAM_DBUS_MASK long             %1111_1111_0000_0000_1111_1111_1111_1111 
nSRAM_STROBE_MASK long           %1111_1011_1111_1111_1111_1111_1111_1111
nSRAM_DBUS_CTRL_STROBE_MASK long %1111_1000_0000_0000_1111_1111_1111_1111
 
 
 
Orginal Masks
 
SRAM_CTRL_MASK              long      %0000_0000_0000_0000_0000_0000_0000_0110
SRAM_DBUS_MASK              long      %0000_0000_1111_1111_0000_0000_0000_0000 
SRAM_STROBE_MASK            long      %0100_0000_0000_0000_0000_0000_0000_0000
SRAM_DBUS_CTRL_STROBE_MASK  long      %0100_0000_1111_1111_0000_0000_0000_0110
nSRAM_CTRL_MASK             long      %1111_1111_1111_1111_1111_1111_1111_1001
nSRAM_DBUS_MASK             long      %1111_1111_0000_0000_1111_1111_1111_1111 
nSRAM_STROBE_MASK           long      %1011_1111_1111_1111_1111_1111_1111_1111
nSRAM_DBUS_CTRL_STROBE_MASK long      %1011_1111_0000_0000_1111_1111_1111_1001
 




Sometimes I think its best just to start from scratch, at least then I know whats going on.· [noparse]:([/noparse]

What am I not understanding about this driver ??

BTW I did change(butcher) ·the Xmm Card so it’s interchangable with my own memory card and other stuff , but not recommened. See photo’s

·Ron



Post Edited (Ron Sutcliffe) : 10/18/2009 2:26:16 AM GMT
349 x 238 - 106K
448 x 187 - 50K
431 x 323 - 142K

Comments

  • kuronekokuroneko Posts: 3,623
    edited 2009-10-17 05:00
    That's just from a quick glance at the driver. The commands exist as pre-shifted values (e.g. SRAM_CMD_WRITE_SHIFTED). Those have to be adjusted (you moved the command bits). However, as they are written as a 9bit immediate value you'll have to either add code to take care of that or define those constants as longs in the DAT section (and then do a register write).

    If that doesn't get you going I'll have another look [noparse]:)[/noparse]
  • Ron SutcliffeRon Sutcliffe Posts: 420
    edited 2009-10-17 05:14
    Thanks Kuroneko

    I will go back to it now.

    Pleased to find you lurking. Big [noparse]:)[/noparse] [noparse]:)[/noparse]

    Regards

    Ron
  • Ron SutcliffeRon Sutcliffe Posts: 420
    edited 2009-10-17 08:00
    @Kuroneko

    Hmm, I think I would be better if I was to re-route Xmem Pins 9,10,19 from prop pins 24,25,26 to 5,6,7 respectively and change the Cons and Masks again. This would be easy to do and I would not have to add any extra code, something I want to avoid.

    Would appreciate comments.

    Regards

    Ron
  • kuronekokuroneko Posts: 3,623
    edited 2009-10-17 08:40
    Adding code is just one option. What I'd prefer to do was more along the lines of changing:

            or      outa, #mask_which_now_fits_into_9bit
    
    ' to something more general like
    
            or      outa, cmd_wr
    
    cmd_wr: long    pre_shifted_cmd_pattern_for_write_which_doesn't_fit_into_9bit
    


    So effectively you just add some more data (4 longs) to the driver and you'd have to modify existing instructions. Or you could write your own driver like I did, you may learn something new [noparse]:)[/noparse]

    But you're free to rewire your h/w. If that's easy to do without penalty re: other peripherals then go for it.
  • Ron SutcliffeRon Sutcliffe Posts: 420
    edited 2009-10-18 02:40
    Thanks Kuroneko the ASM driver is fixed. For now the Pins are 16..26··
    Now to write a new API Wrapper so that the HK512K can be configured for any pin group without having to modify the Pin masks.
    Now to look at what heater is up to with CPM, Where to start ???
Sign In or Register to comment.