PIC24 clear SPI slave FIFO


Closed Thread
Results 1 to 9 of 9

Hybrid View

  1. #1
    Join Date
    Jun 2007
    Location
    Mansfield, UK
    Posts
    697

    Default PIC24 clear SPI slave FIFO

    Hi,

    I'm using a PIC24FJ64GA002 chip as an SPI slave with FIFO buffers enabled. It has CLK, MOSI, MISO and SS pins connected.

    The datasheet says:
    "A transmission will be aborted when the SSx pin goes high and may be retried at a later time. Each data word is held in SPIxTXB until all bits are transmitted to the receiver"

    My code only writes to the transmit FIFO while SSx is asserted. If SSx goes high at any point I want the transmit FIFO to be cleared and my code will retry the send later. The question is, how do I clear the entire transmit FIFO and SPIxTXB?

  2. #2
    Join Date
    Dec 2014
    Posts
    1


    Did you find this post helpful? Yes | No

    Default Re: PIC24 clear SPI slave FIFO

    Hi,

    I have a similar problem. Have you already found a solution?


    Best regards

    Tommy Lehmann

  3. #3


    Did you find this post helpful? Yes | No

    Default Re: PIC24 clear SPI slave FIFO

    I'm confused, your using a PIC24 with PICBasic? How so?

    George

  4. #4
    Join Date
    Jan 2005
    Location
    Montreal, Quebec, Canada
    Posts
    3,160


    Did you find this post helpful? Yes | No

    Default Re: PIC24 clear SPI slave FIFO

    He's not. That's why Offtopic.

    Robert

  5. #5
    Join Date
    Jun 2007
    Location
    Mansfield, UK
    Posts
    697


    Did you find this post helpful? Yes | No

    Default Re: PIC24 clear SPI slave FIFO

    Tommy: I never got a definitive answer. My circuits never worked properly and I can't say if it was due to the buffer not clearing or some other bug so in the end I switched to the UART module instead. I prefer SPI for it's use of a clock line but UART won due to it's asynchronous nature which simplified a lot of the code. It's a shame the asynchronous version of SPI doesn't work in my chips.

    George: I always use MPASM for PIC10/12/16/18 and ASM30 for PIC24. This question was about the PIC itself though so the language doesn't really matter (and, as Robert said, is why it's posted in Off Topic)

  6. #6
    Join Date
    Jan 2005
    Location
    Montreal, Quebec, Canada
    Posts
    3,160


    Did you find this post helpful? Yes | No

    Default Re: PIC24 clear SPI slave FIFO

    Off on a tangent, can you give your impression of ASM30, the costs of using it (software/hardware)?

    I remember branch register and that's it from college. It's been bugging me to get back in asm ever since I saw some asm in this forum.

    Robert
    Last edited by Demon; - 14th December 2014 at 03:31.

Similar Threads

  1. Key fifo
    By longpole001 in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 30th March 2014, 02:21
  2. VDIP used in FIFO mode
    By Jacques in forum General
    Replies: 0
    Last Post: - 18th May 2010, 10:19
  3. pic24 beginner
    By robertpeach in forum General
    Replies: 23
    Last Post: - 13th August 2009, 11:57
  4. Does CLEAR Command clear return adrress of a subroutine?
    By sayzer in forum mel PIC BASIC Pro
    Replies: 14
    Last Post: - 19th February 2008, 16:25
  5. Need Help with PIC as SPI Slave
    By PICtron in forum Serial
    Replies: 3
    Last Post: - 16th August 2005, 19:34

Members who have read this thread : 0

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts