PIC24FJ64GA002 configure PPM

General discussion on mikroC for dsPIC30/33 and PIC24.
Post Reply
Author
Message
ctef
Posts: 6
Joined: 18 Nov 2009 15:14

PIC24FJ64GA002 configure PPM

#1 Post by ctef » 18 Nov 2009 15:38

'll Show how to properly configure the Peripheral Pin Select this microcontroller
for example, to configure UART1, where the TX output RP15 and RX RP14.
How to Edit Project add flag IOL1WAY
I apologize for my English. :oops:

ctef
Posts: 6
Joined: 18 Nov 2009 15:14

#2 Post by ctef » 19 Nov 2009 13:43

anyone else is doing?

jpc
Posts: 1986
Joined: 22 Apr 2005 17:40
Location: France 87

#3 Post by jpc » 19 Nov 2009 14:27

Au royaume des aveugles, les borgnes sont rois.

ctef
Posts: 6
Joined: 18 Nov 2009 15:14

#4 Post by ctef » 19 Nov 2009 18:31

Thanks for the link! but how to do it on mikroC
procedure PPS_Set_Input (funct_in, pps_port: word);
procedure PPS_Set_Output (funct_out, pps_port: word);

jpc
Posts: 1986
Joined: 22 Apr 2005 17:40
Location: France 87

#5 Post by jpc » 19 Nov 2009 18:42

you will have to convert this little library yourself, should not be a problem, it is very straightforward. You mentioned in your original mail the IOL1WAY flag, this you will have to add to the definitionfile of this PIC. Soon there should be updated definitionfiles for many new devices when the pro compilers appear, i expect these fixes to be part of those.
Au royaume des aveugles, les borgnes sont rois.

ctef
Posts: 6
Joined: 18 Nov 2009 15:14

#6 Post by ctef » 19 Nov 2009 19:34

Thank you install IOL1WAY flag I could.
'll Show how to configure the PPS

Berkl
Posts: 124
Joined: 05 May 2009 13:09
Location: Russia
Contact:

#7 Post by Berkl » 20 Nov 2009 07:10

Hi,
Look, how I make it for my P24FJ64GA002:

// Unlock sequence
OSCCON = (OSCCON & 0xFF00) | 0x0046;
OSCCON = (OSCCON & 0xFF00) | 0x0057;
OSCCON &= 0xFFBF;


RPINR19 = 0x000E; //UART2 rx on pin rb14
RPOUTR7 |= 0x0500; //UART2 tx on pin rb15

RPINR18 = 0x0005; //UART1 rx on pin rb5
RPOUTR1 = 0x0300; //UART1 tx on pin rb3


RPOUTR3 = 0x0800; //SPI1 SCK out on pin rb7
RPOUTR4 = 0x0007; //SPI1 data out on pin rb8
RPINR20 = 0x0009; //SPI1 data input on pin rb9

//Lock sequence
OSCCON = (OSCCON & 0xFF00) | 0x0046;
OSCCON = (OSCCON & 0xFF00) | 0x0057;
OSCCON |= 0x0040;

It's work good

Have a nice day

ctef
Posts: 6
Joined: 18 Nov 2009 15:14

#8 Post by ctef » 20 Nov 2009 14:16

Thank you very much! :)

Post Reply

Return to “mikroC for dsPIC30/33 and PIC24 General”