Python PIC Useful When Attached To A Computer

[Richard] sent in a link to the Python controlled microcontroller he’s been working on. Unlike the previous portable Python boards we’ve seen, [Richard] thinks his pyMCU isn’t best used autonomously. This board is meant to be used only when connected to a computer and to serve as a bridge between the digital world of computers and our analog world.

We’ve seen boards running lightweight Python interpreters, but we’re fairly intrigued by the idea of this board only being useful when plugged into a computer. The on-board PIC 16F chip has enough digital, analog and PWM pins to just about any task imaginable, and there’s also a 16-pin LCD display header if you’d like some output with your microcontrollers.

[Richard] says he’s been working with PICs for longer than the Arduino is around, but depending on the level of interest he’ll consider developing an Arduino version of the pyMCU. All we know is that the pyMCU would be awesome to teach electronics and programming to the younglings, and we could certainly find a few more uses for the board when they’re done with it.

34 thoughts on “Python PIC Useful When Attached To A Computer

  1. Richard should consider using an 18F series PIC with USB. Not only are they better chips overall, but you can throw away the expensive FTDI chip and end up with a single chip USB solution. Microchip has CDC firmware available you can use as-is.

    1. I know this is a super old story at this point, but I missed it the first time.
      Anyway, if you are only going to use the PIC built in USB for CDC (virtual serial port), and you have the board space, it would be much easier to just keep using the FTDI chip. The CDC code takes up about 1/3 of the memory space of the whole chip right off the bat. Now if you have plans of mass storage, or HID or something, then ya, go with the built in USB. Else be careful that you’ll still have enough memory after the CDC code. It’s not as easy to interface with as the UART either.

  2. I think this is a clever idea. A transparent multi-purpose hardware port for software running on a PC. Another HAD post that will make me spend money…

    I do agree with macegr’s point. The FTDI chip seems to be less&less necessary. FTDI should drop the price of this chip dramatically. It is stupidly pricey.

  3. So, this = USB GPIO converter with a python interface? I can see tons of uses for that, esp. since it should be a tad cheaper than a duino, so it’s great for large-scale implementations. ($10 vs $30 is a big difference for, say, a classroom)

    1. Stick an AVR on a board with V-USB and I can get you an USB-IO expander for less then $10.

      You would need:
      -ATTiny2313
      -USB connector
      -100nF cap
      -3x resistors
      -2x 3.3v zeners
      -12Mhz crystal
      -Small PCB to put it on
      Total price, around $5

      Gives you 13 IO pins I think. Upgrade the ATTiny2313 to something larger for more pins.

    2. $10? I click the link in the HAD excerpt, and the pyMCU store has it for $24.

      While I feel Python’s a great learning language on PCs (and it would be “great” if the Arduino IDE supported it), I have to point out you’d be losing a lot in terms of “ecosystem” if you went with anything other than an Arduino platform.

      As for cost, the ModernDevice.com RBBB Arduino _kits_ are $11 each in QTY of 10. You can have another class or volunteers assemble them. Pre-assembled though, the RBBB is still $22 to $25 each QTY 1 (there’s no listed price for QTY 10, but I bet they’d give you a break on quantity.. Paul’s a good guy like that)

    3. I’d be willing to work out an educational deal, contact me on the pymcu website and we can discuss a price break. I’m a big supporter of education, that was part of the reason for developing pyMCU in the first place. I’m in the last week of teaching a 5 week class at work in which I wanted to teach an introduction to the microcontroller and programming, the guidelines were that I could only use what was already installed on the teaching lab computers and most of the students had little to no programming experience. I thought about Arduino at first but that would require installing additional software (plus the really old version of linux they had did not have the right libs for the ide to work) also I thought c++ might be a little much to teach to beginners on top of the electronics stuff. I had taught a python class a few month earlier so I thought if I could tie into that it would make for a good building block on top of that class. So far the class has been going so well we are going to extend it another 2 weeks to have fun doing some more projects.

  4. I think this is just a Python front end on your PC, and some software flashed onto the µC that takes commands from the front end to do typical µC stuff. It does not look like this is Python on your µC. So if he published his protocol, you could talk to it from any language. Kind of cool.

    1. That is correct, you run python on your pc and use it to control the pyMCU hardware module. It is not python on the MCU. I haven’t published the protocol yet but the pyMCU python module that you install to use it is the full .py source code so if you are familiar enough with python you can go through the code and get the various serial commands out from the functions and make it work in any other language. I’ll try spending some time over the next few weeks putting together a proper documentation of the serial protocol.

  5. With good design something like this can take place of the old parallel port that was easy to control and had many uses.
    I wish this would get more advanced and somehow merge with the bus pirate. I could use something like the bus pirate that had more pins and other functions.

    1. A time ago i was reading a pic18 datasheet, and it says that was posible to control the PSP of the PIC directly through USB(no the same way as you can write a firmware and control the pins) like a LPT port

  6. Please add a version with 12bits adc.

    This things are very useful for lab use. I think that for “slow” speeds this kind of things are far more useful than any pci board controlled by labview.

      1. Protocol… the cleaver part of this design is the python library. Of course that I could program a pic or avr to do the same and after that I could program a python interface library… the programing part takes a bit longer than a morning.

        For simple things I have already used one arduino, just like that, a small program that takes commands and a some python functions to do the interface, this is a easier route.

        This is far more simple to use.

  7. The contact page is not working :(

    Also, What I like about this is that it does not care about running python on the chip or not, but you program the chip with python. This is really my dream. I’d love to have kids open up a text editor or terminal and start typing python and then flash the arduino or maple or whatever.

    1. Yea I would like to be able to make the price lower, raspberry pi is a non-profit a lot of the effort has been donated time and resources and they are either making about $1-$2 dollars profit off the board maybe more since they can get it made in huge quantity, unfortunately I’m just one guy building something I think is useful and others have found useful, it’s a lot of work to put everything together, update ,support and debug it, create documentation, fulfill orders and so on. Even Arduino Uno’s are around $25-$30 depending on where you buy it. If you feel the work I put into this product is not worth it you are more than welcome to come up with your own solution, I’ll even help you out if you have any technical questions, I encourage everyone to learn and try building new things. For those that just want an off the self solution I’m doing what I can to help out in that area and not go broke in the process.

      1. @Richard: You did a good job on this. btw..i did order one yesterday. Thanks for shipping it to me. You should do a mass production to cut costs. This little puppy has lots of uses..esp if it can work on its own with battery power :)

        btw..I was not trying to underestimate the hardwork you put into this. Am sure it involves more than i can handle :)

  8. @Richard
    Don’t let the naysayers get to you. I think you have a wonderful idea here. Have you tinkered any with using it with other pic variants ? They just released the pic32 chips in DIP format and those have USB support as well if needed as well as a lot of the same ports and some new ones.

    I myself am trying to get a project going and people that have not done it before don’t realize the problems you have being one person trying to bring something to the community.

  9. The thing people are missing about using a chips native USB is you need driver support in the OS. USB drivers are a pain to implement for some OS, winx64 being a big one. You end up relying on the developer to keep the drivers updated or relying on CDC drivers and using another vendors ID . FTDI chips do have one thing going for them and that is driver support to most OS and updates.

Leave a Reply

Please be kind and respectful to help make the comments section excellent. (Comment Policy)

This site uses Akismet to reduce spam. Learn how your comment data is processed.