One-Wire Timing Using PLL


Closed Thread
Results 1 to 8 of 8
  1. #1

    Default One-Wire Timing Using PLL

    I have a circuit that is reading 5 DS18B20 temp sensors at 16MHz (4 MHz x 4 PLL). The circuit works fine until I pop in a 10 MHz crystal then I lose the sensor that is running on parasite power. Is there some timing that needs to be modified in the owin and owout commands? I tried a totally different circuit and it works fine so I know the configuration setup is alright.

  2. #2
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    what about your Config Fuses? Did you redefine the osc => DEFINE OSC 40?

    There's no special timing balahblah for the OWIN/OWOUT
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  3. #3


    Did you find this post helpful? Yes | No

    Default

    Yep, did that. Here's the top of the code.

    Code:
    DEFINE  LOADER_USED 1   ' Bootloader is being used
    DEFINE  OSC 40          ' Set oscillator frequency, 4MHz (HS_PLL x4)
    DEFINE  HSER_BAUD 9600  ' Baud rate for serial output
    DEFINE  HSER_CLROERR 1  ' Automatically clear over-run errors
    DEFINE  HSER_RCSTA 90h	' Enable USART receive
    DEFINE  HSER_TXSTA 24h	' TXSTA=%00100100. TX enable, BRGH=1 for high-speed
    
        DEFINE  LCD_DREG  PORTD
        DEFINE  LCD_DBIT  4
        DEFINE  LCD_RSREG PORTC
        DEFINE  LCD_RSBIT 0
        DEFINE  LCD_EREG  PORTC
        DEFINE  LCD_EBIT  1
        DEFINE  LCD_BITS  4
        DEFINE  LCD_LINES 2
    
    @ __CONFIG _CONFIG1H, _OSCS_OFF_1H & _HSPLL_OSC_1H
    ' Oscillator Switch Disable
    ' Oscillator Type HS PLL    
     
    @ __CONFIG _CONFIG2L, _BOR_ON_2L & _PWRT_ON_2L & _BORV_45_2L
    ' Brown-Out Reset Enabled
    ' Power-Up Timer Enable
    ' Brown-Out Reset Voltage 4.5V
    
    @ __CONFIG _CONFIG2H, _WDT_ON_2H 
    ' Watch Dog Timer Enable
    
    @ __CONFIG _CONFIG4L, _STVR_ON_4L & _LVP_OFF_4L & _DEBUG_OFF_4L
    ' Stack Over/Underflow Reset Enable
    ' Low Voltage ICSP Programming Disabled
    ' Background Debugger Disabled

  4. #4
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    Config fuse will never be programmed with the BOOTLOADER so remove them.

    Be sure you used the PLL version of the BOOTLOADER and you set the config fuse at programming time before loading the Booloader firmware and it's suppose to work As IS.
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  5. #5


    Did you find this post helpful? Yes | No

    Default

    The config fuses are there so I don't forget to add them in when I program them using the ME Labs serial programmer. I used the PLL David Barker sent me and it works fine on other programs but this one is giving me grief for some reason. It only seems to effect the parasite powered sensor though. If I run a three wire connection it works fine.

  6. #6
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    mmm, as it worked with a 4MHZ, i'll bet on a hardware problem now. something like a lack of supply filtering. Placing 0.1uF capacitor close to each sensor and close to each IC + couple of 10uF tantalum could fix it.

    Did you monitor the supply line???


    No problem with the LCD???

    But i've never tested OWIN/OUT @40MHZ so... i can just bet on few things.
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  7. #7


    Did you find this post helpful? Yes | No

    Default

    Well I tried the caps thing and the same result. I then again tried the parasite power right on the board and it worked fine so that got me thinking about the 4.7k pull-up on the data line. I thought that maybe the resistance was a little too high so I tried a 2.2k and low and behold, it can to life. What I don't really understand though is why the difference when I switched between the 4 and 10 MHz crystals.

  8. #8
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    Well all i can say, using the PLL the difference is 24MHZ. The problem would be the same with some I2C device at high SCL frequency. Some datasheet will suggest 1.8K for high frequency and 4.7K for lower frequency.
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

Similar Threads

  1. Need Single wire serial LCD converter example
    By polymer52 in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 16th December 2009, 02:30
  2. 18F4520 and internal osc & PLL
    By pwhitt in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 15th September 2008, 06:38
  3. 16F628 and LMX2306 PLL loading.. help
    By kessral in forum mel PIC BASIC Pro
    Replies: 13
    Last Post: - 11th June 2008, 17:03
  4. Pll?
    By atwoz in forum General
    Replies: 2
    Last Post: - 19th December 2007, 10:20
  5. RPM with wire and PIC
    By Dwayne in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 14th December 2004, 20:42

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