Question about PICs

Thread Starter

bluebrakes

Joined Oct 17, 2009
252
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!
 

Thread Starter

bluebrakes

Joined Oct 17, 2009
252
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.
 

MrChips

Joined Oct 2, 2009
30,794
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?
 

Thread Starter

bluebrakes

Joined Oct 17, 2009
252
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.
 

MrChips

Joined Oct 2, 2009
30,794
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?
 

Thread Starter

bluebrakes

Joined Oct 17, 2009
252
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.
 

ErnieM

Joined Apr 24, 2011
8,377
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.
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.
 

John P

Joined Oct 14, 2008
2,026
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.
 

Markd77

Joined Sep 7, 2009
2,806
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.
 
Top