Jump to content

Mios allways reboot after 3 seconds


toxictv101
 Share

Recommended Posts

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.

Link to comment
Share on other sites

  • 3 weeks later...

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

Link to comment
Share on other sites

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 :)

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

  • 3 weeks later...

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 init

it was like a 2 For loops that flashed led in a fashion way like 100 time when mios started

i simply removed all these unusual thing and everything work well now

Link to comment
Share on other sites

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
__ENDASM

In 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.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...