Jump to content


  • Content Count

  • Joined

  • Last visited

Everything posted by babos

  1. I've already try to complie the same project in SourceBoost IDE but remain the same error.(not in laptop but in the desktop computer where I've copy the project) Tomorrow I can try the second step. Cheer. Babos
  2. I had try to compile the same project in Sourceboost IDE & MPlab ver.8.50/8.53/8.56 and this is the error in the same case: BoostC++ Optimizing C++ Compiler Version 6.97 (for PIC18 architecture)http://www.sourceboost.comCopyright© 2004-2010 Pavel BaranovCopyright© 2004-2010 David HobdayLicensed to Massimo Romano under Single user Pro License for 1 node(s)Limitations: PIC18 max code size:Unlimited, max RAM banks:Unlimitedmcu.cStarting preprocessor: "C:\Program Files\SourceBoost\pp.exe" "E:\PRETTY FW MCU\mcu.c" -i "C:\Program Files\SourceBoost\include" -d _PIC18F8722 -la -c2 -o "E:\PRETTY FW MCU\mcu.pp" -v -d _BOOSTC -d _BOOSTCPP -d _PIC18 -d _CHAR_INDEX mcu.c successsuccessExecuting: "C:\Program Files\SourceBoost\boostlink_pic.exe" "E:\PRETTY FW MCU\mcu.obj" "E:\PRETTY FW MCU\lib\novolib_pic18t5e2ts2.lib" "E:\PRETTY FW MCU\lib\eeprom.pic18.lib" -O1 -v -p "MCU_00" -t 18F8722 -swcsBoostLink Optimizing Linker Version 6.97http://www.sourceboost.comCopyright© 2004-2010 Pavel BaranovCopyright© 2004-2010 David HobdayOptimisation level:1 Bytes:0x00 0x00 0x04 0x03 0x00 0x1A 0x00 0x00 0x00 0x2D 0x00 0x43 0x3A 0x5C 0x50 0x72 0x6F 0x67 0x72 0x61 0x6D 0x20 0x46 0x69 0x6C 0x65 0x73 0x5C 0x53 0x6F 0x75 0x72 .obj file error:Expected FILE_SECTION failureBUILD SUCCEEDED: Tue Sep 28 05:03:41 2010 the strange is that with my laptop and with the same installed programs, the linker work fine without error. Same setting, same project(s). What I Can do. please? Best regards to all Babos
  3. I've 6.96 C++ compiler version. Isn't the Last ? Where is version 7? regards. Babos
  4. Hello, I've this problem. i should make an array of integer of 1600 int as "static unsigned int buffer_sample[1600].having 3600 bytes of free RAM RAM available:3936 bytes, used:335 bytes (8.6%), free:3601 bytes (91.4%), Heap size:3601 bytes, Heap max single alloc:127 bytesROM available:131072 bytes, used:4688 bytes (3.6%), free:126384 bytes (96.4%) This message appear when I implement the array into the code with suggested "-idx 2" switch : warning: unrecognized command line agrument '-idx', skippedsrtos.c Starting preprocessor: "C:\Program Files\SourceBoost\pp.exe" E:\G26CPP\G26RTOS\ScanBoard\srtos.c -i "C:\Program Files\SourceBoost\include" -d _PIC18F8722 -la -c2 -o E:\G26CPP\G26RTOS\ScanBoard\srtos.pp -v -d _BOOSTC -d _BOOSTCPP -d _PIC18 -d _CHAR_INDEX E:\G26CPP\G26RTOS\ScanBoard\srtos.c(66): error: total number of array elements can not exceed 0x100 (use -idx 2 compiler command line argument to remove this restriction)srtos.c success what is the switch "-idx 2", why not working? Thank's Babos
  5. thank's Ian, very useful to know. Babos
  6. Good mornig everyone. Is a way to calculate how much availability Sys_Yiels / Sys_Sleep I have, Before compiler message "Can't fit Avoid boundary code in function .... "? thanks. Babos
  7. Possibly. However I will have to write it all from a blank sheet to a finished, built and tested program if I am to be certain it works. I am not charging for my time (nor would I want to) so the example project must interest, entertain and educate me or I will not do it. I am away for a few days and if I can think of an idea I like that needs this level of complexity, I will start work on it, but no promises. To modify your code you have shown us to make an example would be non trivial and I would not be able to run it without either the rest of the project and its hardware or a software test harness controlled by a script on a PC. I do not like posting bad code here, and I would not like to spend hours working on code I couldn't test. If I may tell you a little story, you may understand me better: Many years ago, just out of University, I was given a contract to rewrite a PC based medical instrument display. After some weeks I came to the conclusion that salvaging the display routine was impossible in the time available and I would need to rewrite it. It had to scroll a trace smoothly while displaying various cursor lines and timing marks on it. 8 weeks in, I had a prototype I was happy with and my boss took the demo to his boss. Unfortunately I was developing on a 286 PC with Hercules Mono graphics and the head of department had a 386 with an EGA card that his secretary used for word-processing and he only used to play cards on at lunchtime. I had auto detected the graphics correctly and my demo ran on the EGA, but it was compiled for a 286 and with three colour bit planes to scroll, it couldn't keep up, and worse, the graphics library did not interleave the scrolling, but scrolled R then G then B. The result was a rainbow coloured mush on the screen instead of a nice sharp trace and an error after a few seconds when my code detected it could not maintain a realtime display. The head of department was NOT happy. About a fortnight later, I was ready for another demo. My boss had given me access after hours to his machine for testing and I had built seperate 286 and 386 versions. All worked well, scrolled smoothly and kept up with realtime. My boss said 'I like the green trace." and I replied "Yes, it looks better than red or blue.". He asked me why red or blue and I explained that I could only scroll ONE colour smoothly in the time available :-). The horizontal cursors could be multicoloured as they did not have to scroll but all moving time marks had to be dotted green . . . The boss couldn't stop laughing. We took it to the head of department and the demo was successful. Our team went to the bar afterwards and I spent the last couple of weeks tidying up the documentation and packaging the code for the research team to hook up to. That was two weeks of 16 to 18 hour days of coding grief just because the secretary had a better PC than the programmer or any of the engineers. Afterwards, it took about a month for my health to recover and I vowed I'd never take another contract that was mainly software development. I have a couple of personal projects I have been putting off all summer with the intention of doing them this winter. One is generating a compensated pulse train from a sensor that is non-linear. It will involve sampling the incoming pulse and generating the same waveform at a different frequency with the ratio adjusted slightly by number of other external factors AND a correction derived from the period of the original waveform. Owing to the speed of the pulse train, this is going to be interrupt driven hard realtime stuff possibly with external hardware assistance for the waveform generation. The other is instrumentation, fault monitoring and data logging for an engine. It will probably fit fairly well with NOVO in a 16F887 or maybe I'll have to go PIC18. I don't think it will have anywhere near the complexity of your project even if I put in all the performance monitoring and data collection I can think of. If I wanted to add a realtime PC USB interface, it *might* come close, but I think I'd be more likely to break it up into separate logger and measurement / UI processors communicating serially and a RS232 link to the PC. I also have a lot of database and web stuff to do for work and as a volunteer Please don't wait for me to come up with an example. If I start work on something that uses the technique I suggested I will send you a PM. Meanwhile, best wishes and good luck . . . Yours Sincerely Ian M.
  8. In which case it would be unwise to discuss it in more detail or show any more of it to anyone unless you have them under contract with a signed non-disclosure agreement. Before you do that, you would of course need to see that they had done a realtime project of a similar size to your own. I am just a hobby user and am NOT the right person if you need someone under contract. You might be able to tell us how many lines of code you have, the number of Sys_xxxxx functions your code has in total, and maybe show us the call tree annotated with the number of bytes of variables and yield points per function without compromising confidentiality. That might give one of the experts here enough information to tell you if your project is too big for NOVO on a PIC18F8722. Finally have you built a custom version of NOVO yet? If not, I presume you are using 'novolib_pic18t6e4ts2.lib' which supports 4 events (semaphores). I understand you are not yet using semaphores and if you have fewer than 6 tasks as well, *maybe* you could save enough resources if you were to build, for example, 'novolib_pic18t5e2ts2.lib'. I am sorry I don't have any other suggestions to help you. Ian M.
  9. The biggest problem is that I can not speak well's English.I try to explain: * equipment has more groups: washing, serum application, drying, treatment tank, ecc. * The motors are used to move on accessories for various groups' analysis. * From computer via USB port sending the parameters that I need for a specific method * Send also (every 500ms) a request to state that allows me to display temperature, time in progression, etc. * Together with the parameters of methods, including sending the sequences of movements of the motors. * equipment is started and I could also disconnect the USB because the process can be completed alone, but I need to display as I explained the state. * Not only that, there are methods that require outside processing then, the machine is retired, the signals and allows you to restart the method after performing the external work manual. * The various groups of markers (flags) that alert you if they are busy. This is because I can send a 'parallel other analysis and sharing groups with different sequences. Maximum of two simultaneously. * If the second analysis, must use a group busy, waiting for free. * Like I said, the device functions as two years without major problems but uses superloop written PicBasicPro and most of the work is done during 'single Timer1 interrupt A typical flow for a single analysis could be this: 1) Send the parameters for analysis and the sequence of executing via USB. 2) the equipment send me an acoustic signal that advice me wich is in start. 3) The plotter X,Y,Z gets a support and move this in a washin tank for (es. 3 minutes) 4) During this time moves to do other tasks meanwhile sends me the state with the time spent washing, the temperatures of the liquid, etc. 5) Continues to support other groups of workers through the plotter. 6) If I wanted to send another way I could do it because the group was released after 3 minutes of washing. 7) ... ... I practically two buffers where to send the analysis parameters and sequences to be carried. 4 motors to move (one-way communication) command telling them where to go and at what speed. That's where the problem arises!!For example, I have to wait for X to finish the movement, before launching Y or Z, and use a pin that I got up to a high level when the engine started has finished processing the motion.During the waiting however, I still perform other tasks and this, with novo, I can not do. If I use while(busy_x_motor); other tasks are blocked waiting to exit the loop if I use while(busy_x_motor)Sys_Sleep(1); all work, but adding movements also group calls Sys_Sleep, the compiler will not let me because it exceeds its parameters.If it solves this problem , I solved everything. I hope that I explained sufficiently The mcu is PIC18F8722. isn't enoght?
  10. The problem remain. when I have few Sys_Sleep to wait an event as // motor move motor_move(_X,position,velocity); // wait end of movement for motor X while(!x_busy)Sys_Sleep(1); During this wait, the processor send his status to serial port, fill the treatment tank, decrement any elapsed time for process. I can't block these flows All work fine but not is possible increment Sys_Sleep infinity and, in my program, there are many calls to the motors. we need an alternative to handle this problem, use other tasks, use semaphores or some other devilish otherwise be forced to return to superloop and I would not. I need a council resolution, and I thank those who cooperated and who gives me any other one. Babos
  11. Yes you mentioned you had it working in Basic as a superloop. *HOW* does the PIC report to the computer? It *may* be possible to put the reporting in an interrupt routine and avoid the need for NOVO at all! What's the interface and the message format? pic transmint a status of 64 byte @115200b/s any 250/500ms
  12. in fact I can avoid Sys_Sleep engines, waiting to do their movements and with a simple "while (! motor_busy);" but the computer requires the machine status every 500ms;during which I was lacking.
  13. Sorry IanM, if I try to regroup Sys_Sleep like you suggested, I get a compiler error which does not have sufficient resources. but I made some progress. for example I've modified this task without Sys_Sleep, because not necessary. ////////////////////////////////////////////// // Task Analysis Primary ////////////////////////////////////////////// void Task1() { //Update while( 1 ) { if (i_start) // Start primary analysis { flg_switch_analysis = 0; i_sequence = i_sequence_buffer[i_sscan]; // load current sequence if (i_sequence > 0) // sequence not zero then perform analysis { // if the first time, before perform one empty treatment tank if(!first_time_analysis)empty_treatment_tank(); _asm nop; switch (i_sequence) { case 1: // Application from parking movement = 3; while (movement>0)goto exit1; break; case 2: // Migration from Application movement = 4; while (movement>0)goto exit1; break; case 4: // Denaturation from Migration movement = 5; while (movement>0)goto exit1; break; case 6: // Staining from denaturation movement = 6; while (movement>0)goto exit1; break; case 7: // Destaining from Staining movement = 7; while (movement>0)goto exit1; break; case 8: // Destaining from destain movement = 8; while (movement>0)goto exit1; break; case 10: // Drying from destain/wash movement = 10; while (movement>0)goto exit1; break; case 11: // Scan from drying movement = 11; while (movement>0)goto exit1; break; case 30: // Scan from drying movement = 30; while (movement>0)goto exit1; break; } } else { i_start = 0; // end analysis } } else { i_sequence = 0; // reset i_sequence variable purge_buffer(0); // clear session buffer i_sscan = 0; // reset index for sequences buffer } exit1: // Sys_Sleep( 1 ); } } well now I try to replicate an analysis secondary in another task but I think that the resources are few. Let you know. Regards.
  14. Ok. IanM I try to save all possible yield point , thank's, Babos
  15. The linker serious warning is there because unless you take special precaution you have a chance of corruption, and that seems to be what you are experiencing. If you post the code on the forum, then we all can take a look. Regards Dave I understood the problem but I do not know how to fix it. I absolutely have to avoid the program remains in the task while waiting for an event it will push ahead. This is a summary code: ////////////////////////////////////////////// // Task that processes UART data ////////////////////////////////////////////// void Task0() { //This take will receive data while( 1 ) { /* Wait for serial data to come. This is a blocking call that will yield if no data is available */ unsigned char data = Rx(); if (rxTail == 4) { nchar = data + 1; // acquire number of char(s) to read } // if((data == 0x1B) && (nchar == 0x00) ) // wait (esc) { // Perform 8bits CRC from received command string unsigned char sum = 0; bit crc = 0; // Set result OK unsigned char count_crc = RxBuffer[3]+3; for(unsigned char i=0;i<count_crc;i++) { sum = (sum + RxBuffer[i]) & 0xFF; } if(sum != RxBuffer[count_crc])crc = 1; switch (crc) { case 0: // ACK decode_string(); // Decode String from host break; case 1: // NACK send_nak(); // unknowing command or string, send NAK } rxTail = 0; rxHead = 0; } nchar--; } } /********************************************************************************/ // Decoding command string from host / /********************************************************************************/ void decode_string(void) { switch (RxBuffer[1]) { case 0x00: // Send Status IG26 send_status(); break; /* other CASE */ // Retrieve parameters information for current analysis i or ii case 0xB0: // analysis i for(i=0;i<48;i++) i_analysis_buffer[i] = RxBuffer[i]; // populate parameters buffer i_analysis for(i=48;i<62;i++) i_sequence_buffer[i-48] = RxBuffer[i]; // populate sequences buffer i_analysis i_start = 1; // sound advice acoustic_signal = 0; // start analysis acoustic_signal_start = 1; // activation of sound send_status(); break; case 0xB1: // analysis ii for(i=0;i<48;i++) ii_analysis_buffer[i] = RxBuffer[i];// populate parameters buffer ii_analysis for(i=48;i<62;i++) ii_sequence_buffer[i-48] = RxBuffer[i];// populate sequences buffer ii_analysis ii_start = 1; // sound advice acoustic_signal = 0; // start analysis acoustic_signal_start = 1; // activation of sound send_status(); break; } _asm nop; } Now there are two task that performing the movement controls and sequence ////////////////////////////////////////////// // Task Analysis Primary ////////////////////////////////////////////// void Task1() { // while( 1 ) { static unsigned char i_sscan = 0; if (i_start) // Start primary analysis { flg_switch_analysis = 0; i_sequence = i_sequence_buffer[i_sscan]; // load current sequence if (i_sequence > 0) // sequence not zero then perform analysis { // if the first time, before perform one empty treatment tank if(!first_time_analysis)empty_treatment_tank(); _asm nop; switch (i_sequence) { case 1: // Application from parking movement = 3; while (movement>0)Sys_Sleep(1); break; case 2: // Migration from Application movement = 4; while (movement>0)Sys_Sleep(1); break; case 4: // Denaturation from Migration movement = 5; while (movement>0)Sys_Sleep(1); break; /* OTHER CASE */ } i_sscan++; } else { i_start = 0; // end analysis } } else { i_sequence = 0; // reset i_sequence variable purge_buffer(0); // clear session buffer i_sscan = 0; // reset index for sequences buffer } // Sys_Sleep( 1 ); } } ////////////////////////////////////////////// // Task Analysis Secondary ////////////////////////////////////////////// void Task2() { // while( 1 ) { static unsigned char ii_sscan = 0; if (ii_start) // Start secondary analysis { flg_switch_analysis = 1; ii_sequence = ii_sequence_buffer[ii_sscan]; // load current sequence if (ii_sequence > 0) // sequence not zero then perform analysis { // if the first time, before perform one empty treatment tank if(!first_time_analysis)empty_treatment_tank(); _asm nop; switch (ii_sequence) { case 1: // Application from parking movement = 3; while (movement>0)Sys_Sleep(1); break; case 2: // Migration from Application movement = 4; while (movement>0)Sys_Sleep(1); break; case 4: // Denaturation from Migration movement = 5; while (movement>0)Sys_Sleep(1); break; /* OTHER CASE */ } ii_sscan++; } else { ii_start = 0; // end analysis } } else { ii_sequence = 0; // reset i_sequence variable purge_buffer(1); // clear session buffer ii_sscan = 0; // reset index for sequences buffer } // Sys_Sleep( 1 ); } } Now perform motor movement as is ////////////////////////////////////////////// // i Motor Movement ////////////////////////////////////////////// void Task3() { while( 1 ) { switch(movement) { case 3: ///////////////////////////////////////////////////////////////////////////////// // Gel Holder Application from Parking ///////////////////////////////////////////////////////////////////////////////// // Reset all Axis (security) motor_reset_all(); if (!busy_migration_group) { busy_migration_group = 1; // busy this group !!! if(!flg_switch_analysis)gelholder = i_cghld;else gelholder = ii_cghld; switch (gelholder - 1) { case 0: // gelholder 1 s = _X_GH_PARK1; break; case 1: // gelholder 2 s = _X_GH_PARK2; } // Get gelholder from parking 1 or 2 motor_move(_X,s,0); motor_move(_Y,_Y_GH_PARK,0); wait_y(); wait_x(); motor_move(_Z,_Z_GH_PARK,0); wait_z(); // electromagnet activate set_aux(arm_magnet,1); Sys_Sleep(100); // rotor electromagnet deactivate set_aux(rot_magnet,0); motor_move(_R,_rot90,0); // move gelhoder to load zone motor_move(_Z,0,0); wait_z(); motor_move(_X,_X_GH_LOAD,0); motor_move(_Y,_Y_GH_LOAD,0); wait_x(); wait_y(); motor_move(_Z,_Z_GH_LOAD,0); wait_z(); // electromagnet deactivate set_aux(arm_magnet,0); // reset plotter motor_move(_Z,0,0); motor_move(_Y,0,0); motor_move(_X,0,0); motor_reset(_R); wait_x(); wait_r(); // rotor electromagnet activate set_aux(rot_magnet,1); // Vacuum pump activate if (!flg_switch_analysis) set_pump(vacuum,i_pvac,0); else set_pump(vacuum,ii_pvac,0); // // [...] test vacuum sensor // // Get_applicator if(!flg_switch_analysis) { n_applicator = i_apps & 0x1; n_applicator += i_apps>>1 & 0x01; n_applicator += i_apps>>2 & 0x01; } else { n_applicator = ii_apps & 0x1; n_applicator += ii_apps>>1 & 0x01; n_applicator += ii_apps>>2 & 0x01; } // calculate how much applicator used in current analysis // and deposite his samples in accord with number of application for(unsigned char i=0;i<n_applicator;i++) { switch (i) { case 0: // Applicator 1 motor_move(_X,_X_APPL_PARK1,0); // sample 1/13 d = _X_DRW_POS01; break; case 1: // Applicator 2 motor_move(_X,_X_APPL_PARK2,2); // sample 14/26 d = _X_DRW_POS14; break; case 2: // Applicator 3 washing_app(0,0); // wash applicator in washing park 1 motor_move(_X,_X_APPL_PARK3,2); // sample 27/39 d = _X_DRW_POS27; } _asm nop; motor_move(_Y,_Y_APPL_PARK,0); wait_y(); wait_x(); motor_move(_Z,_Z_APPL_PARK,0); wait_z(); // electromagnet activate set_aux(arm_magnet,1); Sys_Sleep(100); // unsigned char n_appls = 0; if(!flg_switch_analysis)n_appls = i_napp;else n_appls = ii_napp; while(n_appls>0) { // start loop for number of application motor_move(_Z,_Z_DRW_TRAN,0); wait_z(); motor_move(_Y,_Y_DRW_POS,0); motor_move(_X,d,0); wait_x(); wait_y(); for(unsigned char t=0;t<3;t++) { motor_move(_Z,_Z_DRW_POS,1); // insert applicator in sample 3 times wait_z(); motor_move(_Z,_Z_DRW_POS - _Z_DRW_ALT,1); wait_z(); } motor_move(_Z,_Z_DRW_POS,1); wait_z(); // in-sample time if(!flg_switch_analysis) { i_time = i_tcp; iTime = 1; while(iTime)Sys_Sleep(1); motor_move(_Z,_Z_DRW_POS - (_Z_DRW_ALT/2),i_vpc); // out from sample at parameter "VCP" wait_z(); motor_move(_Z,_Z_DRW_POS - _Z_DRW_ALT,0); // the rest, at full velocity wait_z(); _asm nop; // Move to application point switch(i) { case 0: // first application point motor_move(_X,_X_START_APP - i_pnt0,2); break; case 1: // second application point motor_move(_X,_X_START_APP - i_pnt1,2); break; case 2: // third application point motor_move(_X,_X_START_APP - i_pnt2,2); } // application on agarose gel motor_move(_Y,_Y_APP_POS,1); wait_y(); wait_x(); // wait for previous movement motor_move(_Z,_Z_APP_POS,0); wait_z(); // Time to wait in application "TAP" i_time = i_tap; iTime = 1; while(iTime)Sys_Sleep(1); // Up applicator motor_move(_Z,_Z_DRW_TRAN + (_Z_DRW_ALT/2),i_vrc); // velocity parameter "VRC" wait_z(); motor_move(_Z,_Z_DRW_TRAN,0); // the rest, at full velocity wait_z(); // Time to wait after application "TADA" i_time = i_tada; iTime = 1; while(iTime)Sys_Sleep(1); _asm nop; } else { // Secondary analysis } // Applicator in washing parking // _X_APP_WASH_PARK_1 // _X_APP_WASH_PARK_2 // _Y_APP_WASH_PARK // _Z_APP_WASH_PARK // _Z_APP_WASH_TRAN _asm nop; switch(i) { case 0:;case 2: // WASH PARK 1,default OR in the case m_appl [...] motor_move(_X,_X_APP_WASH_PARK_1,2); motor_move(_Y,_Y_APP_WASH_PARK,0); wait_x(); wait_y(); motor_move(_Z,_Z_APP_WASH_PARK - _Z_OFS_REL,1); wait_z(); // electromagnet deactivate set_aux(arm_magnet,0); motor_move(_Z,_Z_DRW_TRAN,0); // release applicator wait_z(); break; case 1: // WASH PARK 2, motor_move(_X,_X_APP_WASH_PARK_2,2); motor_move(_Y,_Y_APP_WASH_PARK,0); wait_x(); wait_y(); motor_move(_Z,_Z_APP_WASH_PARK - _Z_OFS_REL,1); wait_z(); // electromagnet deactivate set_aux(arm_magnet,0); // release applicator motor_move(_Z,_Z_DRW_TRAN,0); wait_z(); } n_appls--; _asm nop; // Stop loop for number of application } } movement = 0; } break; case 4: ///////////////////////////////////////////////////////////////////////////////// // Migration from application ///////////////////////////////////////////////////////////////////////////////// busy_migration_group = 1; // busy this group !!! // Start Migration motor_move(_R,_rot180,0); wait_r(); // Start E.a.t. eat_init(); unsigned int v = 0; //voltage unsigned char e,p,st; // electrode, polarity if(!flg_switch_analysis){v = i_tcm; e = i_atec; p = i_apol;st = i_seat;}else{v = ii_tcm; e = ii_atec; p = ii_apol;st = ii_seat;} eat_set(v,st,p,e); // Start Migration Time if(!flg_switch_analysis) { i_time = i_tmig*60; iTime = 1; } else { ii_time = ii_tmig*60; iiTime = 1; } _asm nop; // Applicator washing switch (n_applicator) { case 3: washing_app(1,2); washing_app(0,1); break; case 2: washing_app(0,0); washing_app(1,1); break; case 1: washing_app(0,0); } motor_reset(_Z); motor_reset(_Y); motor_reset(_X); _asm nop; if(!flg_switch_analysis) {while(iTime)Sys_Sleep(10);} else {while(iiTime)Sys_Sleep(10);} // Stop E.a.t. eat_init(); // Positioning gel holder at ~100° bit skip_tada = 0; if(!flg_switch_analysis) { if(i_tada == 0)skip_tada = 1; } else { if(ii_tada == 0)skip_tada = 1; } if(!skip_tada) { motor_move(_R,2700,0); wait_r(); // Wait drain pads if(!flg_switch_analysis) { i_time = i_tada; iTime = 1; while(iTime)Sys_Sleep(1); } else { ii_time = ii_tada; iiTime = 1; while(iiTime)Sys_Sleep(1); } } motor_reset(_R); wait_r(); busy_migration_group = 0; movement = 0; break; /*OTHER CASE*/ } Sys_Sleep( 1 ); } } wait_x(); is a routine that wait pin event from other PIC that drive motors, equal to wait_y(), wait_z(), wait_r(); in the case of wait_x(): void wait_x() { while(!busy_motor_x)Sys_Sleep(1); } Furthermore, there are waiting times for certain sequences as above: i_time = i_tada; iTime = 1; while(iTime)Sys_Sleep(1); this times are decremented in another task: ////////////////////////////////////////////// // TASK perform ... Timeout ////////////////////////////////////////////// void Task5() { //Update while( 1 ) { if( 999 == ++nDivider ) // Any seconds - Sys_Sleep(1) = 1millisecond { /**************************************/ /* Time Handle for Sequences i and ii */ /**************************************/ // i if (iTime)if (i_time == 0) iTime = 0;else i_time --; } Sys_Sleep( 1 ); } } The problem is only this: If I lunch only one analysis or sequence (i_sequence) all work fine and that's all right. If I lunch the second analysis when the first is in progress, the buffer receive the right sequence but unable to implement other movements of TASK3 because task3 waiting to finish a movement of the motor or get out of a time. I need to execute a movement independent from the cycle of waiting. I try to duplicate all movement for the secondary analysis in another task but the compiler don't support many Sys_Sleep or Sys_Yield. The same program work in a superloop with PicBasicPro but not elegant and whenever any change is there to go nuts. I do not know if I explained well. is there a way out? very thank's at all. Babos
  16. I think to have many memory in a 18F8722 but this drive other 4 PIC to move stepper motor. The true problem is this : I've six task run, one of this is used to moving the four motor trought software SPI unidirectional string commands in a separate pin port. The program wait "Sys_Sleep(1)" until the control pin (one for motors) indicates that ended his movement in this manner // example for one motor motor_move(_X,position,velocity); while(!x_enable_motor)SysSleep(1); the same for the Y, Z and R motors. There are several movements of the motors while, if i use this type of code, the compiler send me the message "Error: Can't fit Avoid code boundary code in function:Sys_Yield" I did so a single call for each motor motor_move(_X_position,velocity); wait_x(); In this manner the compiler say me "Serious Warning: Possible sw stack corruption, function:'wait_x' call". however, seems to work but for some reason that I can not identify, after some time, seems (indeed do) that the program does not perform some tasks while keeping active 's interrupt and as one of the tasks and communication with the serial port, remain screwed and I can not work anymore. I state that I have not understand how to use semaphores or events that could perhaps useful to me. Any suggestions? better go on horseback? desperate househusband, Babos. p.s. David or Pavel, if I send you the code , can you take a look ?
  17. Serious Warning: Possible sw stack corruption, function:'wait_x' calls a yielding funcion (Sys_) and is called in more than one execution thread. Serious Warning: Possible sw stack corruption, function:'wait_y' calls a yielding funcion (Sys_) and is called in more than one execution thread. Serious Warning: Possible sw stack corruption, function:'wait_z' calls a yielding funcion (Sys_) and is called in more than one execution thread. Serious Warning: Possible sw stack corruption, function:'wait_r' calls a yielding funcion (Sys_) and is called in more than one execution thread. Serious Warning: Possible sw stack corruption, function:'motor_reset_all' calls a yielding funcion (Sys_) and is called in more than one execution thread. Serious Warning: Possible sw stack corruption, function:'eat_set' calls a yielding funcion (Sys_) and is called in more than one execution thread. The program work well, what should I worry about this information and how can I verify that? tank's babos
  18. Thank's Reynard, I try to study this code. Babos
  19. The message generated by SysYield function means that your code has too many Sys_Yield function calls in it. Sys_Yield is also added into the code when any Novo RTOS functions that are preceded with Sys_ are called. And here is a quote from the Novo RTOS manual, giving a hint about this error: I hope that helps. Regards Dave Effectively there are many Sys_Yield or Sys_Sleep in a program because any task must be wait certain amount of time to proceed in many part of program and must be switching the control to other task in this time. maybe I must use semaphore but I don't understand the concept unfortunally also for the event manager. The examples in the manual aren't very clarifiers, like other explanations for any novo function.... or maybe I just can not understand , sorry. Is there alternative? Thank's Babos
  20. I a "module.c" I had write a subroutine tha referred to main flow as this : // main module // #include <novocfg_pic18t6e4ts2.h> #include <novo.h> .... void pause(unsigned char t) { Sys_Sleep(t); } .... etc..... // In linked module // extern void pause(void); ... ... pause(t) This work but I think not elegant.. Sorry for my language. Hi, Babos
  21. because if I make that the compiler respond with "Error: Can't fit Avoid code boundary code in function:Sys_Yield : failure"
  22. Sorry sir. a question: During an instruction delay ("es delay_s(3)") Novo RTos polling other task or freeze his status ? thank's Babos
  • Create New...