Question about PICs

Discussion in 'Embedded Systems and Microcontrollers' started by bluebrakes, Jun 2, 2013.

  1. bluebrakes

    Thread Starter Active Member

    Oct 17, 2009
    245
    7
    Hi Everybody,

    I can't seem to find what I'm looking for on the next and only seem to get serial pic programmers when i do.

    What I'm looking for is an example where you can upload data into pic using a serial cable.

    Then for the pic's program to read the data stored in it's memory.

    Essentially what I'm trying to do is be able to record some actions on a laptop or tablet, and then allow the pic to playback the recorded actions based on the uploaded data.

    Any guidance would be great! :)

    Thanks!
     
  2. bluebrakes

    Thread Starter Active Member

    Oct 17, 2009
    245
    7
    I should mention that I'm currently using the 16f628a, which works great with my current setup. In that I can control three stepper motors using a serial cable.

    But I would like the ability to upload recorded steps into the pic for it to replay the actions now.
     
  3. MrChips

    Moderator

    Oct 2, 2009
    12,437
    3,360
    We need to back up a bit.
    What kind of actions are you recording? What is an action?
    What instruments, devices, machinery, tools are you using and referring to?
    What does a PIC have to do with it?
     
  4. bluebrakes

    Thread Starter Active Member

    Oct 17, 2009
    245
    7
    Actions would simply be stored as a letter followed by a number in sequence.

    Such as....

    Step 1. X14955 Y295 Z330
    Step 2. X59 Y10000 Z450
    .... and so on on



    As it stands at the moment, a 16f628a is being used to move three stepper motors using a serial port on a computer. The stepper motors are driving a DSLR camera on a Tilt/Pan/Dolly system for time lapses.
     
  5. MrChips

    Moderator

    Oct 2, 2009
    12,437
    3,360
    Let's see if I get this right.

    Here is an example.
    CAD software create text files using a Gerber file format known as RS-274X.
    These files are given to CNC machines in order to drill the holes and fabricate the PCB.

    How are your instructions being generated? Why not save the steps in a text file?
     
  6. bluebrakes

    Thread Starter Active Member

    Oct 17, 2009
    245
    7
    the instructions will be written using a piece of software on a laptop or tablet.

    The reason it would be best to run the instructions from the memory of the pic, is because it's taking many photos every few seconds/minutes over a course of many hours. So having a laptop or tablet tethered via serial cable for that period is likely for either the battery to go flat or device problems (i.e. crashing).

    So when you're making timelapses of the stars, for example, in the middle of the countryside, running a program from a microcontroller circuit at less than 20mA is perfect when you're trying to conserve power.
     
  7. ErnieM

    AAC Fanatic!

    Apr 24, 2011
    7,386
    1,605
    A serial programmer, well, programs over a serial interface. You're not doing programming, you are doing a serial data link. So look for serial communications tutorials, RS-232 and the link.

    The PIC16F628A does have a UART to get and send serial data, so you are good there. It only has 224 bytes of RAM that may potentially be free to hold the data you need.

    Keep in mind this is a very tiny amount of memory and may only hold a few steps, and definitely no picture data.

    Choosing the specific processor is the last step of a specification, not the first.
     
  8. Markd77

    Senior Member

    Sep 7, 2009
    2,803
    594
    Here's one of mine for the 628A in assembler. It has a small array in RAM for incoming serial commands but this could easily be extended to fill more of the memory.
    http://www.marksphotos.info/fg/index.html
    Even if the code isn't useful you can use it to test that your setup is working correctly.
     
  9. John P

    AAC Fanatic!

    Oct 14, 2008
    1,634
    224
    If you want to store a complex sequence of operations, this chip probably won't do what you want. It has 256 bytes of EEPROM which you could use to store instructions from the computer, and I doubt if that's enough. You should look at other PIC processors which can store data to their program space. Then you'd have several thousand locations available. Alternatively, you could add an external EEPROM and store the data off-chip.
     
  10. Markd77

    Senior Member

    Sep 7, 2009
    2,803
    594
    As a side note, if the sequence is just calculated with a formula maybe it is possible to just transfer the variables to the PIC and have the PIC calculate the points, then less storage would be required.
     
Loading...