Control BH1415 with a 16f88


Results 1 to 10 of 10

Threaded View

  1. #3
    Join Date
    Jul 2003
    Posts
    2,405


    Did you find this post helpful? Yes | No

    Default

    Try this;
    Code:
    i       var byte
    j       var byte
    setfreq var byte
    PBOUT   var PORTB  ' my assumption here. have no idea what PBOUT is.
    TRISB = 0              ' not sure if this is what you need, but..
    
    Main:
         gosub write_to_chip
         goto Main
    
    write_to_chip:
         PBOUT = PBOUT | 1
         
         for j = 0 to 10
            @ nop
         next j
    
         for i = 0 to 15
            lookup i,[1,0,1,1,1,1,1,1,1,1,0,1,0,0,1,0],setfreq
    
            if setfreq = 1 then
               PBOUT = PBOUT | 4
            else
               PBOUT = PBOUT & $FB
            endif
            
            for j = 0 to 10
               @ nop
            next j
    
            PBOUT = PBOUT | 0x02;
    
            for j = 0 to 10
               @ nop
            next j
    
            PBOUT = PBOUT & $FD
         next i
    
         PBOUT = PBOUT & $FE
         RETURN
    You could probably replace the j loops & nops with pauseus x if you knew the
    time delay required for x.
    Last edited by Bruce; - 7th July 2007 at 22:35.
    Regards,

    -Bruce
    tech at rentron.com
    http://www.rentron.com

Similar Threads

  1. How do I give a radio control car autonomous control
    By Kenjones1935 in forum General
    Replies: 190
    Last Post: - 17th January 2010, 16:40
  2. Problem with 16f88 steep motor control
    By ken_23 in forum Off Topic
    Replies: 0
    Last Post: - 4th July 2008, 13:25
  3. Control unlimited servos at the same time
    By mrx23 in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 19th September 2006, 15:14
  4. Stepper motor control using PIC 16F88
    By tonykeys in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 3rd February 2006, 21:09
  5. Control RC servo via Parallax Servo Control
    By cibotsan in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 17th September 2005, 09:18

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