question about the pin to pin connections on a SPI interface


Closed Thread
Results 1 to 10 of 10

Hybrid View

  1. #1
    Join Date
    Dec 2012
    Location
    Tennessee
    Posts
    262


    Did you find this post helpful? Yes | No

    Default Re: question about the pin to pin connections on a SPI interface

    ok that was way over my head, first it sounded like you have my PIC sending commands out, however this is a thermostat chip sending data to my PIC, there is no control that i have seen it just streams data out over and over from what i can tell. So I think im supposed to use a shiftin? as that was the only word i recognized all the rest of what you said lost me. I can build the circuit just as they have it in the picture, thankfully they have a resolution high enought for me to read the pinouts, but i could use some help on the code for that particular circuit, with the only change being that the chip I am using is a 18f4550. I did find a article that said the SDO should go to SDI and vice versa, but other than that Im lost.

  2. #2
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default Re: question about the pin to pin connections on a SPI interface

    Code:
    'Alias pins - MAX6675 temp sensor
    MXSCLK  VAR     PORTA.0   'Clock
    MXCS    VAR     PORTA.1    'Chip Select
    MXSO    VAR     PORTA.2   'Serial out
    TRISA =%00000000
    DEFINE SHIFT_PAUSEUS 100
    ADCON1 = 15		' All I/O pins digital
    CMCON = 7
    TRISD =%00000000 
     'Allocate MAX6875 Variables
    MXTemp  VAR     WORD    'raw data from 6675/type K sensor
    TempC   VAR     WORD 'BYTE[16]    'converted to degrees C
    TempF   VAR 	WORD
    Code:
    READ_TEMP:
    MXCS = 0  'Chip select low
    shiftin MXSO, MXSCLK, 0, [MXTemp\16]   'read the data to MXTemp
    MXCS = 1    'Chip select high
    TempC = MXtemp >> 5   'right shift the data 5 places to get degrees C (Read the Data sheet)
    TempF = ABS(TempC) */ 461
    TempF = TempF + 32
    Dave
    Always wear safety glasses while programming.

Similar Threads

  1. Need to use SPI but I'm already using the SPI port
    By Christopher4187 in forum mel PIC BASIC Pro
    Replies: 13
    Last Post: - 30th December 2012, 10:52
  2. 5v on analog pin but reads value
    By jmgelba in forum mel PIC BASIC Pro
    Replies: 0
    Last Post: - 9th November 2012, 04:41
  3. VFD pinout and connections
    By rshaver in forum mel PIC BASIC Pro
    Replies: 8
    Last Post: - 26th October 2010, 06:48
  4. lcd with Hserout and a max232 connections? help
    By flipper_md in forum Schematics
    Replies: 6
    Last Post: - 8th March 2008, 16:06
  5. PIC to PIC, How Many IO Connections Required?
    By CocaColaKid in forum Serial
    Replies: 4
    Last Post: - 1st September 2005, 18:16

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