OWOUT Glitch


Results 1 to 8 of 8

Thread: OWOUT Glitch

Threaded View

  1. #1

    Default OWOUT Glitch

    I'm using a PIC18F2680 at 32mhz

    I'm struggling with communicating with a DS18B20 sensor.

    I plugged my Saleae Logic analyser into the system and can see there is a glitch in the OWOUT $33 rom command at about 2.2ms.
    So the result is garbage..

    The DS18B20 does respond to the reset request though just prior to the above.

    Code:
    DEFINE OSC 32           '8mhz Clock (x4 = 32mhz)
    OSCCON = %01110000      'Internal 32 mhz Osc and stable 
    OSCTUNE = %01000000     'Enable PLL 8mhz x 4 
    WDTCON = %00010101		'Set watchdog Timer for 1 second 
    CCP1CON= %00001100		'CCP1 Module PWM Mode
    HLVDCON= %00000000		'HLVCON Disabled
    T1CON  = %00110000		'$30 = Prescaler 1:8, TMR1 OFF	
    TRISA = %00000011 		'SET PORTA0.1,2 AS INPUT, REST AS OUTPUTS
    TRISB = %00001000 		'SET PORTB.3 AS INPUT REST AS OUTPUTS
    TRISC = %10000000 		'SET PORTC.7 AS INPUT REST AS OUTPUTS	
    
    DQ          var PORTC.4     'One-wire Data-Pin "DQ" on PortC.4
    
    
    MainLoop:
     
        OWOUT DQ, 1, [$33]  ' Issue Read ROM command
        OWIN DQ, 0, [STR ID\8]' Read 64-bit device data into the 8-byte array "ID"
        lcdout LCM,LCL,LCM,L12,"Fam ",HEX2 ID[0],"h"
        lcdout LCM,L22,"Ser ",HEX2 ID[1],HEX2 ID[2],HEX2 ID[3],HEX2 ID[4],HEX2 ID[5],HEX2 ID[6],"h"
        lcdout LCM,L32,"CRC ",HEX2 ID[7],"h"
        PAUSE 500         '500ms second pause, replace sensor for next read
        lcdout LCM,LCL       
    
    goto MainLoop
    Name:  ds18b20.jpg
Views: 225
Size:  131.6 KB

    See the weird glitch in the $33 bits being sent..

    Any ideas.
    Last edited by retepsnikrep; - 16th April 2022 at 19:54.

Similar Threads

  1. NCO Glitch
    By mpgmike in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 19th December 2017, 15:30
  2. OWIN - OWOUT problem
    By ozarkshermit in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 7th November 2011, 19:22
  3. Owin / owout
    By pyrogeek in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 3rd September 2011, 09:08
  4. help on OWIN and OWOUT fucntion
    By eddy45 in forum Code Examples
    Replies: 3
    Last Post: - 10th September 2010, 11:04
  5. can i slowdown owin and owout
    By Eugen in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 29th January 2005, 22:17

Members who have read this thread : 2

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