Anyone know about this PIC?


Closed Thread
Results 1 to 16 of 16

Hybrid View

  1. #1
    Join Date
    May 2004
    Location
    NW France
    Posts
    3,653


    Did you find this post helpful? Yes | No

    Wink

    Hi, Karen

    just some lines to see ... ( it's for a 18F452 ! )

    Code:
    '*****************************************************************************
    '*****************************************************************************
    'Config processeur
    '*****************************************************************************
    '
    
    '@  __CONFIG    _CONFIG1L, _WDT_OFF_1L & _WDTPS_128_1L
    @   __CONFIG    _CONFIG1H, _OSCS_OFF_1H & _XT_OSC_1H
    @	__CONFIG	_CONFIG2L, _BOR_OFF_2L & _BORV_27_2L & _PWRT_ON_2L
    @   __CONFIG    _CONFIG2H, _WDT_OFF_2H & _WDTPS_128_2H
    '@  __CONFIG    _CONFIG3L, _WDT_OFF_3L & _WDTPS_128_3L
    @   __CONFIG    _CONFIG3H, _CCP2MX_OFF_3H
    @   __CONFIG    _CONFIG4L, _STVR_OFF_4L & _LVP_OFF_4L & _DEBUG_OFF_4L
    '@  __CONFIG    _CONFIG4H, _WDT_ON_4H & _WDTPS_128_4H
    @   __CONFIG    _CONFIG5L, _CP0_OFF_5L & _CP1_OFF_5L & _CP2_OFF_5L & _CP3_OFF_5L
    @   __CONFIG    _CONFIG5H, _CPB_OFF_5H & _CPD_OFF_5H
    @   __CONFIG    _CONFIG6L, _WRT0_OFF_6L & _WRT1_OFF_6L & _WRT2_OFF_6L & _WRT3_OFF_6L
    @   __CONFIG    _CONFIG6H, _WRTC_OFF_6H & _WRTB_OFF_6H & _WRTD_OFF_6H 
    @   __CONFIG    _CONFIG7L, _EBTR0_OFF_7L & _EBTR1_OFF_7L & _EBTR2_OFF_7L & _EBTR3_OFF_7L
    @   __CONFIG    _CONFIG7H, _EBTRB_OFF_7H 
    
    '*****************************************************************************
    'Config TIMERs
    
    T0CON = %00000010	' 16Bits 1/8 prescaler, Horloge Système, OFF
    
    T1CON = %00001010	'1/1 prescaler, Quartz 32,768
    
    T3CON = %01110001	' ccp SUR TMR3,1/8 prescaler,Horloge système,ON
    
    '*****************************************************************************
    'Config CCP1 arret CCP2
    
    CCP1CON = %00000101	' Capture sur front montant 
    
    CCP2CON = %00000000	'inhibition module CCP2
    
    '*****************************************************************************
    'Inhibition SSP
    
    SSPCON1.5 = 0
    
    '*****************************************************************************
    'Config Interruptions
    
    INTCON  = %10000000
    INTCON2 = %11110000
    INTCON3 = %00000000
    
    PIE1    = %00000100
    PIE2    = %00000000
    
    IPR1    = %00000001
    IPR2	= %00000000
    
    RCON	= %10000000
    
    '*****************************************************************************
    'Config ADC
    '*****************************************************************************
    
    ADCON0 = %11000000
    ADCON1 = %10000011
    
    '*****************************************************************************
    '*****************************************************************************
    'Config et Prepositionnement E/S
    '*****************************************************************************
    
    PORTA	= %00000000
    PORTB 	= %00000100
    PORTC	= 0
    PORTD	= 0
    PORTE	= 0
    
    TRISA 	= %00111111
    TRISB	= %11100110
    TRISC	= %00000111
    TRISD	= %00000000
    TRISE	= %00000000
    '
    It's for a gadget that measures Hours of work ( total and split ), batt voltage, RPM, water and oil temp, and oil pressure.
    Also logs the maxima, alerts if thresolds reached, and shows programmed maintenance needed ...

    ...

    Alain
    ************************************************** ***********************
    Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
    ************************************************** ***********************
    IF there is the word "Problem" in your question ...
    certainly the answer is " RTFM " or " RTFDataSheet " !!!
    *****************************************

  2. #2
    Join Date
    Mar 2008
    Posts
    79


    Did you find this post helpful? Yes | No

    Smile

    Your a star Thats almost exactly what I was after as i wont be using anything on the pic other than straight digital inputs and outputs, not using any of the "fancy function"
    Its basically going to be 3 inputs that go high a number of outputs that go high or low depending on the inputs, an lcd display connected to it, and a DS18B20 temp sensor.
    Oh quick question I'm pretty sure the answer is yes but can you directly substitute a DS18B20 - PAR (parasitic takes it's power from DQ pin) the with a 18B20 just by leaving the other pin unconnected?
    Last edited by karenhornby; - 21st May 2008 at 18:08.

  3. #3
    Join Date
    May 2006
    Location
    Del Rio, TX, USA
    Posts
    343


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by karenhornby View Post
    ... can you directly substitute a DS18B20 - PAR (parasitic takes it's power from DQ pin) the with a 18B20 just by leaving the other pin unconnected?
    Not quite clear on which one you plan to substitude for which, so here is the answer either way:

    Yes, you can use a DS18B20 to replace a DS18B20-PAR without problems, just connect Pin 3 (Vdd) to your power supply.

    No, you can not use a DS18B20-PAR to replace a DS18B20 unless you modify the circuit. The reason is that the PAR version requires a "strong pullup" during temp conversion. Page 3 "Parasite Power", and figure 2, of the DS18B20-PAR data sheet has the details. If the number of PAR units is small, you can (I have) eliminate the MOSFET they suggest and just hook it directly to a pin to drive it, as the total current is well below the 25ma limit of a single PIC pin.

    HTH,
    SteveB

Similar Threads

  1. SMS via pic
    By kenandere in forum GSM
    Replies: 15
    Last Post: - 10th March 2010, 10:00
  2. Replies: 67
    Last Post: - 8th December 2009, 02:27
  3. HSERIN & Interupts (aka controlling PIC programs from a remote PC)
    By HankMcSpank in forum mel PIC BASIC Pro
    Replies: 16
    Last Post: - 17th June 2009, 14:46
  4. pic to pic ir link versus wired link : help please anyone
    By xnihilo in forum mel PIC BASIC Pro
    Replies: 13
    Last Post: - 30th May 2008, 21:01
  5. Serial Pic to Pic using HSER
    By Chadhammer in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 11th March 2005, 23:14

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