Author Topic: SOLVED: dsPIC33.... Initial Programming  (Read 1142 times)

0 Members and 1 Guest are viewing this topic.

Offline NivagSwerdnaTopic starter

  • Super Contributor
  • ***
  • Posts: 2507
  • Country: gb
SOLVED: dsPIC33.... Initial Programming
« on: May 22, 2020, 04:38:26 pm »
So I populated my dsPIC33EV256GM006 board and attached a PICKit3 and found it could not read the device ID...

My PGC and PGD are connected to PGEC2 and PGED2 respectively.

I had naively considered that the device would be clever enough to spot PGC and PGD on any of PGEC1,2,3 or PGED1,2,3?

Do I need to program FICD ICD Channel bits before PGEC2,D2 will be functional?  Is the default well known?
« Last Edit: May 22, 2020, 06:58:21 pm by NivagSwerdna »
 

Offline voltsandjolts

  • Supporter
  • ****
  • Posts: 2549
  • Country: gb
Re: dsPIC33.... Initial Programming
« Reply #1 on: May 22, 2020, 06:00:13 pm »
With a blank device the defaults are PGEC1 PGED1 - thereafter selectable in configuration bits that are loaded from top of program FLASH.
 
The following users thanked this post: NivagSwerdna

Offline jaromir

  • Supporter
  • ****
  • Posts: 344
  • Country: sk
Re: dsPIC33.... Initial Programming
« Reply #2 on: May 22, 2020, 06:17:05 pm »
For programming, all PGEC/PGED pairs are always active.
For debugging, only pair selected by config bits is active.
 
The following users thanked this post: NivagSwerdna

Offline NivagSwerdnaTopic starter

  • Super Contributor
  • ***
  • Posts: 2507
  • Country: gb
Re: dsPIC33.... Initial Programming
« Reply #3 on: May 22, 2020, 06:53:42 pm »
I was doubting myself... but kept at it and found my problem was a poor connection on VCAP.

Connecting to MPLAB PICkit 3...

Currently loaded firmware on PICkit 3
Firmware Suite Version.....01.56.07
Firmware type..............dsPIC33E/24E

Programmer to target power is enabled - VDD = 5.000000 volts.
Target device dsPIC33EV256GM006 found.
Device Revision ID = 4006

That's a relief.

ICD Channel bits can then be programmed.

My limited understanding is that for debugging you might have to change the defaults to be correct but for programming you can get away with it which was my assumption.... and happily it works.
 

Offline JPortici

  • Super Contributor
  • ***
  • Posts: 3573
  • Country: it
Re: dsPIC33.... Initial Programming
« Reply #4 on: May 22, 2020, 06:58:03 pm »
Was already confirmed by others but yeah, program on any pair, debug only on the selected pair.
But don't be a fool and rely on assumptions, read the datasheet and spare yourself some problems..
 
The following users thanked this post: NivagSwerdna

Online SiliconWizard

  • Super Contributor
  • ***
  • Posts: 15800
  • Country: fr
Re: SOLVED: dsPIC33.... Initial Programming
« Reply #5 on: May 22, 2020, 07:06:45 pm »
As the OP finally found out, it was not a matter of using the wrong signal pair. As they said the probe was unable to read the device ID, it was just not (at this point) trying to debug anything. It failed at the identification step, which is a common first step for programming and debugging. Failing to read the device ID, if the probe works fine, is usually a hardware problem on the PIC's side.

Never had this issue with a bad connection to the VCAP capacitor, but had this with a bad connection to AVDD.
« Last Edit: May 22, 2020, 07:09:22 pm by SiliconWizard »
 
The following users thanked this post: NivagSwerdna

Offline NivagSwerdnaTopic starter

  • Super Contributor
  • ***
  • Posts: 2507
  • Country: gb
Re: dsPIC33.... Initial Programming
« Reply #6 on: May 22, 2020, 07:08:42 pm »
read the datasheet and spare yourself some problems..
I consider the datasheet a bit ambiguous on this topic.  My interpretation was...

s27.6
Any of the following three pairs of programming clock/
data pins can be used:
• PGEC1 and PGED1
• PGEC2 and PGED2
• PGEC3 and PGED3

but it doesn't explictly state anywhere if that is affected by configuration bits.


But don't be a fool and rely on assumptions
#BeKind Give me a break; this board was designed weeks ago it's only now I doubt myself.

 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf