• AVR Freaks

Hot!Does SRAM SQI mode library exist on C ?

Author
Kabak
Starting Member
  • Total Posts : 81
  • Reward points : 0
  • Joined: 2014/07/30 03:47:55
  • Location: 0
  • Status: offline
2019/11/12 10:44:44 (permalink)
0

Does SRAM SQI mode library exist on C ?

Any SQI C library for example for 23LC1024 ?
#1

13 Replies Related Threads

    Kabak
    Starting Member
    • Total Posts : 81
    • Reward points : 0
    • Joined: 2014/07/30 03:47:55
    • Location: 0
    • Status: offline
    Re: Does SRAM SQI mode library exist on C ? 2020/01/13 12:13:55 (permalink)
    4 (1)
    I did it in software (PIC18F26K22). But if you use MCU pins compatible with MSSP SPI it will slow down SQI mode twice compared to MSSP SPI.
    #2
    NKurzman
    A Guy on the Net
    • Total Posts : 18245
    • Reward points : 0
    • Joined: 2008/01/16 19:33:48
    • Location: 0
    • Status: offline
    Re: Does SRAM SQI mode library exist on C ? 2020/01/13 16:46:40 (permalink)
    0
    Do you mean Bit Banging SQI?  Or SQI with a HW Peripheral?  You would need to start with a PIC with SQI for H/W.
    The PIC32MZ is available with H/W SQI.
    #3
    Kabak
    Starting Member
    • Total Posts : 81
    • Reward points : 0
    • Joined: 2014/07/30 03:47:55
    • Location: 0
    • Status: offline
    Re: Does SRAM SQI mode library exist on C ? 2020/01/13 22:03:12 (permalink)
    0
    I know that PIC18 does not support hardware SQI mode interfacing SPI devices. Just wanted to test SQI speed interfacing SRAM.
    #4
    ric
    Super Member
    • Total Posts : 25493
    • Reward points : 0
    • Joined: 2003/11/07 12:41:26
    • Location: Australia, Melbourne
    • Status: online
    Re: Does SRAM SQI mode library exist on C ? 2020/01/13 22:04:25 (permalink)
    4 (1)
    Kabak
    Just wanted to test SQI speed interfacing SRAM.

    With what?
    If you don't have the hardware, there's no way you can get the full speed with bit-banging.
     

    I also post at: PicForum
    Links to useful PIC information: http://picforum.ric323.co...opic.php?f=59&t=15
    NEW USERS: Posting images, links and code - workaround for restrictions.
    To get a useful answer, always state which PIC you are using!
    #5
    Kabak
    Starting Member
    • Total Posts : 81
    • Reward points : 0
    • Joined: 2014/07/30 03:47:55
    • Location: 0
    • Status: offline
    Re: Does SRAM SQI mode library exist on C ? 2020/01/14 00:06:26 (permalink)
    0
    I supposed that software SQI mode speed will be better because 4 bits passed simultaneously. But if use MSSP for SPI and switch to software SQI,  swap bits 2 & 3 required , because SDI -> SDO, SDO -> SDI. Thats take software time.
    post edited by Kabak - 2020/01/14 00:12:30
    #6
    ric
    Super Member
    • Total Posts : 25493
    • Reward points : 0
    • Joined: 2003/11/07 12:41:26
    • Location: Australia, Melbourne
    • Status: online
    Re: Does SRAM SQI mode library exist on C ? 2020/01/14 00:52:22 (permalink)
    4 (1)
    Kabak
    I supposed that software SQI mode speed will be better because 4 bits passed simultaneously.

    Better than what?
    It's still going to be an order of magnitude slower than doing it with SQI hardware.
     
     

    I also post at: PicForum
    Links to useful PIC information: http://picforum.ric323.co...opic.php?f=59&t=15
    NEW USERS: Posting images, links and code - workaround for restrictions.
    To get a useful answer, always state which PIC you are using!
    #7
    Kabak
    Starting Member
    • Total Posts : 81
    • Reward points : 0
    • Joined: 2014/07/30 03:47:55
    • Location: 0
    • Status: offline
    Re: Does SRAM SQI mode library exist on C ? 2020/01/14 04:07:50 (permalink)
    0
    Better than what?

     
    Better than hardware SPI or approximately equal.
    post edited by Kabak - 2020/01/14 04:09:27
    #8
    ric
    Super Member
    • Total Posts : 25493
    • Reward points : 0
    • Joined: 2003/11/07 12:41:26
    • Location: Australia, Melbourne
    • Status: online
    Re: Does SRAM SQI mode library exist on C ? 2020/01/14 04:13:12 (permalink)
    4.5 (2)
    Kabak
    Better than what?

     
    Better than hardware SPI or approximately equal.

    The chip supports SPI with a 20MHz clock.
    Do you think you can do software SQI with a 5MHz clock, including reassembling the bits into a byte?
     

    I also post at: PicForum
    Links to useful PIC information: http://picforum.ric323.co...opic.php?f=59&t=15
    NEW USERS: Posting images, links and code - workaround for restrictions.
    To get a useful answer, always state which PIC you are using!
    #9
    Kabak
    Starting Member
    • Total Posts : 81
    • Reward points : 0
    • Joined: 2014/07/30 03:47:55
    • Location: 0
    • Status: offline
    Re: Does SRAM SQI mode library exist on C ? 2020/01/14 05:51:22 (permalink)
    0
    The chip supports SPI with a 20MHz clock.
    Do you think you can do software SQI with a 5MHz clock, including reassembling the bits into a byte?

    Yes, i think so. If i'll not use PIC18 MSSP module for SPI initiation. ( i'll not need to swap bits )
    post edited by Kabak - 2020/01/14 05:54:15
    #10
    Chris A
    Super Member
    • Total Posts : 847
    • Reward points : 0
    • Joined: 2010/07/20 04:37:07
    • Location: 0
    • Status: offline
    Re: Does SRAM SQI mode library exist on C ? 2020/01/14 07:30:51 (permalink)
    0
    Bits in == Bits out.  No need to swap the actual data bits for an SRAM.  The bits don't mind ;-)  
    However still need to swap commands and address!
    #11
    NKurzman
    A Guy on the Net
    • Total Posts : 18245
    • Reward points : 0
    • Joined: 2008/01/16 19:33:48
    • Location: 0
    • Status: offline
    Re: Does SRAM SQI mode library exist on C ? 2020/01/14 07:32:06 (permalink)
    0
    If Speed is your goal here then you may want to look at ASM.  expecially if you goal is to be faster than HW SPI.
    As far as finding Bit Banged C code for a PIC18, I do not recall it being disused here in the past.
    #12
    jtemples
    عُضْوٌ جَدِيد
    • Total Posts : 11567
    • Reward points : 0
    • Joined: 2004/02/13 12:31:19
    • Location: Southern California
    • Status: offline
    Re: Does SRAM SQI mode library exist on C ? 2020/01/14 11:59:52 (permalink)
    0
    It seems like you could bit-bang SQI pretty fast if you could dedicate an entire output port to it:  LATC = data; pulse clock; SWAPF LATC; pulse clock.
    #13
    Kabak
    Starting Member
    • Total Posts : 81
    • Reward points : 0
    • Joined: 2014/07/30 03:47:55
    • Location: 0
    • Status: offline
    Re: Does SRAM SQI mode library exist on C ? 2020/01/14 14:02:39 (permalink)
    0
    Yes. I did so. But I use MSSP SPI for init SRAM for switch it into SQI mode. That is mistake cause now in SQI i need to swap bit 2 & bit 3 of data every time I pushing or poping SRAM data. Cause SDI 0 -> SRAM SDO  , SDO 0 -> SRAM SDI.
    #14
    Jump to:
    © 2020 APG vNext Commercial Version 4.5