SPI and 18F4550


Closed Thread
Results 1 to 11 of 11

Thread: SPI and 18F4550

Hybrid View

  1. #1
    Join Date
    Oct 2005
    Location
    New Jersey
    Posts
    425


    Did you find this post helpful? Yes | No

    Default Re: SPI and 18F4550

    Henrik,

    You've made it a little clearer for me, thanks. I'm going to work with this today to see if I can get it to work. Something is strange with the demo boards I've received from Microchip. I can't erase the chip and even blinking an LED can be a task. I'm not even sure if the program I'm compiling is even getting to the 18F4550 at certain times. When I make the same circuit on a breadboard it doesn't give me any problems so I may have two issues at the same time, which makes things even more difficult.

    Chris

  2. #2
    Join Date
    Oct 2005
    Location
    New Jersey
    Posts
    425


    Did you find this post helpful? Yes | No

    Default Re: SPI and 18F4550

    I'm getting closer. I couldn't figure out what was going on so I pulled out my scope and it seems pretty clear......at least for this step. This is a picture of the scope with a known good program (I'm using the same board for the working program and my program so I know the hardware is good). Yellow is the data and blue is the CS line.

    Name:  Known working CAN data.jpg
Views: 1586
Size:  528.6 KB

    Now look at the scope with my program:

    Name:  My code transmitting CAN data.jpg
Views: 1563
Size:  505.4 KB

    So my signal looks like it's inverted. They speak about this in the BAUDCON, TXSTA and RXSTA settings but I tried adjusting them and it didn't help. Any ideas?

    EDIT - It was under the SSPSTAT.6. The signal is correct now but still no CAN data. At least I'm getting closer......
    Last edited by Christopher4187; - 10th July 2012 at 18:43.

  3. #3
    Join Date
    Oct 2005
    Location
    Sweden
    Posts
    3,627


    Did you find this post helpful? Yes | No

    Default Re: SPI and 18F4550

    Ok, what exactly are we looking at?
    My guess is the MOSI pin on the PIC (Ch1) and the CS line (Ch2)?

    Without seeing your code it's a bit hard to guess what you're actually doing but what I can say is that BAUDCON, TXSTA and RXSTA (if we're talking about the PIC) are control registers for the USART and has nothing to do with the either the MSSP module or the SHIFTOUT/SHIFTIN - whatever you're actually using. Post the code ;-)

    /Henrik.

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