Help PPS_Mapping PIC24EP512GU814

General discussion on mikroC PRO for dsPIC30/33 and PIC24.
Post Reply
Author
Message
tyzanu
Posts: 182
Joined: 21 Aug 2011 17:27
Contact:

Help PPS_Mapping PIC24EP512GU814

#1 Post by tyzanu » 31 Jul 2013 09:16

I config Uart but fail... the documentation says RP pins are input / output and input pins are just RPI, but not warking, in terminal write 10 characters and so.
Thanks in advance...

Code: Select all

char uart_rd;
void main(void)
{
  // Setting output frequency to 140MHz
  PLLFBD = 68;             // PLL multiplier M=70
  CLKDIV = 0x0000;         // PLL prescaler N1=2, PLL postscaler N2=2

  // Setring USB frequency to 48MHz
  // Using primary oscillator (8MHz) with APLL
  ACLKCON3 = 0xB4C1;       // Use primary oscillator (8MHz), APLL prescaler N1=2, APLL postscaler N2=2
  ACLKDIV3 = 0x0007;       // APLL multiplier M=24

  ANSELA = 0x00;           // Convert all I/O pins to digital
  ANSELB = 0x00;
  ANSELC = 0x00;
  ANSELD = 0x00;
  ANSELE = 0x00;
  ANSELG = 0x00;
  
  PPS_Mapping(75, _INPUT,  _U1RX);// Sets pin RP98 to be Input, and maps U1RX to it
  PPS_Mapping(76, _OUTPUT, _U1TX);// Sets pin RP104 to be Output, and maps U1TX to it


  UART1_Init(9600);// initialize UART1 module
  Delay_ms(100);
  Uart1_Write_Text("uart1 ");
  
  while (1) 
   {                     // Endless loop
    if (UART1_Data_Ready()) {     // If data is received
      uart_rd = UART1_Read();     // read the received data
      UART1_Write(uart_rd);       // and send data via UART
    }
   }
}
Attachments
PPS_Mapping.zip
(4.8 KiB) Downloaded 126 times

User avatar
milos.vicentijevic
Posts: 965
Joined: 23 Apr 2013 08:09

Re: Help PPS_Mapping PIC24EP512GU814

#2 Post by milos.vicentijevic » 02 Aug 2013 15:13

Hello,

please check out this post:

http://www.mikroe.com/forum/viewtopic.p ... 90#p194807

Best Regards,
Milos Vicentijevic

Post Reply

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