4 mhz program speed in pic 18f4550 please


Results 1 to 5 of 5

Threaded View

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

    Default Re: 4 mhz program speed in pic 18f4550 please

    but max6675 demand 4,3 mhz max to have the correct communication
    Nope, the 6675 will work just fine with a MCU running at 48MHz.

    Here are some snippets.
    Code:
    DEFINE OSC 48
    @ __CONFIG   _CONFIG1L, _PLLDIV_1_1L & _CPUDIV_OSC1_PLL2_1L & _USBDIV_2_1L
    @ __CONFIG   _CONFIG1H, _FOSC_HSPLL_HS_1H
    @ __CONFIG    _CONFIG2H, _WDT_OFF_2H & _WDTPS_512_2H
    @ __CONFIG    _CONFIG3H, _PBADEN_OFF_3H & _MCLRE_OFF_3H 
    @ __CONFIG    _CONFIG4L, _LVP_OFF_4L & _ICPRT_OFF_4L &_XINST_OFF_4L 
    
    'Alias pins - MAX6675 temp sensor
    MXSCLK  VAR     PORTA.0   'Clock
    MXCS    VAR     PORTA.1    'Chip Select
    MXSO    VAR     PORTA.2   'Serial out
    
    
    'Read the 6675
    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
    I also deleted your other post as it is a duplicate of this one. No need to double post.
    Last edited by mackrackit; - 12th December 2011 at 00:57.
    Dave
    Always wear safety glasses while programming.

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