• AVR Freaks

Helpful ReplyHot!Problem accessing pins RC3 and RD15 on DSPIC33EP128GS808

Author
didac_dsg
New Member
  • Total Posts : 5
  • Reward points : 0
  • Joined: 2019/10/09 07:24:09
  • Location: 0
  • Status: offline
2019/10/24 03:25:19 (permalink)
0

Problem accessing pins RC3 and RD15 on DSPIC33EP128GS808

Hello,
I'm using DSPIC33EP128GS808.
I'm having problems to access following pins:
  RC3 (RC3 is mapped to pin 69: PWM5L/RP51/RC3 ). 
  RD15 (RD15 is mapped to pin 73: PWM6L/RD15 ).
 
I want to access those pins as a digital output.
I'm configuring rellated TRISbits as "0" (pin is configured as output).
 
  TRISCbits.TRISC3 = 0;
  TRISDbits.TRISD15 = 0;

I'm configuring RPOR11 with value 0x0000 in order to have RP51 pin as default value (which I asume it's RC3).
RPOR11=0x0000;

What configuration I'm missing??
(I cannot find on datasheet how to switch between PWM function and GPIO function).
 
Thank you very much in advance.
With best regards,
Didac
#1
du00000001
Just Some Member
  • Total Posts : 3840
  • Reward points : 0
  • Joined: 2016/05/03 13:52:42
  • Location: Germany
  • Status: offline
Re: Problem accessing pins RC3 and RD15 on DSPIC33EP128GS808 2019/10/25 07:22:24 (permalink)
0
Do you have the PWM enabled ?

PEBKAC / EBKAC / POBCAK / PICNIC (eventually see en.wikipedia.org)
#2
ric
Super Member
  • Total Posts : 27972
  • Reward points : 0
  • Joined: 2003/11/07 12:41:26
  • Location: Australia, Melbourne
  • Status: offline
Re: Problem accessing pins RC3 and RD15 on DSPIC33EP128GS808 2019/10/25 14:11:18 (permalink) ☄ Helpfulby mpgmike 2019/10/26 06:08:42
0
didac_dsg
...
What configuration I'm missing??
(I cannot find on datasheet how to switch between PWM function and GPIO function).

Did you notice the PENH and PENL bits in the IOCONx register?
(Page 207 of datasheet rev C) http://ww1.microchip.com/downloads/en/DeviceDoc/dsPIC33EPXXXGS70X-80X-Family-Data-Sheet-DS70005258C.pdf
 

I also post at: PicForum
Links to useful PIC information: http://picforum.ric323.co...opic.php?f=59&t=15
NEW USERS: Posting images, links and code - workaround for restrictions.
To get a useful answer, always state which PIC you are using!
#3
didac_dsg
New Member
  • Total Posts : 5
  • Reward points : 0
  • Joined: 2019/10/09 07:24:09
  • Location: 0
  • Status: offline
Re: Problem accessing pins RC3 and RD15 on DSPIC33EP128GS808 2019/10/29 08:07:54 (permalink)
0
Hello,
 
Yes, PWM it's enabled. (I don't need to use PWM5 and PWM6).
 
With best regards,
Didac 
#4
didac_dsg
New Member
  • Total Posts : 5
  • Reward points : 0
  • Joined: 2019/10/09 07:24:09
  • Location: 0
  • Status: offline
Re: Problem accessing pins RC3 and RD15 on DSPIC33EP128GS808 2019/10/29 08:16:04 (permalink)
0
ric
didac_dsg
...
What configuration I'm missing??
(I cannot find on datasheet how to switch between PWM function and GPIO function).

Did you notice the PENH and PENL bits in the IOCONx register?
(Page 207 of datasheet rev C) http://ww1.microchip.com/downloads/en/DeviceDoc/dsPIC33EPXXXGS70X-80X-Family-Data-Sheet-DS70005258C.pdf
 


Hello,
 
Thank you very much.
I didn't notice this register.
 
I will try again programming correctly this register and inform you about result.
 
With best regards,
Didac
#5
didac_dsg
New Member
  • Total Posts : 5
  • Reward points : 0
  • Joined: 2019/10/09 07:24:09
  • Location: 0
  • Status: offline
Re: Problem accessing pins RC3 and RD15 on DSPIC33EP128GS808 2019/11/05 10:11:21 (permalink)
0
Hello,
 
I have now configured related PENx bits.
 
Now it's working. I can now control RC3 and RD15.
:D
 
Thank you very much. (I really struggled with this for many hours without success... I didn't notice about these registers).
 
With best regards,
Didac
#6
Jump to:
© 2020 APG vNext Commercial Version 4.5