View previous topic :: View next topic |
Author |
Message |
E_Blue
Joined: 13 Apr 2011 Posts: 417
|
PIC24F RX2 doesn't work(SOLVED) |
Posted: Wed Feb 03, 2021 4:24 pm |
|
|
CCS v5.091
MPLAB X IDE 5.15
ICD3
PIC24FJ1024GB606
I'm trying to receive data on pin RG9 at 19200bps but get nothing.
The PIC is connected to 3.3V and the GPS at UART2 send 2.8V data.
I get not even a single interrupt
I can send data correctly but not receive; so I think that the bps are set it correctly.
2.8V is not enough?
This is a reduced code.
Code: |
#pin_select U2TX=PIN_D5
#pin_select U2RX=PIN_G9
#use rs232(UART2,stream=GPS,NOINIT)
void main()
{
output_b(0);
output_c(0);
output_d(0);
output_e(0);
output_f(0);
output_g(0);
set_tris_b(0b1001001001010110);
set_tris_c(0b0110000000000000);
set_tris_d(0b111100000011);//RTS=GSM OUT=D2 RTS=GSM_IN=D1 - RD4=SPI_DO - RD5=SPI_DI - RD6=SPI_CLK - RD7=SPI_CS
set_tris_e(0b11000011);
set_tris_f(0b10000000);
set_tris_g(0b11001000000);
SETUP_PMP(PAR_DISABLE,0);
SETUP_PSP(PAR_DISABLE,0);
SETUP_CLC1(CLC_DISABLED);
SETUP_CLC2(CLC_DISABLED);
SETUP_CLC3(CLC_DISABLED);
SETUP_CLC4(CLC_DISABLED);
SETUP_CAPTURE(1,CAPTURE_OFF);
SETUP_CAPTURE(2,CAPTURE_OFF);
SETUP_CAPTURE(3,CAPTURE_OFF);
SETUP_CAPTURE(4,CAPTURE_OFF);
SETUP_CAPTURE(5,CAPTURE_OFF);
setup_uart(GPS_BPS1,GPS);
} |
Should I configure something more? _________________ Electric Blue
Last edited by E_Blue on Wed Feb 03, 2021 4:58 pm; edited 1 time in total |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
|
E_Blue
Joined: 13 Apr 2011 Posts: 417
|
|
Posted: Wed Feb 03, 2021 4:57 pm |
|
|
It seems like I'm running in circles.
I'm the ones that need to kick the same stone twice.
Thanks. _________________ Electric Blue |
|
|
temtronic
Joined: 01 Jul 2010 Posts: 9246 Location: Greensville,Ontario
|
|
Posted: Wed Feb 03, 2021 6:19 pm |
|
|
re:
Quote: | It seems like I'm running in circles. |
Just to let you know....It gets worse the older you get !!!!! |
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19552
|
|
Posted: Thu Feb 04, 2021 1:31 am |
|
|
and the circles get smaller... |
|
|
|