View previous topic :: View next topic |
Author |
Message |
newCCSUser
Joined: 25 Aug 2013 Posts: 12
|
Pin multiplexing on 32bit |
Posted: Wed Jun 25, 2014 4:02 am |
|
|
We are in process of developing one prototype board with few external parts.
All together we are needing cca 120 - 130 pins. Now, using 144 pin chip would be best solution but then i need machine soldering etc, which would increase the project budget by far.
Multiplexing and PPS would be other solution but then i don't know if i can get so much pinouts ? Maybe with 64 or 100 pin count MCU.
All comes down to project budget.
Any suggestion ?
btw. We can use 16 or 32 bit products. |
|
|
temtronic
Joined: 01 Jul 2010 Posts: 9221 Location: Greensville,Ontario
|
|
Posted: Wed Jun 25, 2014 5:11 am |
|
|
As a 'general' comment, any project that needs 120-130 I/O pins probably should be split into several smaller PICs with fast, easy interPIC communications, especially if this is a 'one-off' project.
Without knowing any details other than 'cost', 'handsoldering' and 'pin count', my 'crystal ball' tells me this may be a class project? What's the time frame for project completion?
Any PIC project (well any microcomputer really) that has that much I/O should be split into smaller 'boards' to make it manageable. There's also the question of 'what else does the PIC have to do'? Designing a 'megaPLC' with a single PIC would be OK, but add ANY amount of 'math', ISRs, etc. and it becomes a HUGE 'can of worms'.
Tells us some real details and we can better advise as to the possible PIC solution. The more you tell us the better we can help!
hth
jay |
|
|
newCCSUser
Joined: 25 Aug 2013 Posts: 12
|
|
Posted: Thu Jun 26, 2014 7:23 am |
|
|
Thank you for replay.
As you can guess the board will implement few external sensors, coin machine, RFID, LED etc, and for all that 64 Pin DSPIC30F601 would be enough because for this i need 59 pins. Now the problem is the external "stepper motor board". On this board you have 30 stepper motors but only one will work in the same time. It will work on button press.
If i can solve this with some adapter board or connect them in parallel then i dont need so much pinouts. Of course if i connect them together how to define which is the one that i want to control. Maybe over some uln.. |
|
|
newCCSUser
Joined: 25 Aug 2013 Posts: 12
|
|
Posted: Thu Jun 26, 2014 8:49 am |
|
|
the only logical setup would be with two mcu. One on the stepper motor control and one on the main board + master slave comm. |
|
|
ezflyr
Joined: 25 Oct 2010 Posts: 1019 Location: Tewksbury, MA
|
|
Posted: Thu Jun 26, 2014 9:29 am |
|
|
Hi,
I am not a big fan of multiple processors, unless it's clearly advantageous to do so. IMHO, it adds unnecessary complexity to a project, that should be well justified if that is the route taken.
You don't say so specifically, but if your need is for digital I/O, then I would encourage you to look at the PCA9671 bi-directional I/O expander. This I2C device has 16 I/O, and up to 64 can be used on one bus (16 x 64 = 1024 total I/O).
A couple of years ago I had a need for 256 digital inputs in a design. In stead of the PCA9671, I created a 64 input device (I use 4 of them in the design) using a CPLD. That's another option, but the development costs may be prohibitive?
John |
|
|
newCCSUser
Joined: 25 Aug 2013 Posts: 12
|
|
Posted: Fri Jun 27, 2014 2:04 am |
|
|
The plan is to control stepper motor array of 25-30 motors.
I was thinking on using 4 wire setup and 12V motors.
We have reduced some parts so we can go with DSPIC30F6010.
I have 8 IO pins left for this expander board/ stepper board.
The simplest way would be to connect all those wires to one expander board as you have suggested but i dont know if this could work on this way.
The other parts are done and there is no problem with design but the stepper motor board is causing troubles :-). The idea was to control all those motors ( just one works at the time ), over 5 wires. 4 wires for standard setup and one wire for motor ID. If this can be done with expander then this would be perfect.
BTW. is DSPIC30F6010 supported by ccs ? |
|
|
temtronic
Joined: 01 Jul 2010 Posts: 9221 Location: Greensville,Ontario
|
|
Posted: Fri Jun 27, 2014 5:55 am |
|
|
hmm...
You might want to consider using a small PIC to control a single servo motor. That way each 'motor unit' (25-30 of them !) is the same..PIC-driver-motor. Allows for easy replacement. Same PCB/motor.
If speed isn't a factor, communications on an RS-485 'network' would be easy.
It also frees up a few pins on the 'master' and reduces the code it has to do. Just send the 'update info' to the desired stepper controller PIC.
If there is no data coming back from the 'motors', then you only need one I/O pin from the 'master', 3 if you want feedback.
Just 'food for thought'.
Jay |
|
|
dyeatman
Joined: 06 Sep 2003 Posts: 1933 Location: Norman, OK
|
|
Posted: Fri Jun 27, 2014 11:44 am |
|
|
Adafruit has a great 16 channel servo controller that uses I2C and would solve your problem nicely with just two boards and a few pins total...
https://www.adafruit.com/products/1411
I have used this board several times and it works great.
They say you can control up to 992 servos using these things! _________________ Google and Forum Search are some of your best tools!!!! |
|
|
newCCSUser
Joined: 25 Aug 2013 Posts: 12
|
|
Posted: Tue Jul 01, 2014 3:50 am |
|
|
Adafruit has a great 16 channel servo controller that uses I2C and would solve your problem nicely with just two boards and a few pins total...
- i have found similar solutions but this looks nice and reliable.
I dont get it how would you connect 2 boards together on one i2c line ?
Can this work on this way ?
Maybe there is a 32 channel servo controller ? |
|
|
temtronic
Joined: 01 Jul 2010 Posts: 9221 Location: Greensville,Ontario
|
|
Posted: Tue Jul 01, 2014 5:00 am |
|
|
I2C is simply a 'buss' topology that has addresses for the devices that are 'on the buss'.
You just prset the address of the devices. It's all explained in and I2C 'primer'.
Just be sure no two devices have the same address !!
hth
jay |
|
|
dyeatman
Joined: 06 Sep 2003 Posts: 1933 Location: Norman, OK
|
|
Posted: Tue Jul 01, 2014 6:14 am |
|
|
Temtronic is correct. I have used 4 of these together with no
problems. There are 6 address jumpers on the board that must be
set to a unique address. It sounds like you need to read the Adafruit
docs and learn how I2C works.
Here is a good place to learn:
http://i2c.info _________________ Google and Forum Search are some of your best tools!!!! |
|
|
newCCSUser
Joined: 25 Aug 2013 Posts: 12
|
|
Posted: Tue Jul 01, 2014 6:43 am |
|
|
Thank you guys for reply.
I didn't work with i2c but it look like that this is perfect solution!
Am going try it this way.
Regards for now ! |
|
|
newCCSUser
Joined: 25 Aug 2013 Posts: 12
|
|
Posted: Tue Jul 01, 2014 7:24 am |
|
|
btw. what device would you suggest for programming dspic30-33 ?
Am looking for some cheaper solution and not something like real ice.
Something far cheaper... |
|
|
dyeatman
Joined: 06 Sep 2003 Posts: 1933 Location: Norman, OK
|
|
Posted: Tue Jul 01, 2014 1:20 pm |
|
|
I use the CCS ICD-U64. _________________ Google and Forum Search are some of your best tools!!!! |
|
|
newCCSUser
Joined: 25 Aug 2013 Posts: 12
|
|
Posted: Fri Jul 04, 2014 3:55 am |
|
|
One more question regarding the programming part.
On the dspic there are :
MCLR,PGD i PGC and SCK, SDI, SDO i SS pins for programming.
What pins do i need ( except MCLR, PGD and PGC ) for standard programming with ICD -U64, and what pair for debugging ? Can the debbuging part be selected via FICD ? |
|
|
|