cc2500/pic18f2420 question


Closed Thread
Results 1 to 2 of 2
  1. #1
    adamsje's Avatar
    adamsje Guest

    Default cc2500/pic18f2420 question

    I've searched CC1100 and CC2500 and didn't find anything on this subject. My apology if I missed it.

    My understanding of the CC2500 is that when an address or data is shifted into the CC2500, the CC2500 status is simultaneously shifted out. I can see this on a scope. The 18F2420 data sheet seems to show that data can be shifted into the SSPSR reg simultaneosly as data is shifted out. The data sheet also says that data in the SSPSR reg can be accessed by reading the SSPBUF reg. I'm using the PBP SHIFTOUT command and loading a variable from SSPBUF after a few usec delay. My problem is that what I read from SSPBUF is NOT what I see going into the SDI pin.

    I've checked the errata sheets and have found nothing that sees to apply.

    Any explanation would be appreciated.

  2. #2
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959


    Did you find this post helpful? Yes | No

    Default

    If you want to use the MSSP, (Master Synchronous Serial Port) to receive data simultaneously while sending, then you should let the MSSP do them both.

    It'll be a lot simpler.
    This example might help, but it doesn't take the CC2500 into account, since I've never seen one ...
    Code:
    SDI    VAR PORTC.4       ; Data IN Pin for 18F2420
    SDO    VAR PORTC.5       ; Data OUT
    SCK    VAR PORTC.3       ; Clock 
    
    BF     VAR SSPSTAT.0     ; Buffer Full Flag
    CKE    VAR SSPSTAT.6     ; SPI Clock Select bit
    TXbyte VAR BYTE          ; Byte to Send
    RXbyte VAR BYTE          ; Received Byte
    
    SSP_Init:
        LOW   SCK            ; Start with clock and data out (OUTPUT LOW)
        LOW   SDO
        INPUT SDI            ; Input is already Default, but just in case
        CKE = 1              ; Transmit occurs on transition from 
                             ;   active to Idle clock state
        SSPCON1 = %00100010  ; Enable MSSP, SPI Master, CLK idles low, FOSC/64 clk
    ;_____________________________________________________________________________
    
    Main:
        TXbyte = $69
        GOSUB SendReceive
        ; at this point, RXbyte will hold the byte that was shifted in at
        ;   the same time TXbyte was shifted out
        PAUSE 1000
    GOTO Main
    
    SendReceive:
        SSPBUF = TXbyte
        REPEAT : UNTIL (BF = 1)   ; wait for MSSP to finish shifting
        RXbyte = SSPBUF
    RETURN
    HTH,
    DT

Similar Threads

  1. ADCIN question
    By Greg McFadden in forum General
    Replies: 4
    Last Post: - 16th September 2008, 02:53
  2. Crystals & Caps - Super noob question??
    By kevj in forum General
    Replies: 4
    Last Post: - 24th September 2007, 17:11
  3. Question for a math guru
    By Christopher4187 in forum General
    Replies: 3
    Last Post: - 22nd November 2006, 09:45
  4. Please answer my first question
    By John_001 in forum Off Topic
    Replies: 1
    Last Post: - 15th September 2006, 06:49
  5. Timer / CCP Question
    By jamie_s in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 2nd November 2005, 08:22

Members who have read this thread : 1

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