Help needed how to simulate 2 microcontrollers

Status
Not open for further replies.

hssn601

Member
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: 193
I guess I don't see the problem: both uCs run as state machines, a command comes in and they respond to it. The 1st uC gets commands from a box of buttons/switches and outputs to its' LCD and/or out its' serial Tx. The 2nd uC gets commands from the 1st uC and outputs to its' LCD.

Each has a definable command/response protocol (Don't They??), so you can build and debug each as separate blocks. Or, is there a Lot more to it than you're describing...

It's not like a synergistic setup, where execution of each is interdependent on some/all others... a Much More interesting thing to write/debug. <<<)))
 
I have done this in the past with no issue's at all, however you can only debug one.
 
here is my code ..while simulationg both us's whith the same code only uc is giving characters on lcd...if i use only 1 uc than every thing is ok 1st uc takes data from rx and put it on lcd and tx
 

Attachments

  • lcd+srial.c
    903 bytes · Views: 165
  • lcd+srial.hex
    2.5 KB · Views: 177
This is ISIS running two micos and two LCD's
(note.. the hex files ARE NOT named the same ie..hex1.hex and hex2.hex)
 

Attachments

  • 2xmicros.jpg
    210.1 KB · Views: 200
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?
 
You can't sim rf modules.. If you use easy radio modules or Xbee they operate as a cable replacement.... This will work
 
ISIS will not simulate RF devices... But as long as the real world device acts like a cable! you don't need to simulate.. There is no gps simulation either..

When I need to simulate these devices. I quickly knock up a VB application then comunicate with ISIS vis com0com http://com0com.sourceforge.net/...
 
If it is a valid NMEA sentence!! Have you got all the valid sentences?
 
gpss

here is my code and schematic first mc sends contineously gps sentences while second uc extract latt/long the problem is that it only get latt/long 1 time after that it doesnot update latt/long..

please help.
thankss in advance..
 

Attachments

  • mc1_gps.c
    941 bytes · Views: 166
  • mc1_gps.hex
    3 KB · Views: 175
  • Rcv_mc2.c
    842 bytes · Views: 160
  • Rcv_mc2.hex
    2.8 KB · Views: 175
  • lattlong(replace.cby.dsn).c
    75 KB · Views: 168
The printf statement outputs a $GPGLL twice in one sweep you may only get the second reading over and over, the first will be an instant..

To test its functionality create two adjustable variables and then printf("$GPGLL, %d,%d,N,00500.0006,E,104715.203,A*37", varX, varY); to change each iteration.
 
for(temp=0;temp<10;temp++)
{
printf("$GPGLL,4101.2503,N,01959.8130,E,135944.703,A*30");
printf("$GPGGA,135944.70,4101.2503,N,01959.8130,E,1,04,2.0,-0036,M,,,,*38 ");
printf("GPAPB,A,A,0.0,L,N,,,358.1,M,SIM002,358.0,M,,,*20 ");
printf("$GPGGA,135944.70,4101.2503,N,01959.8130,E,1,04,2.0,-0036,M,,,,*38 ");
printf("$GPVTG,360.0,T,348.7,M,000.0,N,20.0,K*43,11111111111111111111111111");
}

delay_ms(500);
for(u;u<10;u++)
{
printf("$GPGLL,5500.2503,N,01959.8130,E,135944.703,A*30");

}



}


i have also tried this but it only gets ist sentence
 
while(1)
{
printf("$GPGLL,%ld.2503,N,01959.8130,E,135944.703,A*30",temp);
printf("$GPGGA,135944.70,4101.2503,N,01959.8130,E,1,04,2.0,-0036,M,,,,*38 ");
printf("GPAPB,A,A,0.0,L,N,,,358.1,M,SIM002,358.0,M,,,*20 ");
printf("$GPGGA,135944.70,4101.2503,N,01959.8130,E,1,04,2.0,-0036,M,,,,*38 ");
printf("$GPVTG,360.0,T,348.7,M,000.0,N,20.0,K*43,11111111111111111111111111");
temp++;
}


its also not working (
 
Maybe the serial port is in error.. I have never used mickroC so I cant debug your code.. Can you place a breakpoint in your serial() routine to view each time it receives L and L, then you can view the buffer.. when the loop is bigger than 25 and you have done you should clear the buffer so you can see if the serial() routine is working correctly.
 
I've never used that either... What is it like debugging at C level?
 
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…