4
\$\begingroup\$

I have bought a microcontroller from Texas instruments: MSP430F6779. I would like to simulate in a circuit along with other components: resistors, op amps, sensors..

What program allows me to do that? I have searched the spice library for microcontrollers on ti.com but it is not there... Does anyone have an idea?

\$\endgroup\$

2 Answers 2

4
\$\begingroup\$

Usually, nobody does this. Simulating a whole circuit, including analog+microcontroller using just spice models would not make sense. It would be very slow and you would therefore not be able to simulate much.

There are tools that do it, but it is not using spice only. They break up the circuit in parts, simulate the analog part with spice and the digital part with other means. But they are usually expensive, and it is rarely actually needed.

What people do is to identify the various blocks in the circuit, and simulate each independantly, with the most appropriate tool:

  • Typically, for an analog block with a few inputs from the microcontroller, you would use a spice tool, and simulate inputs coming from the MCU using simple voltage sources for which you assign the appropriate waveform (using pulse at predefined times, for example).
  • To simulate the high-level MCU code, you can actually do it on a PC, if you use C. You need to emulate the peripherals you need, and compile for Windows/Linux. This can be time consuming for a complex app with lots of peripherals, but it gives you a lot of freedom during tests and is a good exercise to make platform-independant code.
\$\endgroup\$
10
  • \$\begingroup\$ Thank you for the asnwer can you elaborate.The thing is I have a analog circuit (sesnors with some op amps) that will be connected to the input of the mcu and then I would read the digital info from the output of that mc. I need to test it for different signals because I want to find the minimum noise to signal ration where my mc picks up the real signal.Could you elaborate the second step in your answer a little bit ? Perhaps we can skip that step if I can somehow connect the analog simulation directly to my real mc and then see the output.I am really new to working with the simulation of mc \$\endgroup\$
    – georges
    Commented May 29, 2016 at 14:51
  • \$\begingroup\$ In this case, even mixed-mode simulators won't help. They will not model noise on the MCU ADC inputs. You have to rely on the datasheets. It is as simple as that. \$\endgroup\$
    – dim
    Commented May 29, 2016 at 15:05
  • \$\begingroup\$ I was planning on simulating the noise in the analogue part using a series of resistors in a feedback loop or some other method If I find one \$\endgroup\$
    – georges
    Commented May 29, 2016 at 15:10
  • 1
    \$\begingroup\$ I think you are not adressing your whole problem from the right side. You don't have to simulate anything yet. You have to solve your problem of amplifying your 250nV signal. That will be a big step. You have to check which opamp is able to do that (and it won't be so easy), or if you need some other amplification mean (I don't know which one). Then you build this (for real - not in a simulation), and you test it, check that you have something relevant at the output. Because no simulation is going to be accurate at this level. Then, you'll think about the ADC part, but this is secondary. \$\endgroup\$
    – dim
    Commented May 29, 2016 at 22:21
  • 1
    \$\begingroup\$ Then, problem solved. You'll have, let's say, a 2V signal at your ADC input. From this point, there is no reason it wouldn't work, and hence no reason to do a simulation either. Indeed, now you have to define, using the datasheets, the characteristics of your amplifier (gain, max peak voltage error max, ...), depending on the dynamic range you need (number of significant bits). \$\endgroup\$
    – dim
    Commented May 30, 2016 at 5:40
2
\$\begingroup\$

Proteus should be able to simulate an MSP430. See this page for simulating the MSP430 series.

However, keep in mind that relying on a simulator to accurately simulate MCU behaviour may result in trouble. Also, Proteus is not free.

In many cases, you will be much better off leaving the MCU out of the equation, and simulating only the analog or digital portion of your circuit.

Also, I'm not familiar with it, but VisSim may also be an option.

\$\endgroup\$
6
  • \$\begingroup\$ thank you for the suggestion.I have checked out both Proteus does not have the mc I ned need however VisSim apparently has all the MSP430. If I do not want to simulate the mcu how should I proceed ? the thing is that I have a analogue circuit(two sesnors with some op amps) that will be connected to the mcu and then I would read the digital info from the output of that mc.I need to simulate because i am designing a low noise circuit and I do not have the necessary lab equipments for a real simulation so I need to do everything on a software \$\endgroup\$
    – georges
    Commented May 29, 2016 at 14:28
  • \$\begingroup\$ What, specifically, are you trying to simulate? I.e. what sort of code are you going to be running on the MCU? It sounds like you don't need to simulate the MCU, as your circuit is a simple analog circuit. Perhaps adding a schematic of the circuit you want to simulate to your question would add clarity. \$\endgroup\$
    – uint128_t
    Commented May 29, 2016 at 14:31
  • \$\begingroup\$ I edited my first comment. I do not have a schematic yet for the needed circuit.I want to simulate the mcu becuase I would like to see the minimum noise to signal ratio possible for my mcu to detect the real signal since it's a very low noise signal \$\endgroup\$
    – georges
    Commented May 29, 2016 at 14:33
  • \$\begingroup\$ I'm not too familiar with Proteus, but do none of the MSP430 models provided by Proteus have ADC functionality? I would expect that many of them do, and you can easily select a specific MSP430 that has the exact same ADC specs as your specific model. Additionally, if you have designed your circuit correctly, you should not need to simulate the MCU and ADC: you should be able to determine circuit performance based on ADC specs and a simulation of your analog circuit. \$\endgroup\$
    – uint128_t
    Commented May 29, 2016 at 14:36
  • \$\begingroup\$ that makes sense but I would still need to show the output of the mc to the rest of the group I am working with.If I design the analogue circuit in pspice is there a way to export the output to maybe my real mc ? thank you again for the detailed help \$\endgroup\$
    – georges
    Commented May 29, 2016 at 14:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.