HX711 driver code


+ Reply to Thread
Results 1 to 5 of 5
  1. #1
    Join Date
    Jan 2018
    Posts
    1

    Red face HX711 driver code

    Hi

    I have 18F452 pic . I want to use HX711 chip with 18F452 . I searched example code on the internet . But I cant find the example code that is written by pic basic

    Please help me

  2. #2
    Join Date
    Jan 2011
    Location
    Harare
    Posts
    5

    Default Re: HX711 driver code

    Hello Povulon,

    Did you had any luck with the HX711 code?
    Regards,

    Yves

  3. #3
    Join Date
    Feb 2013
    Posts
    730

    Default Re: HX711 driver code

    And now I have the same question

  4. #4
    Join Date
    Sep 2009
    Posts
    716

    Default Re: HX711 driver code

    You can try this:

    Code:
     Hx711Cnt var Word
     I var Byte
     GraM var word
     GraMM var word
     SigN var byte
     
    Symbol dataa = PORTB.2
    Symbol clock = PORTB.3   
    input dataa
    output clock
    
    I=0
    LoadCellA:
     dataa = 1:clock = 0: Hx711Cnt = 0
     While dataa = 1 : Wend
     For i = 0 To 15
       High clock
       Hx711Cnt = Hx711Cnt <<1
       Low clock
       if dataa=1 then Hx711Cnt=Hx711Cnt+1
     Next
     High clock
     Hx711Cnt = Hx711Cnt^32768
     gram=32768-Hx711Cnt
     'gram=gram-65477' zero
     IF gram.15 THEN  'negative values
         gram = ~gram + 1
         Sign = "-" 
      else
         Sign=" "   
      ENDIF 
    
    disable  
    gram=gram*11627   'scale values
    gramm=div32 10000 
     enable
    
     LCDOUT $FE, 1 
     LcdOut $FE,$80, "Tara=",sign,dec(gramm)
     pause 100
    GoTo LoadCellA
    end
    EDIT: Not my code, but I helped to make it work...
    Last edited by pedja089; - 27th April 2021 at 15:03.

  5. #5
    Join Date
    Feb 2013
    Posts
    730

    Default Re: HX711 driver code

    Thanks, will give it a try!

Similar Threads

  1. Replies: 14
    Last Post: - 1st October 2012, 10:13
  2. MOSFET driver
    By showtime in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 21st October 2007, 22:07
  3. i need driver code for infineon's sle4428
    By steve_st23 in forum General
    Replies: 1
    Last Post: - 5th March 2006, 17:20
  4. 7-Segment Driver
    By NavMicroSystems in forum Off Topic
    Replies: 0
    Last Post: - 13th April 2005, 14:50
  5. Driver code for 14 segment LED display
    By Durward Searcy in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 12th December 2004, 20:08

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts