Circuit simulators with microcontroller code

Status
This old topic is closed. If you want to reopen this topic, contact a moderator using the "Report Post" button.
Okay, I'm looking for any circuit simulation programs (like PSPICE) that also have microcontroller models in them where you can load your hex code into the microcontroller part, and then simulate your entire circuit in real time. Does such a thing exist yet?

I know that some microcontroller companies sell emulators and simulators with "plugin" modules, but I've found that the plugins are somewhat limited in variety.

Thanks!
-RT
 
Typically, microcontroller simulator and circuit/device-level simulators are quite distinct from one another because they operate at different levels of abstraction. If you wanted something that did (and combined) both you'd likely need a copy of a chip's logic and circuit-level layout, which are kept secret...Otherwise, it'd be simple for a competitor to copy a design.

I'm guessing that you want to write assembler to control the I/O's on a chip that you're connecting to some custom hardware. If so, it's probably a lot easier to write a software program that emulates the chip's output (and dumps it to a file) and then use that file as input into a circuit-level simulator.

If you don't mind me asking, what are you trying to do?

D. Carney
 
I have an old copy of Electronics Workbench that allows mixed mode simulation of digital and analog stuff in the same circuit, but it can't simulate a microcontroller.

If you are using a spice type simulator to simulate something like a microcontroller you run into a major problem. Spice is a time domain simulator and its purpose is to capture details of events that occur in very short time periods. If you are running the microcontroller clock at 10 MHz, spice is going to worry about the transitions of the clock and calculate voltages and currents in extreme detail at each clock transition.

When you combine the microcontroller circuit with an analog circult, which typically has things happening much slower than the microcontroller, the simulation time will be very long because spice is using short time steps to get all the detail on what's happening with the digital circuits.

The simulation gets long, the data files get huge, and you get tired of waiting.

I_F
 
I'm trying to simulate a remote volume control circuit for an audio amp:

left channel volume up/down
right channel up/down
both channels up/down
mute

So I need seven buttons for all of these features, and I'm using three PIC16F627A chips, along with an encoder and decoder chip from Holtek.

You should be able to turn the volume up or down via remote control, or by buttons on the amp unit iself. The volume control is a DS1666 digital pot from Maxim. I've found a few microcontroller simulators with pluggins for things like extra memory, but none for an encoder or decoder or a digital potentiometer.
 
The IDE that's free from Microchip will simulate the code as far as the I/O ports. You just need to compare the uC output to the digital pot with the timing diagram of the pot chip. Do the same with the timing diagram of the IR receiver chip (you could actually decode the IR using the uC and eliminate the IR receiver chip if you wanted to).

Why do you need three uCs just to control volume?

I made a digital attenuator that used an NS attenuator chip. I used buttons for volume up and down and mute. The code required 110 bytes including the 3-wire bit banging routine to drive the attenuator chip and ramped mute/unmute.

I_F
 
I_F, that sounds neat! I'm pretty new to uC's, and this is my first "big" project.

uC1 ==> acts as a "parallel to serial" encoder for the remote control. Without this, the HT-12A encoder chip itself can take up to four inputs at a time, but I need seven. Adding the uC in the remote allows me to insert a pseudo "transmit enable" pin because the HT-12A does not have a separate transmit enable pin in itself (I can explain more on this if you want).

uC2 ==> the serial to parallel decoder for the receiver end, does the opposite of uC1.

uC3 ==> on the receiver side, it takes all button inputs and interfaces the logic to the two potentiometers (the pots use an increment/decrement protocol, not SPI or IIC).

I'm also using PIC16F627A's, so the number of input pins for each is limited.
 
Status
This old topic is closed. If you want to reopen this topic, contact a moderator using the "Report Post" button.