12F509 / 609 IR and speed control


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

    Question 12F509 / 609 IR and speed control

    Hello All,

    I have the 12F509 set up to interpret IR commands. It decodes 2 bytes and latches the correct logic to the ports to drive an H-bridge (driving a tiny pager motor). I would like to have at least 5 speed levels, but the problem I see is the serial 2 bytes that would essentially steal mcu time (sent across every 20ms @ 1200 bps). Since this body has no hardware (serial or PWM) everything needs to run at 4 Mhz. What is the best way to do this with the 509?

    Any help would be appreciated.

    Nick

  2. #2
    Join Date
    Sep 2005
    Location
    Campbell, CA
    Posts
    1,107


    Did you find this post helpful? Yes | No

    Default

    First, I think it would be a lot easier if you chose a PIC with a real RS-232 port, but -

    one way would be to set up a 416uSec interrupt, (one half bit time at 1200 baud) and then use a slight variation of one of the assembly bit-banging routines. An example can be found at

    http://www.winpicprog.co.uk/pic_tutorial7.htm


    The big problem is catching the first negative-going transition of the START bit on receive. You will need to connect the RxD line to a pin that has an
    interrupt-on-change function.
    Charles Linquist

Similar Threads

  1. how to get pic to pic communication
    By kinsiro in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 30th August 2005, 17:12

Members who have read this thread : 1

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