Jump to content


  • Content Count

  • Joined

  • Last visited

Community Reputation

0 Neutral

About MarkS

  • Rank
  • Birthday 01/13/1949

Contact Methods

  • AIM
  • Website URL
  • ICQ

Profile Information

  • Location
    Chuluota Florida
  • Interests
    Jazz, gardening,woodworking,food!!
  1. I did resolve the problem by getting rid of all the 'else if' statements and converting it to a 'switch'. I'm assuming the else if was pushing to the stack?
  2. Here is a section of my code: else if (msg_type[2] == 'T' && msg_type[3] == '4') { IQ_msg_type = IQT4; while(print_flag != 0); print_flag = PP; SysSignalSemaphoreIsr(hSemaphore); } else if (msg_type[2] == 'T' && msg_type[3] == '5') // this one is the problem { IQ_msg_type = IQT5; while(print_flag != 0); print_flag = PP; SysSignalSemaphoreIsr(hSemaphore); } else if (msg_type[2] == 'T' && msg_type[3] == '6') { IQ_msg_type = IQT6; while(print_flag != 0); print_flag = PP; SysSignalSemaphoreIsr(hSemaphore); } There are 8 of these 'else if' statements. All of them work fine except '5'. When it executes the SyssignalSemaphoreISR call the program resets. By single stepping and watching the program counter, it totally went to the wrong place.. This code has been running for months.. I am making some additions to the program but I everything else works. I'm lost. Any Ideas? thanks, mark
  3. Thanks Reynard. Yes, I've just completely eliminated 'strcpy' from everything. I wrote my own and I'm using it as an 'inline' function to make sure there's no tug-of-war. I do actually run these tasks at the same priority but I don't want to rely on that always being the case.
  4. This warning is not one not to dismiss.Disable interrupts around any calls to strcpy would prevent the corruption, but the warning will still be displayed. My recommendation is to write you own function to do this job and call that instead of the supplied library version. Regards Dave Thanks Dave. I built my own 'INLINE' function for the interrupt handler and the error is gone. I do still call 'strcpy' from two other tasks. Since I'm not getting an error anymore I'm assuming I'm ok now? thanks, mark
  5. I get this error: Building CASM file Serious Warning: Possible sw stack corruption, function 'strcpy' called by more than one asynchronous thread (main/Task, interrupt, interrupt low) Memory Usage Report =================== RAM available:1536 bytes, used:790 bytes (51.5%), free:746 bytes (48.5%), Heap size:746 bytes, Heap max single alloc:127 bytes ROM available:32768 bytes, used:15428 bytes (47.1%), free:17340 bytes (52.9%) I do use 'strcpy' in two tasks and in my interrupt routine. Do I need to write my own 'inline' function for this or is there another way around the problem?
  6. Fred. There's no problem here. Put your source files in a new directory(or not).Open MPLAB, start a new project(project(new)), give it a name, tell it the directory where your files are located. This will create the project. Now add your files. You'll need to make sure you point MPLAB to your compiler and linker(project(add language toolsuite)). Ctrl+F10(build)Hope this helps.
  7. Peter thanks so much for this posting. I've been out of the business for 12 years now and I was really struggling trying to get a handle on PIC programming. I ported your application to a PIC18F4520 and it forced me to study the interrupts, timers, ADC usage and of course NOVORtos. I have it all running, still playing with timers a little trying to get accurate clocks. Pavel and David -- Great Job!!! Thanks again, mark
  8. YES!!!! I'm having the same problem for a PIC18F4520 on picdem2plus. Just one small working file as an example would be SO helpful....
  9. I've been out of touch for awhile. My last embedded job was on a 6809! I've been able to get all the demos working but the serial test is giving me fits. I think I just understand some basics. I'm running a PIC18F4520 with ICD2 and MPLAB 7.60 and a Picdem2plus. My program is hanging in the KBHIT function.. I'm using COM1 and hyperterminal. Any thoughts? All help is appreciated. thanks, mark
  • Create New...