Menu

ff uart problem on pic33512mu810

ronny suy
2018-03-06
2018-03-08
  • ronny suy

    ronny suy - 2018-03-06

    Hi

    I'm trying to get ff working on this controller , but no real succes.
    The tx line is working , pressing reset shows the welcome message.
    However on the rx side no characters are shown on the terminal.
    They are however present , checked it with a scope
    It's a clicker 2 board from mikroe.com
    I have a pic33ep256gp502 running on ff and its working fine.
    I' ve changed the p33e_config.inc as follows :

    ; Map UART1 pins
    .ifdecl RPINR18

    ;.equ RPINR18VAL, 43 ; U1RXPIN RP43 PB11 pin22 microstickplus
    ;.equ U1_RPO_REGISTER, RPOR4 ; RP42 PB10 pin21 microstickplus
    ;.equ U1_RPO_VALUE, 0x0001 ; UART1 TX on RP42 pin
    ;.equ U1RTSPORT, LATB
    ;.equ U1RTSTRIS, TRISB
    ;.equ U1RTSPIN, 12

    .equ RPINR18VAL, 86 ; U1RXPIN RP86
    .equ U1_RPO_REGISTER, RPOR6 ; RP85
    .equ U1_RPO_VALUE, 0x0001 ; UART1 TX on RP85 pin
    .equ U1RTSPORT, LATB
    .equ U1RTSTRIS, TRISB
    .equ U1RTSPIN, 12

    .endif

    what could I be missing.
    AFAIK there are now great differences between the 2 chips.

    Any suggestions are welcome !

    Ronny

     
  • ronny suy

    ronny suy - 2018-03-07

    Hi to all

    I found the reason why rx didn't work (after 2 long evenings debugging :-( )

    I used the RE6 port for Rx , but this pin has an analog function as well
    By default the ansel registers are set to ffff meaning that the analog function is active instead of the digital function.
    By using anaother pin without analog function (RD11) the rx function of usart1 worked !

    Maybe Michael can write a patch for this , although I will try it myself

    Regards
    Ronny

     
  • Mikael Nordman

    Mikael Nordman - 2018-03-08

    Good that you found it.
    Which ANSEL registers does that chip have ?

     
  • ronny suy

    ronny suy - 2018-03-08

    Hi Mikael ,
    It has ANSELA ... ANSELG
    I have declared them from A to E in the p33e_config.inc , because I've seen that you use them somewhere in the main file to clear the reg's if they are defined.
    Maybe it would be a good addendum to also include ifdef ANSELF ... , and same for ANSELG ?
    By declaring them , the rx function works fine with my intended RE6 pin :-)
    Kind regards ,

    Ronny

     

Log in to post a comment.