support for dsPIC EV series?

Moderator: Benj

Post Reply
User avatar
Michael Burger
Posts: 19
Joined: Tue Jul 02, 2019 1:42 pm
Location: South Africa
Has thanked: 4 times
Been thanked: 10 times
Contact:

support for dsPIC EV series?

Post by Michael Burger »

Hello,

Does Flow8 have a boult-on for dsPIC33EV64M004, this is a 5V dsPIC and I cannot find it in the device list?


Michael

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: support for dsPIC EV series?

Post by Benj »

Hello Michael,

The compiler seems to support the device so it should be possible. I'll have a quick go at adding it for you and see how I get on.

Also moved from general programming to a more suitable place.

User avatar
Michael Burger
Posts: 19
Joined: Tue Jul 02, 2019 1:42 pm
Location: South Africa
Has thanked: 4 times
Been thanked: 10 times
Contact:

Re: support for dsPIC EV series?

Post by Michael Burger »

Ben,

Thank you! Having the EV device would make the design much easier as I don't have to level translate everything this takes up so much space on the board.


Thank again

Michael

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: support for dsPIC EV series?

Post by Benj »

Hi Michael,

Right I've now added 24 new devices in the dsPIC33EVxxGMx0x range.

These are now all available in the v8 update system and can be downloaded by clicking Help -> Check for updates and switching "Files in use" to "Full Database".

Let us know how you get on.

User avatar
Michael Burger
Posts: 19
Joined: Tue Jul 02, 2019 1:42 pm
Location: South Africa
Has thanked: 4 times
Been thanked: 10 times
Contact:

Re: support for dsPIC EV series?

Post by Michael Burger »

Ben,

Thank you very much!

I got the update, it works, I will start using it today :D





Kind Regards

Michael Burger

User avatar
Michael Burger
Posts: 19
Joined: Tue Jul 02, 2019 1:42 pm
Location: South Africa
Has thanked: 4 times
Been thanked: 10 times
Contact:

Re: support for dsPIC EV series? AN2...56 not working

Post by Michael Burger »

Please help

Flowcode 8.2.1.13 / dsPIC33EV256GM106-I

In software Flowcode simulates reading AN0-19, AN25-31, AN41-56. The hardware chip only reads AN0,1 none of the others are read.

We suspect PIC16bit_Cal_ADC.C has not been upgraded correctly to accommodate the EV series but is set for the another series dsPIC



Kind Regards

Michael

User avatar
Michael Burger
Posts: 19
Joined: Tue Jul 02, 2019 1:42 pm
Location: South Africa
Has thanked: 4 times
Been thanked: 10 times
Contact:

Re: support for dsPIC EV series?

Post by Michael Burger »

Hello Ben,

Further to the Analog issue, I decided to commission the digital side of the system while we are talking about the analog read issue but I am having problems with the PWM configuration with dsPIC33EV256GM106 and Flowcode 8.2.1.13. Is it structured as option 1 or 2 below?
Why does the pin selection in Flowcode not tie up with the datasheet chip?


(Option1) (Option2)

CHIP Default Port Default PIN Flow 8.1 Default port Flow 8.1 Default port

PWM1H1 RB14 2 Channel1 $PORTG.6 Channel1 $PORTG.6
PWM1L1 RB15 3 Channel2 $PORTG.6

PWM1H2 RB12 62 Channel3 $PORTG.6 Channel2 $PORTG.6
PWM1L2 RB13 63 Channel4 $PORTG.6

PWM1H3 RB10 60 Channel3 $PORTG.6
PWM1L3 RB11 61

?? ?? ?? Channel4 $PORTG.6
?? ?? ??


According to the datasheet the PWM module resides in port B

Of the pins selection in channel 1,2,3,(4) only RB10 & RB11 corresponds to PWM1H3 and PWM1L3

Pin selection: C0,C1,B4,B5,B6,B7,B8,B2,C6,C7,C8,D5,D6,C9,F1,B10,B11


Kind Regards

Michael

User avatar
Michael Burger
Posts: 19
Joined: Tue Jul 02, 2019 1:42 pm
Location: South Africa
Has thanked: 4 times
Been thanked: 10 times
Contact:

Re: support for dsPIC EV series?

Post by Michael Burger »

Ben,

My apologies for the PWM Pin assignment table, herewith a understandable one


Kind Regards

Michael
Attachments
dsPic33EV256GM106 PWM assignment.pdf
(386.82 KiB) Downloaded 217 times

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: support for dsPIC EV series?

Post by Benj »

Thanks Michael,

Investigating for you now.

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: support for dsPIC EV series?

Post by Benj »

Hello,

Right I beleive I have now solved the ADC issue for you. As for the PWM we are using the capture compare (CCP) based PWM and not the advanced PWM peripherals. I may be also to add support for this to add more channels but currently it is CCP only.

Let me know how you get on re the ADC.

User avatar
Michael Burger
Posts: 19
Joined: Tue Jul 02, 2019 1:42 pm
Location: South Africa
Has thanked: 4 times
Been thanked: 10 times
Contact:

Re: support for dsPIC EV series?

Post by Michael Burger »

Ben,


Thank you, it has been a long day, I will test it in the morning and let you know :D


Kind Regards

Michael Burger

User avatar
Michael Burger
Posts: 19
Joined: Tue Jul 02, 2019 1:42 pm
Location: South Africa
Has thanked: 4 times
Been thanked: 10 times
Contact:

Re: support for dsPIC EV series?

Post by Michael Burger »

Ben,


If we only have the basic CCP available how does one go about firing two pwm pulses one on the rising edge and one falling edge interlocked with a 20kHz clock, please see attached diagram.

I have spent hours and hours on this with no success.....
Attachments
PWM firing diagram.pdf
(99.75 KiB) Downloaded 214 times

User avatar
QMESAR
Valued Contributor
Valued Contributor
Posts: 1287
Joined: Sun Oct 05, 2014 3:20 pm
Location: Russia
Has thanked: 384 times
Been thanked: 614 times
Contact:

Re: support for dsPIC EV series?

Post by QMESAR »

Hi.

The dsPIC has an advanced PWM module which is capable of doing very smart things what you need is to setup the PWM module in Complementary mode
see the datasheet PWM section with that said you then need to do the configuration in a C-icon as well as writeing to the Duty cycle registers from a C-icon when needed.
:D

User avatar
Michael Burger
Posts: 19
Joined: Tue Jul 02, 2019 1:42 pm
Location: South Africa
Has thanked: 4 times
Been thanked: 10 times
Contact:

Re: support for dsPIC EV series?

Post by Michael Burger »

Ben,

Thank you, the analogue channels all works very nicely now! :D


Kind Regards


Michael Burger
Attachments
IMG-20191205-WA0007.jpeg
IMG-20191205-WA0007.jpeg (91.65 KiB) Viewed 9198 times

User avatar
Michael Burger
Posts: 19
Joined: Tue Jul 02, 2019 1:42 pm
Location: South Africa
Has thanked: 4 times
Been thanked: 10 times
Contact:

Re: support for dsPIC EV series?

Post by Michael Burger »

This is how I initialized and used the advanced high-speed PWM module with FlowCode8, thanks to QMESAR for pointing me in the direction, the various configurations and setup of IOCON, PWMCON, PTCON and FLTCON is available in the EV family datasheet. :D
Attachments
Set PWM Module dsPIC33EV.JPG
Set PWM Module dsPIC33EV.JPG (38.2 KiB) Viewed 8831 times

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: support for dsPIC EV series?

Post by Benj »

Hi Michael,

Thanks for sharing and really glad it's working well for you. :D

User avatar
Michael Burger
Posts: 19
Joined: Tue Jul 02, 2019 1:42 pm
Location: South Africa
Has thanked: 4 times
Been thanked: 10 times
Contact:

Re: support for dsPIC EV series?

Post by Michael Burger »

Ben,

I have a problem with the dsPIC33EV256GM106 resetting, I have tried to fix this by inserting the "MX_CLEAR_WATCHDOG", switching it off in config, Auto WDT [ON] and also setting the WDT window to [None]

It happens at 5min intervals with 48MHz crystal and 12min with 20MHz crystal - this is why I think it is the WDT, but I have also checked the 5V PSU and the main OSC both clear

I attach the simple FC I use to capture the Reset on RC8, some scope traces and the project build setup page

Scope trace:
Yellow = RC8 Trip
Blue = 5V PSU (very clean at trip)
Purple = 48MHz clock (very Clean at trip)


What am I doing wrong or missing? - please help


Kind Regards

Michael
Attachments
IMG-20200227-WA0008.jpg
IMG-20200227-WA0008.jpg (43.43 KiB) Viewed 8491 times
IMG-20200227-WA0002.jpg
IMG-20200227-WA0002.jpg (76.45 KiB) Viewed 8491 times
IMG-20200226-WA0009.jpg
IMG-20200226-WA0009.jpg (19.9 KiB) Viewed 8491 times

User avatar
Michael Burger
Posts: 19
Joined: Tue Jul 02, 2019 1:42 pm
Location: South Africa
Has thanked: 4 times
Been thanked: 10 times
Contact:

Re: support for dsPIC EV series?

Post by Michael Burger »

Ben,

Herewith the trace of the Clock (purple) vs Reset at RC8 (Yellow) vs 5V PSU at micro (Blue)


Kind Rgards

Michael
Attachments
IMG-20200227-WA0010.jpg
IMG-20200227-WA0010.jpg (56.72 KiB) Viewed 8491 times

User avatar
Michael Burger
Posts: 19
Joined: Tue Jul 02, 2019 1:42 pm
Location: South Africa
Has thanked: 4 times
Been thanked: 10 times
Contact:

Re: support for dsPIC EV series?

Post by Michael Burger »

Hello Ben,

I apologize for the long wait, I have been traveling / working on site.

The reset problem was caused by the "Dead Man Timer" ( _FDMT ) it is set as default Enable in FC8 -> Project Options -> Configure, if one is not looking for it specifically it is easy to miss.



Kind Regards
Michael

Post Reply