UART1 problem with dspic33fj128gp202

General discussion on mikroBasic PRO for dsPIC30/33 and PIC24.
Post Reply
Author
Message
Alastur
Posts: 6
Joined: 16 Apr 2010 16:00

UART1 problem with dspic33fj128gp202

#1 Post by Alastur » 28 Sep 2010 10:32

Hi to all,

I'm using dspic33fj128gp802 that works ok with 10Mhz xtal with pll x 8 (40 Mips) and max232 to interact with the uart1 pins that worked ok with my 18f projects.

The first Uart1_Write_text command works ok, but i can't see anything more of the serial data i'm providing to the dspic through the rp3 at 9600bps or other baud rates at which I have also tested.

Could you help me ?, is very important.

Here is a minimal code:

Code: Select all

program UART1_TEST

dim recibido as char

main:
'xtal hs 10 Mhz, PLL x 8
CLKDIV.0=0 CLKDIV.1=0 CLKDIV.2=0 CLKDIV.3=0 CLKDIV.4=0
PLLFBD=30'
CLKDIV.6=0 CLKDIV.7=0

ADP1CFG = 0xFFFF ' all digital
TRISB.3=1  ' as input for uart1 read
TRISB.6=0 '  as output for uart1 write

Unlock_IOLOCK()
PPS_Mapping(6, _OUTPUT, _U1TX) 'mapping rp6 as uart1 output
PPS_Mapping(3, _INPUT, _U1RX) ' mapping rp3 as uart1 input
Lock_IOLOCK()

UART1_Init(9600)
delay_ms(100)

Uart1_Write_text("Start receiving:")
Uart1_Write(10)
Uart1_Write(13)

while true
     if (UART1_Data_Ready() <> 0) then     ' If data is received,
           recibido = UART1_Read()         '   read the received data,
           UART1_Write(recibido)            ' and write
     end if
wend
end.

Thanks in advance

gsmcolect
Posts: 3
Joined: 05 Feb 2011 21:06

Re: UART1 problem with dspic33fj128gp202

#2 Post by gsmcolect » 28 Feb 2011 21:21

Strange i have similar situation
i can only transmit data
but nothing received
this happen with PIC24HJ64 AND PIC16F1826 :(

With PIC24J work ok

gsmcolect
Posts: 3
Joined: 05 Feb 2011 21:06

Re: UART1 problem with dspic33fj128gp202

#3 Post by gsmcolect » 02 Mar 2011 18:01

ok
problem solved

PIC16F1826 switched to digital pins
PIC24HJ64 enable/disable peripheral pin bit switched

stupid isn't it :lol:

richcj10
Posts: 29
Joined: 15 Aug 2012 13:51

Re: UART1 problem with dspic33fj128gp202

#4 Post by richcj10 » 16 Aug 2012 02:47

How did you fix this?
Thanks,

Rick

Post Reply

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