Shop OBEX P1 Docs P2 Docs Learn Events
Extreamly simple PIC ideas? — Parallax Forums

Extreamly simple PIC ideas?

JomsJoms Posts: 279
edited 2010-05-05 03:30 in General Discussion
I have a project that I would ideally like to take a USB input and turn it into a BCD signal outputing only 1,2,4 (3 pins of data).· Currently I am using a USB to Serial FT232 IC and a prop to do this simple task.

I assume I would still need the USB to Serial IC, but does anyone have any ideas for a cheep and easy processor to just turn a serial data bit into a bcd code?

I use the prop for a ton of things, and it works great, but in this application I want to keep it simple and use just 5v+ from the usb (no second 3.3 regulator), no crystal, no eeprom, etc.

Ideas anyone?

(just if anyone is wondering, with the BCD code I am trying·to control a audio switch to switch between 5 mono audio sources)

Comments

  • LeonLeon Posts: 7,620
    edited 2010-04-30 23:26
    A USB PIC like the PIC18F2455 is one way. See this project of mine:

    www.leonheller.com/usb/

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Leon Heller
    Amateur radio callsign: G1HSM
  • JomsJoms Posts: 279
    edited 2010-04-30 23:29
    Great!, I think...

    How do you program it? Really the only experience I have with PIC's is the Prop and Stamp. Does it use the same type of software? Where could I find more info on something like this? Is it something I could use the PIC to actually switch the audio also, or do I need and external IC yet?

    Thanks for the help so far!

    Post Edited (Joms) : 4/30/2010 11:43:23 PM GMT
  • LeonLeon Posts: 7,620
    edited 2010-04-30 23:45
    It's programmed using MPLAB, available from Microchip. A C compiler for the PC will also be needed.

    You will need another device such as an analogue switch to do the actual switching, of course.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Leon Heller
    Amateur radio callsign: G1HSM
  • JomsJoms Posts: 279
    edited 2010-05-01 00:12
    OK...Thanks Leon... Im just going thru your instructions 1 line at a time trying to figure out how to program on this. I am guessing it can't be that hard to figure out, but I might be wrong...
  • LeonLeon Posts: 7,620
    edited 2010-05-01 00:36
    Although I've tried to make it as straightforward as possible, it's still a complicated process. Microchip has their own software, as well, which you could try.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Leon Heller
    Amateur radio callsign: G1HSM
  • kwinnkwinn Posts: 8,697
    edited 2010-05-01 00:38
    Joms, don't want to come off as being pedantic but BCD is binary coded decimal (1 0f 10) and requires 4 bits. Octal or BCP would be more appropriate for 3 bits.
  • JomsJoms Posts: 279
    edited 2010-05-01 01:00
    Kwinn, your actually right... Looking at it more, I just need BCP then. Basically I just need to get a number 0 thru 5 to select the audio ouput.

    I downloaded the MPLAB software now and reading the help files...kind of hard to figure out, but not giving up yet. If I can get the simple program figured out, it should be perfect for my application.
  • TubularTubular Posts: 4,718
    edited 2010-05-02 03:24
    Another way, if you don't want to program anything, would be to use the FT245R, instead of the FT232R.

    It's USB to Parallel, instead of USB to serial. There is also a DIP24 version of it, UM245R...
    www.ftdichip.com/Products/EvaluationKits/UM245R.htm

    tubular
  • JomsJoms Posts: 279
    edited 2010-05-03 02:36
    WOW, Tubular!... I have spent quite a bit of time now figuring out that other ic, but looking at this usb to parallal IC, I think that will be perfect! I don't need to learn another language or program. Thanks for suggesting that!
  • kwinnkwinn Posts: 8,697
    edited 2010-05-04 02:17
    A possible plus to Tubular's approach is that no encoding/decoding is required. You have 8 or more parallel bits available so use one bit for each output. Also allows activating more than one output at a time.
  • JomsJoms Posts: 279
    edited 2010-05-04 20:56
    Perfect, that is exactly what I was thinking. Now I just need to find a good switching IC for audio. I was hoping to find a solution in one IC, but the closest I found was to switch the audio with 4 2x1 switching units hooking them in series. Would I be able to use a standard transistor? I am dealing with unbalanced line level audio...
  • kwinnkwinn Posts: 8,697
    edited 2010-05-05 03:30
    Look at the telecom/telephone chips. There are several crosspoint switch IC's available (see http://www.analog.com/en/switchesmultiplexers/products/index.html?gclid=CP7krc2GuqECFUFM5QodSwPJAA). Also cmos chips like 4066 and 4051. Individual transistors (bipolar or fet) can be used but usually require some level shifting and/or optical isolation.
Sign In or Register to comment.