toxictv101 Posted January 27, 2008 Report Share Posted January 27, 2008 hi all,i ve got 2 pic here, and they boot reboot every 2 or 3 seconds whatever i write in the code.anybody know what is it? maby i forgot to configure something. Quote Link to comment Share on other sites More sharing options...
Durisian Posted January 27, 2008 Report Share Posted January 27, 2008 I'm sure there are lots of reasons this could happen. It's happened to me in 2 situations.1. trying to access a byte from an array that is in a location higher than the array size.eg.unsigned char array[10];array[15] = 5;2. A power short accross the AIN pins. eg: Vd connected to Vs. Quote Link to comment Share on other sites More sharing options...
toxictv101 Posted January 27, 2008 Author Report Share Posted January 27, 2008 i ve made a litle led sequence in the init fonction , so that i know when it boot.and it call this fonction every 3 secondes ... ??? Quote Link to comment Share on other sites More sharing options...
stryd_one Posted January 27, 2008 Report Share Posted January 27, 2008 i ve made a litle led sequence in the init fonction , so that i know when it boot.and it call this fonction every 3 secondes ... ???You can use the midi signal from the normal MIOS startup to do that... maybe your LED code is not working so well... Quote Link to comment Share on other sites More sharing options...
toxictv101 Posted February 11, 2008 Author Report Share Posted February 11, 2008 i notify that when i use Global variablethe core reboot all the time.maby there is an overflow somwhere or something ? Quote Link to comment Share on other sites More sharing options...
nILS Posted February 11, 2008 Report Share Posted February 11, 2008 How about posting your source code so we might be able to see what's wrong instead of guessing? Quote Link to comment Share on other sites More sharing options...
ilmenator Posted February 12, 2008 Report Share Posted February 12, 2008 It might be related to the WatchDog Timer (WDT). There is some more information in a number of other threads, this is what TK wrote:Watchdog timer: it's configured in a way which doesn't allow to enable/disable it via software. It's always enabled, and it is serviced by MIOS within the mainloop (after USER_Tick has been called)If USER_Tick stalls longer than 2 seconds, the PIC will be reset. If your routine needs longer (this is critical, >20 mS will cause a MIDI In buffer overrun if a bulk of data is received at the same time), than you have to issue a "clrwdt" instruction in order to service the watchdog, and to avoid a reset.Best regards,ilmenator Quote Link to comment Share on other sites More sharing options...
stryd_one Posted February 12, 2008 Report Share Posted February 12, 2008 Feed the watchdog. He's always hungry. ;) Seriously though, if you have to feed the watchdog, that must be a verrrry long LED function you have in the init.I'd recommend pasting the code as nilly said... if you're feeling shy, feel free to drop by the chat, and your code won't be out there for all to see... But of course, make sure you drop by here and post the solution afterwards, for future reference :) Quote Link to comment Share on other sites More sharing options...
/tilted/ Posted February 12, 2008 Report Share Posted February 12, 2008 do you have anything attached to the PICs? are they mounted on CORE boards? this sounds like classic brownout stuff.If you have the PICs mounted in CORE boards, check and double check (and then keep checking) all your connections. also make sure you have put the right components in the right places...if you have any other board connected to your CORE, try disconnecting them all, as you may have problems there, too. Quote Link to comment Share on other sites More sharing options...
toxictv101 Posted March 3, 2008 Author Report Share Posted March 3, 2008 i m realy sorry i realy dont know what did appen to my circuits.i added a led function that was a bit to long maby in the initit was like a 2 For loops that flashed led in a fashion way like 100 time when mios startedi simply removed all these unusual thing and everything work well now Quote Link to comment Share on other sites More sharing options...
stryd_one Posted March 3, 2008 Report Share Posted March 3, 2008 Toxic: As ilmenator said, that's the watchdog timer or WDT. What it does, is watch the application, and if the app seems to be stuck (if something takes too long) it resets the PIC.Obviously that's a long, long function, and it angers the watchdog. During the application's runtime it could have negative effects on timing, but in the init section of your app it should not be such a big problem. All you have to do is 'feed the watchdog' by clearing it's timer. Just insert: __ASM CLRWDT __ENDASMIn or after one of your loops... when you need to call this will depend on your app.Edit: and search the forum for CLRWDT for lots of info. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.