Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[SOLVED] WATCHDOG on PIC32-PINGUINO-OTG
19-01-2013, 07:14 AM, (This post was last modified: 19-01-2013, 10:26 AM by djpark.)
#1
[SOLVED] WATCHDOG on PIC32-PINGUINO-OTG
I need to enable the watchdog on PIC32-Pinguino-OTG (PIC32MX440-256H).

I used PICKIT3 to load the bootloader from extra\bootloaders\32bit, changed the WDTPS config bits from 00000 to 01101 for 8.2 seconds watchdog timeout, then wrote it to the board. Everything went well.

The reading back of both DEVCFG1 and WDTCON confirms the WDTPS is 0x0d (01101).

But when the following test program runs, the watchdog never fires to reset the board.

Am I missing something? Can someone advise me?

Code:
void setup()
{
    pinMode(GREENLED, OUTPUT);
    pinMode(YELLOWLED, OUTPUT);

    // green led indicates pinguino reset
    digitalWrite(GREENLED, HIGH);
    delay(1000);
    digitalWrite(GREENLED, LOW);

    // enable watchdog, start full wdt period (8 seconds)
    ClearEventWDT();
    EnableWDT();
    ClearWDT();
}

void loop()
{
    // blink yellow led every second
    digitalWrite(YELLOWLED, HIGH);
    delay(500);
    digitalWrite(YELLOWLED, LOW);
    delay(500);

    // watchdog should reset pinguino due to lack of clearwdt after 8 seconds
}
Reply
19-01-2013, 09:25 AM,
#2
RE: WATCHDOG on PIC32-PINGUINO-OTG
Found something funny.

Even after installing the bootloader without changing the config bits, it doesn't trigger the watchdog. Furthermore, the RTCC interrupt is not waking the system from the idle or sleep.

Can the config for a clock source not turned on? Any advice would be appreciated.
Reply
19-01-2013, 10:26 AM,
#3
RE: WATCHDOG on PIC32-PINGUINO-OTG
At last found the problem and solution.

The similar case was mentioned in another thread here.

http://forum.pinguino.cc/showthread.php?tid=3265

The conclusion is this.

The bootloader extra\bootloaders\32bit\PIC32-Pinguino_HIDBoot_MX440.hex appears working, but it has IESO (Internal External Switch Over) turned off, and watchdog and RTCC interrupt fails to trigger.

Solution is using the bootloader from Olimex found in the above thread.

The original WDTPS is 0 and the watchdog will fire up immediately. It has to be changed to something longer such as d0 for 8,912 counts giving about 8 seconds delay.
Reply
19-06-2014, 10:10 PM, (This post was last modified: 20-06-2014, 09:11 AM by moreno.)
#4
RE: [SOLVED] WATCHDOG on PIC32-PINGUINO-OTG
Hi

Now I have a PIC programmer and even I want use WD on my PINGUINO32-MICRO.

I downloaded PINGUINO_BOOT+DEMO.hex but the problem is which I do not know how modify the values you indicate.
Can you explain me briefly how modify these flags?? (I installed MPLAB X)
Have you make a bootloader with only WD activated??


Thanks in advance

[postedit]
Found the problem.
Is necessary set IPE in advanced mode to modify CONFIG Memory
[/postedit]


Bye Bye, Moreno
Reply
23-06-2014, 06:32 AM,
#5
RE: [SOLVED] WATCHDOG on PIC32-PINGUINO-OTG
Moreno,

I am glad you got things done. I presume you use PICKit3. I use PICKit3 v3.10 instead of IPE because it gives much quicker access to the supported chip directly instead of downloading respective firmware to PICKit3.

Pinguino-OTG and Pinguino-Micro use the same PIC and same pins for leds and button, so the said bootloader for Pinguino-OTG should work on Pinguino-Micro. One thing I remember is that I had to code-protect the bootloader after loading to make the loaded WD program to work correctly though it doesn't make sense.

Olimex doesn't say about the bootloader or release source code, but I presume it is UBW32 bootloader. You may also try the modified UBW32 bootloader I uplaoded in another thread. It is squeezed to fit in to the boot flash so you get extra 20KB program flash if you change the linker file. It is still compatible with existing Pinguino linker file without using the extra flash memory.

DJ
Reply
23-06-2014, 07:55 AM,
#6
RE: [SOLVED] WATCHDOG on PIC32-PINGUINO-OTG
Hi

Yes, I bought, OLIMEX compatible PIC-KIT3 plus PIC-ICSP adapter.
Even I need a more light software but found a Beta version of PICKit3, were I can download this software??

With IPE is not necessary make code protection, the watchdog.pde test program work perfectly.


Bye Bye, Moreno
Reply
23-06-2014, 08:08 AM,
#7
RE: [SOLVED] WATCHDOG on PIC32-PINGUINO-OTG
You can get the software from Microchip web site.

http://www.microchip.com/pagehandler/en-...parts.html

DJ
Reply
23-06-2014, 03:21 PM,
#8
RE: [SOLVED] WATCHDOG on PIC32-PINGUINO-OTG
Hi

Ops, I found this list before but not scrolled to the end.

Sorry and Thanks.


Bye Bye, Moreno
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)