View previous topic :: View next topic |
Author |
Message |
makito013
Joined: 27 Mar 2018 Posts: 2
|
PIC 18F27K40 RDA does not work |
Posted: Tue Mar 27, 2018 12:13 pm |
|
|
I am doing a project and unfortunately to change the project pic to the PIC18F27K40 the RDA stopped working, I tried to carry out a new project only with the RDA turning on an LED and it still does not work, could anyone help me?
Quote: | Português-BR:
Estou realizando um projeto e infelizmente ao troca o pic do projeto para o PIC18F27K40 o RDA parou de funcionar, tentei realizar um novo projeto somente com a RDA acendendo um LED e mesmo assim não funciona, alguém poderia me ajudar? |
Code: main.c
Code: |
#include <main.h>
#INT_RDA
void RDA_isr(void)
{
output_toggle(PIN_B4);
}
void main()
{
enable_interrupts(INT_RDA);
enable_interrupts(GLOBAL);
while(TRUE)
{
}
}
|
Code:main.h
Code: |
#include <18F27K40.h>
#device *ADC=10
#FUSES NOWDT //No Watch Dog Timer
#FUSES NOEXTOSC //External Oscillator not enabled
#FUSES NOBROWNOUT //No brownout reset
#FUSES NOLVP //No low voltage prgming, B3(PIC16) or B5(PIC18) used for I/O
#use delay(internal=64MHz)
#use rs232(baud=9600,parity=N,xmit=PIN_C6,rcv=PIN_C7,bits=8,stream=PORT1,enable=PIN_C5)
|
|
|
|
gaugeguy
Joined: 05 Apr 2011 Posts: 303
|
|
Posted: Tue Mar 27, 2018 12:29 pm |
|
|
You are going to need to use #pin_select. This processor uses pps and there is a sticky at the top of the forum page detailing its use. |
|
|
makito013
Joined: 27 Mar 2018 Posts: 2
|
|
Posted: Tue Mar 27, 2018 12:57 pm |
|
|
gaugeguy wrote: | You are going to need to use #pin_select. This processor uses pps and there is a sticky at the top of the forum page detailing its use. |
could you give me an example? |
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19520
|
|
Posted: Tue Mar 27, 2018 1:24 pm |
|
|
The example is in the post at the top of the forum.....
<http://www.ccsinfo.com/forum/viewtopic.php?t=55097>
For your chip:
Code: |
#PIN_SELECT U1RX=PIN_C7
#PIN_SELECT U1TX=PIN_C6
#use rs232(baud=9600,parity=N,UART1,bits=8,stream=PORT1,enable=PIN_C5)
|
|
|
|
|