View previous topic :: View next topic |
Author |
Message |
wipsri
Joined: 10 May 2011 Posts: 6
|
pic18f67j94 any help |
Posted: Tue Aug 13, 2013 10:53 am |
|
|
dear forum members,
did anybody used pic18f67j94 with ccs compiler, if so is it worthful, since i need 4 usart in my application and this controller is suitable, so need help in configuring 4 usarts interrupt based.
not understanding the ppi suite.
pl help. |
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19513
|
|
Posted: Wed Aug 14, 2013 1:50 am |
|
|
First, compiler version. Can matter and should always be posted.
The interrupts are just the same no matter how many UARTs you have.
So:
Code: |
#INT_RDA3
void uart3_rxd(void)
{
//code to receive a character from UART3
}
|
What is 'ppi suite'?.
Like most later chips, this supports relocatable peripherals. So you _must_ select the pins to be used, before setting up the UART.
Syntax should be:
Code: |
#pin_select TX2=PIN_B2
#pin_select RX2=PIN_B3
#use rs232(baud=57600,parity=N,UART2,bits=8,stream=PORT2,BRGH1OK,errors)
|
Note two things. Pins are selected _first_, then the UART setup, uses the logical UART name, not the pins. This ensures you are talking to the UART, not directly to the pins.....
Problem is that if you just use the pin names, the compier does not 'know' you want to use the UART, so generates a software UART, with no interrupts....
Best Wishes |
|
|
12Lapointep
Joined: 04 Aug 2015 Posts: 16 Location: United States
|
|
Posted: Tue Aug 04, 2015 3:40 pm |
|
|
I am currently using the PIC18F67J94 for an application. I need 3 UARTs for my microcontroller and PIC18F67J94 has four of them but they are remappable. I tried using the #pin_select but I get some errors back saying that Invalid Pre-Processor Directive Invalid Pin: RP0 cannot be assigned to U1TX.
I was wondering if my compiler was working fine since there seems to be no mistake from what I have been reading. Did you figure out what the problem was for yours? |
|
|
Markdem
Joined: 24 Jun 2005 Posts: 206
|
|
Posted: Tue Aug 04, 2015 10:48 pm |
|
|
Quote: | I tried using the #pin_select but I get some errors back saying that Invalid Pre-Processor Directive Invalid Pin: RP0 cannot be assigned to U1TX. |
Are you sure PIN_RP0 is valid? Looking at my 18F67J94.h file it looks like it is not. |
|
|
|