Help needed how to simulate 2 microcontrollers

Status
Not open for further replies.

hssn601

Junior Member level 2
Joined
Apr 26, 2011
Messages
24
Helped
1
Reputation
2
Reaction score
1
Trophy points
1,283
Visit site
Activity points
1,420
Help needed how to simulate 2 microcontrollers at same time with different hex files
only 1 microcontroling is executing program at a time in protues .
sorry for bad english .
 

Attachments

  • Untitled.jpg
    565.2 KB · Views: 103

please upload the proteus file and hex files to help you
 

same hex for both microcontroller
 

Attachments

  • mc2.rar
    13.1 KB · Views: 84

Hi,

You can actually run both MCUs simultaneously. Each MCU has to have an unique name, which you have already done. Setup simulation by right click on U1 and select program file for that MCU, then do the same for U2.

Now run the simulation.

It's that simple.

By the way, you do not have to use the same hex file, you can have a different hex file for each processor.
 

Attachments

  • mc2V2.zip
    28.3 KB · Views: 98
Last edited:

only 1 uc is giving display on lcd at a time with same program(2 different name hex files)
 

I've ran your simulation and U2 is definitely running, however LCD2 is out of sync, possible failure to initialize, and complains repeatedly about logic contentions.

The logic contentions are most likely due to the fact the LCD is trying to send data at the same time U2 is sending data.

Both the MCU and the LCD are attempting to drive the data lines at the same time.

Maybe the LCD initialization routine is cutting the necessary delays too close and LCD2 doesn't initialize before the MCU starts to write data to the bus.

Try adding a delay after the LCD initialize routine is called.
 

yaa lcd2 is not wotking rest of every thing is fine thankss i'll try this .
 

Yes, I actually connected the TX line on the U2 to the virtual terminal's RX line and the U2 sent the "HSN" to the terminal on powerup. So there was no doubt that U2 was running. After examining the debugger window for the LCD2, I can only conclude the LCD routines, specificly the initialization routine is most likely the cause of the problem.

Please let me know what you find out after introducing a delay.
 

ok i'll let you know by tomorrow and i have 1 more question if i replace the wire with an rf module than this program will work or not
if not than what i have to doo?

---------- Post added at 20:57 ---------- Previous post was at 20:50 ----------

and 1 more question is there is any gps in protwus for simulation?
 

If you use easy radio modules or Xbee they operate as a cable replacement....
 

xBees are duplex transceivers, typically the RF RX/TX pairs are simplex, one directional only. The xBees also have a UART, so yes they would be a virtual cable replacement. However, the RF TX/RX pairs would require an encoder/decoder scheme, such as Manchester Encoding scheme to get a reasonable BAUD rate. The encoding scheme would typically be implemented in software on the PIC.
 

a friend of mine is telling me if i replace wire wd zigbee rf module than this program transmitts and recive data.
is it?
 

No, once they are setup, it's just like a serial cable.

Checkout my new group:

Embedded Wireless Networks

I have a couple of threads packed with ZigBee/xBee information, more are being posted daily.
 
Last edited by a moderator:

Status
Not open for further replies.

Similar threads

Cookies are required to use this site. You must accept them to continue using the site. Learn more…