Bit Banging input to output on PIC16F876A


Closed Thread
Results 1 to 13 of 13

Hybrid View

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


    Did you find this post helpful? Yes | No

    Default

    Melanie,

    I would love to see an example of how this works. It would be really nice for sending IR serial
    data modulated at 38-40kHz.
    Regards,

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

  2. #2
    Join Date
    Jul 2003
    Posts
    2,358


    Did you find this post helpful? Yes | No

    Default

    Give me a couple of days Bruce to find some spare time and throw an example together - I'll post it here... watch this space...

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


    Did you find this post helpful? Yes | No

    Default

    7 days a week, 24 hours a day, you only work 120 hours a week... so you still have spare time huh?

    I see what's you're cooking. I've used something like that in the past... before i lost everything on my hard drive

    I remember that i also modified SEROUT routine... and it also remember me something that Darrel already did here... i'll search for it now.
    Last edited by mister_e; - 26th May 2008 at 22:37.
    Steve

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

  4. #4
    Join Date
    Jul 2003
    Posts
    2,405


    Did you find this post helpful? Yes | No

    Default

    I've tried what Melanie mentioned, but could never get it to work properly when changing
    Vref with another I/O-pin.
    Regards,

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

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


    Did you find this post helpful? Yes | No

    Default

    Probably where...
    ... and almost no software overhead...
    came from.

    2 diodes, 1 resistor build a cheap AND gate... without code overhead.

    <hr>
    EDIT: smells like the comparator input change, then within the ISR you perform the AND function.
    Last edited by mister_e; - 27th May 2008 at 22:00.
    Steve

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

  6. #6
    Join Date
    Mar 2003
    Location
    Commerce Michigan USA
    Posts
    1,166


    Did you find this post helpful? Yes | No

    Default

    Bronurstomp, Why even involve hardware as the ccp module inside the pic can do the work for you. Just set the period and pwm of the ccp module at 38khz. and set the ccpl value to 50 % or 0%. I have been doing this for the last 5 years in the development of the tire pressure lf transmissions at 125 khz...

    Dave Purola,
    N8NTA

  7. #7
    Join Date
    Feb 2006
    Posts
    21


    Did you find this post helpful? Yes | No

    Default Some clarification

    I guess I wasn't very clear about what I want to know. I'm holding back some info because this circuit may be very valuable.
    Presently, I have the 2 HPWM outputs going to a quad 2-input AND gate with the other 4 digital outputs used for "steering" the 2 PWMs to 2 places each. They are the forward and reverse speed control of two motor control H-Bridges. PWM ANDED.JPG
    This circuit works fine. I want to eliminate the 4 AND gates, thus the chip and caps from my PCB. See Un ANDED PIC.JPG
    The question is about the PICBASIC PRO syntax.
    PORTB.6 = PORTA.2 AND PORTB.2
    Will this syntax work assuming the PIC is producing 2 varying duty cycle PWMs at 3KHZ, hard wire connected to general purpose digital inputs?
    PORTA.2 tied to HPWM1, and PORTA.3 tied to HPWM2 (Pin 12-4 and Pin 13-5)
    I get no errors when compiling, but I have no way to test the hardware.

    Thanks!
    Attached Images Attached Images   
    The less you expect, the more you get.

Similar Threads

  1. PICBasic newbie problem
    By ELCouz in forum mel PIC BASIC Pro
    Replies: 32
    Last Post: - 12th February 2008, 01:55
  2. Timing input pulses and re-outputting them
    By jamie_s in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 28th February 2007, 02:50
  3. Serious Serial Situation Setbacks...
    By Dansdog in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 7th February 2007, 04:46
  4. Using LEDs as light sensors
    By skimask in forum Code Examples
    Replies: 3
    Last Post: - 30th December 2006, 23:19
  5. Can anyone help a beginner in a struggle?
    By douglasjam in forum mel PIC BASIC
    Replies: 1
    Last Post: - 6th May 2005, 00:29

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