Having trouble with SERIN command and MAX6675


Results 1 to 40 of 40

Threaded View

  1. #1
    Join Date
    Dec 2010
    Posts
    48

    Default Having trouble with SERIN command and MAX6675

    Hello again. I'm trying to have a 16f630 receive serial data from a MAX6675. I read the SERIN section in the help topic but I still can't understand how to set it up. here are the datasheets for the chips and my code as well:

    http://www.datasheetarchive.com/pdf-...-301/8892.html

    http://pdf1.alldatasheet.com/datashe...IP/16F630.html

    Code:
    INCLUDE "modedefs.bas"
    
    'Setup MAX6675 - Thermocouple
    MAXData	var    porta.5   ' MAXpin7
    MAXcs	var    porta.4	' MAXpin6
    MAXClock  var    porta.2  ' MAXpin5
    
    MAXResult var word
    THC	var word	' degrees Celsius (* power of 10)
    THF	var word    'stores degrees F
    
    Main:
    
      low MAXcs	' select chip
      serin maxdata, N2400,maxclock, [MAXResult\16]	' get data
      high MAXcs	' start new data apture
       
    THC= (MAXResult/32) ' Deg. C
    THF= (((THC*18)/10)+32) 'Conversion to Deg. F
    
    lcdout $fe, 1
    lcdout "Temperature: ", dec THF, "F"] 'display temp. on LCD
    
    pause 20 'give time between read cycles for MAX6675 to work right
    
    goto Main
    Last edited by emerson; - 10th December 2010 at 04:32.

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