Hi Leigh,
Just doing some work with DSPIC Miac and simulation of the digital inputs I1 - I8..
Looking at the chip window in FC 7 I can't figure out which inputs I1 - I8 are mapped to the chip... Basically what I want to do is to use switches on the system panel to simulate the inputs on the miac for testing purposes.
On the old version of miac's I could map a switch input to port E (1) and simulate a change of state. Unless I am missing something (highly probable) does the DSPIC miac use a multiplexer ahead of the processor chip or some other clever magic ?
Thanks for your assistance
All the best
Pete
DSPIC MIAC digital input pins
- Steve
- Matrix Staff
- Posts: 3421
- Joined: Tue Jan 03, 2006 3:59 pm
- Has thanked: 114 times
- Been thanked: 422 times
- Contact:
Re: DSPIC MIAC digital input pins
Hi Pete,
The input pins on the new range of MIACs (dsPIC, Arduino and Raspberry Pi) are internally connected to a dedicated ADC chip and are not directly connected to a pin on the microcontroller.
So yes - it's magic!
Although you've highlighted a problem in that it is difficult to simulate programs because the inputs cannot be stimulated. I think there are at least 3 ways we could achieve this:
1) Simulation-only macros that allow the state (or analogue value) on an input to be set within your program.
2) Optional UI on the MIAC itself to manipulate the input values.
3) Allow the inputs to be linked with switches or potentiometers within the simulation.
Do you have a preference? I think all three options are possible, but I can't comment on how easy each would be for us - so I can't promise we'll be able to do it the way you want. But any suggestions are useful...
Thanks,
Steve.
The input pins on the new range of MIACs (dsPIC, Arduino and Raspberry Pi) are internally connected to a dedicated ADC chip and are not directly connected to a pin on the microcontroller.
So yes - it's magic!
Although you've highlighted a problem in that it is difficult to simulate programs because the inputs cannot be stimulated. I think there are at least 3 ways we could achieve this:
1) Simulation-only macros that allow the state (or analogue value) on an input to be set within your program.
2) Optional UI on the MIAC itself to manipulate the input values.
3) Allow the inputs to be linked with switches or potentiometers within the simulation.
Do you have a preference? I think all three options are possible, but I can't comment on how easy each would be for us - so I can't promise we'll be able to do it the way you want. But any suggestions are useful...
Thanks,
Steve.
- LeighM
- Matrix Staff
- Posts: 2178
- Joined: Tue Jan 17, 2012 10:07 am
- Has thanked: 481 times
- Been thanked: 699 times
- Contact:
Re: DSPIC MIAC digital input pins
Hi Pete,
You can simulate analogue inputs into I1-18 via the "Analog Window", see the menu "View"->"Analog Inputs",
these are virtual An inputs, marked as An0-An7 corresponding to I1-I8.
So you can also add a Pot to the panel and connect to say An0 and simulate an analog input into I1.
As Steve says the inputs go through ADC so are not directly connected to pins on the dsPIC,
so digital switch inputs aren't supported (at the moment),
except for I1 and I2, which are RB0 and RB1 on the dsPIC, and can be seen on the chip view (pins 25 and 26)
So you can use these for fast inputs such a quadrature decoder.
Hope that helps.
Leigh
You can simulate analogue inputs into I1-18 via the "Analog Window", see the menu "View"->"Analog Inputs",
these are virtual An inputs, marked as An0-An7 corresponding to I1-I8.
So you can also add a Pot to the panel and connect to say An0 and simulate an analog input into I1.
As Steve says the inputs go through ADC so are not directly connected to pins on the dsPIC,
so digital switch inputs aren't supported (at the moment),
except for I1 and I2, which are RB0 and RB1 on the dsPIC, and can be seen on the chip view (pins 25 and 26)
So you can use these for fast inputs such a quadrature decoder.
Hope that helps.
Leigh