Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

explorer 16 board peripherals

Status
Not open for further replies.

gaj

Newbie level 4
Joined
Oct 29, 2012
Messages
7
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,344
Hello,

I am using Explorer 16 board. Can anybody tell me that which uart module pins are connected to the RS-232 Serial Port in explorer 16 ? I am using pic 32MX6 pim which has 6 uart modues. Is there any pcb lay out available from where I can see the pin connections of pim with the board peripherals?

Thanks.
 

Here is the Explorer 16 User's Guide: **broken link removed**

The schematics are given. On page 44, you can find the UART subsystem diagram. On page 38, you can find the connection information for the PIM socket. According to those two diagrams, UART2 is used.

Hope this helps.
Tahmid.
 
  • Like
Reactions: gaj

    gaj

    Points: 2
    Helpful Answer Positive Rating
Thanks a lot mate. Yes it did :). According to diagrams uart2 is used. So it means I can use just Uart2 in code for my pic32 while using explorer 16 ? .. and if I want to use any other uart module then what is the procedure ?

Thanks for the kind response.
 

You should use UART2 in your coding. If you want to use any other UART module, you will have to construct the MAX232 circuitry yourself by taking connections from the relevant UART pins.
 
  • Like
Reactions: gaj

    gaj

    Points: 2
    Helpful Answer Positive Rating
Thanks again :)
 

One more thing. Can you please tell me is there any ´hello world´ level code example for pic32 uart2 with explorer 16 board. I want to check how to set the basic configuartion settings. (like crystal etc)
 

.. and if I want to use any other uart module then what is the procedure?

I have several Explorer 16 boards and use them regularly to development apps.

I would recommend either fabricating or purchasing a few Prototype PICtail plus boards, which you can then implement the proper interfaces for additional UARTs.

I keep a few of the following handy for just such an occasion:

Three Units of Prototype PICtail Plus Daughter Board


Can you please tell me is there any ´hello world´ level code example for pic32 uart2 with explorer 16 board. I want to check how to set the basic configuartion settings. (like crystal etc)

The following are a few UART examples for the Explorer 16/PIC32 development boards:

Code:
/*
** SERIAL.C
** UART2 RS232 asynchronous communication demonstration code
**
*/
// configuration bit settings, Fcy=72MHz, Fpb=36MHz
#pragma config POSCMOD=XT, FNOSC=PRIPLL 
#pragma config FPLLIDIV=DIV_2, FPLLMUL=MUL_18, FPLLODIV=DIV_1
#pragma config FPBDIV=DIV_2, FWDTEN=OFF, CP=OFF, BWP=OFF

#define FCY     72000000L
#define FPB     36000000L   

#include <p32xxxx.h>

// I/O definitions for the Explorer16
#define CTS     _RF12               // Cleart To Send, input
#define RTS     _RF13               // Request To Send, output
#define TRTS    TRISFbits.TRISF13   // tris control for RTS pin

// timing and baud rate calculations
#define BRATE    (FPB/4/115200)-1   // 115200 baud 
#define U_ENABLE 0x8008	            // enable UART (BREGH=1)
#define U_TX     0x0400	            // enable transmission


// initialize the UART2 serial port
void initU2( void)
{
    U2BRG 	= BRATE;    
    U2MODE 	= U_ENABLE;
    U2STA 	= U_TX;
    TRTS    = 0;        // make RTS output
    RTS     = 1;        // set RTS default status
} // initU2


// send a character to the UART2 serial port
int putU2( int c)
{
    while ( CTS);		        // wait for !CTS, clear to send
    while ( U2STAbits.UTXBF);   // wait while Tx buffer full
    U2TXREG = c;
    return c;
} // putU2


// wait for a new character to arrive to the UART2 serial port
char getU2( void)
{
    RTS = 0;            // assert Request To Send !RTS
    while ( !U2STAbits.URXDA);	// wait for a new character to arrive
    RTS = 1;
    return U2RXREG;		// read the character from the receive buffer
}// getU2


main()
{
    char c;

    // 1. init the UART2 serial port 
    initU2();

    // 2. prompt 
    putU2( '>');
	
    // 3. main loop
    while ( 1)
    {    
        // 3.1 wait for a character
        c = getU2();

        // 3.2 echo the character
        putU2( c);		
	} // main loop
}// main


Code:
/*
** CONU2 Test
** UART2 RS232 asynchronous communication demonstration code
*/
// configuration bit settings, Fcy=72MHz, Fpb=36MHz
#pragma config POSCMOD=XT, FNOSC=PRIPLL 
#pragma config FPLLIDIV=DIV_2, FPLLMUL=MUL_18, FPLLODIV=DIV_1
#pragma config FPBDIV=DIV_2, FWDTEN=OFF, CP=OFF, BWP=OFF

#include <p32xxxx.h>
#include <stdlib.h>

#include "conU2.h"


#define BUF_SIZE 128

main()
{
    int i = RAND_MAX;
    char s[BUF_SIZE];
    
	// 1. init the console serial port 
	initU2();
	
    // 2. text prompt 
    clrscr();
    home();
    puts( "Exploring the PIC32!");
    sprintf( s, "Exploring the PIC32! %d", 17);
    puts( s);
    
    // 3. main loop
    while ( 1)
    {
        // 3.1 read a full line of text
        getsn( s, sizeof(s));
        // 3.2 send a string to the serial port
        puts( s);
    } // main loop
}// main

I have also attached a zip archive with the above and other UART examples.

You also might consider obtaining a copy of Lucio Di Jasio text:

Programming 32-bit Microcontrollers in C: Exploring the PIC32

The text covers PIC32 development using both the Explorer 16 and PIC32 as a development platform.


BigDog
 

Attachments

  • UART.zip
    5.1 KB · Views: 91
Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top