DSPIC33EP512MC806 PWm Reset randomlly Can some one help

General discussion on mikroPascal PRO for dsPIC30/33 and PIC24.
Post Reply
Author
Message
Damitha
Posts: 6
Joined: 10 Mar 2013 12:41

DSPIC33EP512MC806 PWm Reset randomlly Can some one help

#1 Post by Damitha » 05 Nov 2017 18:47

Im using DSPIC33EP512MC806 to drive a Stepper motor, Schematics is attached below. driver works ok at low voltages ( 15 or less ) and low currents ( 2A or less ) at higher currents or voltages the PWM module resets randomly.

can some one tell me what is the issue. design worked before with SM72295 driver IC and risistive current sensing.


PWM Modules are Init with fallowing values
PTCon: 0000
PTPER: 123A
DTR1: 03E8
ALTDTR1: 03E8
IOCON1: C000
PWMCON1: 0400
LEBCON1: FC3F
LEBDLY1: 03E8
FCLCON1: 0003
PWMCON1: 0400
TRGCON1: F000
IOCON1: C000
RCON: 0000

but after pwm stped all of them are reset to there POR values


PTCon: 0000
PTPER: FFF8
DTR1: 0000
ALTDTR1: 0000
IOCON1: 0000
PWMCON1: 0000
LEBCON1: 0000
LEBDLY1: 0000
FCLCON1: 0000
PWMCON1: 0000
TRGCON1: 0000
IOCON1: 0000
RCON: 0000


if i code the MCU to print out the values at fixed intervals i some time get response with some of them reset to POR values other have random values


Any idea what cause this ?
Firmware Developed in MikroPascal for dsPIC
Attachments
MCU2.PNG
MCU2.PNG (39.81 KiB) Viewed 3881 times
MCU1.PNG
MCU1.PNG (79.6 KiB) Viewed 3881 times
HBridge.PNG
HBridge.PNG (53.04 KiB) Viewed 3881 times

User avatar
lana.arsic
mikroElektronika team
Posts: 1715
Joined: 15 Jan 2016 12:50

Re: DSPIC33EP512MC806 PWm Reset randomlly Can some one help

#2 Post by lana.arsic » 07 Nov 2017 18:42

Hi,

Welcome to the MikroE forum.

Did you try to watch signals with oscilloscope?
If you have access, can you try to measure it from output of ACS712?

Kind regards,
Lana

Damitha
Posts: 6
Joined: 10 Mar 2013 12:41

Re: DSPIC33EP512MC806 PWm Reset randomlly Can some one help

#3 Post by Damitha » 08 Nov 2017 17:31

I did and attached is the DSO plot
Attachments
Capture.JPG
Capture.JPG (146.67 KiB) Viewed 3621 times

User avatar
lana.arsic
mikroElektronika team
Posts: 1715
Joined: 15 Jan 2016 12:50

Re: DSPIC33EP512MC806 PWm Reset randomlly Can some one help

#4 Post by lana.arsic » 10 Nov 2017 17:57

Hi,

From the image which you have sent,
it seems like some noise, it doesn't seem to be an issue.

But from your description it seems that it is hardware issue,
that something influence on MCU like voltage spikes,
so I have consulted with our developer.

You can try to place resistive load instead of motor,
i.e. instead of A and B coils to place only resistors
which could work with high current.

Then you can try to use higher current at which your system reset previously,
and if it resets again then it means that you probably have some issue with ground.

If it doesn't reset you can see that something doesn't
influence on microcontroller.

Kind regards,
Lana

Damitha
Posts: 6
Joined: 10 Mar 2013 12:41

Re: DSPIC33EP512MC806 PWm Reset randomlly Can some one help

#5 Post by Damitha » 12 Nov 2017 15:49

Any idea what is the issue with ground cos one before i tested with resistive load and it did happen.

any ideas what caould be the issue

Damitha
Posts: 6
Joined: 10 Mar 2013 12:41

Re: DSPIC33EP512MC806 PWm Reset randomlly Can some one help

#6 Post by Damitha » 13 Nov 2017 19:34

hi,

I tested with 12V blubs and it des not seems to stop. at lest till the blubs burnt out.

but it did happen ones when i turn on it for the first time, but after i reset not happen. ill test with 24V blub tomorrow.
last time i tested i noticed if i connect and disconnect the terminals ( causing a spark ) it turns off

Any ideas what could cause ?

Damitha
Posts: 6
Joined: 10 Mar 2013 12:41

Re: DSPIC33EP512MC806 PWm Reset randomlly Can some one help

#7 Post by Damitha » 14 Nov 2017 17:45

Hi
i tested today with 24V bulbs ( Risitive load )
and the driver did not turn off with them.

but with the motor alone or motor with blubs in parallel the driver turns off


Any info will really help

User avatar
lana.arsic
mikroElektronika team
Posts: 1715
Joined: 15 Jan 2016 12:50

Re: DSPIC33EP512MC806 PWm Reset randomlly Can some one help

#8 Post by lana.arsic » 15 Nov 2017 18:27

Hi,

I will consult with our developer,
and let you know about conclusion/suggestion.

Meanwhile, can you put your decoupling capacitors
as close as possible to VCC/GND?

Kind regards,
Lana

Damitha
Posts: 6
Joined: 10 Mar 2013 12:41

Re: DSPIC33EP512MC806 PWm Reset randomlly Can some one help

#9 Post by Damitha » 15 Nov 2017 19:15

decuppling caps are right under the Vcc Pins and bottom layer is used as ground power plane

Post Reply

Return to “mikroPascal PRO for dsPIC30/33 and PIC24 General”