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.

problem with dspic33fj128gp202 simple code

Status
Not open for further replies.
If you require a RS-232 connection, any terminal emulation software, Hyperterminal, Putty, Realterm, etc, would suffice.

I prefer Putty, which is available for free download:

PuTTY Download Page

However, ensure there is a proper RS-232 transceiver, like MAX232 or appropriate version for the dsPIC operating voltage, is utilized and do not directly connect the USART lines to the PCs serial port.

Otherwise the dsPIC maybe severely damaged.


BigDog
 

I used putty for networking long time ago but how to use it for this application????????

Furthermore i used dspic33fj128mc802 (coming with the kit) and max232in. (microcontroller use 3.3v i need to put the same supply for the max232 or to use 5V?)
 

I used putty for networking long time ago but how to use it for this application????????

Simply click the Serial radio button and enter the proper COMx port designation along with the BAUD rate.



Furthermore i used dspic33fj128mc802 (coming with the kit) and max232in. (microcontroller use 3.3v i need to put the same supply for the max232 or to use 5V?)

If the dsPIC operation voltage is 3.3v then the MAX3232 would be a more appropriate choice, however I have seen the MAX232 utilized in designs operating at 3.3v.

However, ensure the proper capacitor values are used as per the devices datasheet.

The RS-232 transceiver should typically be supplied the same voltage level as the device to which it is attached (dsPIC).


BigDog
 

And how to choose the baud rate?
 

The BAUD rate is dependent on the UART settings, not all BAUD rates are viable for a given FOSC due to a high percent error.

Typically BAUD rates with higher than a 1% error are unreliable at best or unobtainable at worst, >2% error.

Refer to the device datasheet or family reference guide for an appropriate BAUD rate for a given FOSC.


BigDog
 

I used the code bellow but i can't see anything to the pc's screen. There is any problem with my code?

#include "p33FJ128MC802.h"
#include <stdio.h>
#include <libpic30.h>
#define FCY 40000000UL // FCY = FOSC/2 = 80Mhz / 2 = 40Mhz
#define __delay_ms(d) __delay32( (unsigned long) (d)*(FCY/1000))

_FOSCSEL(FNOSC_FRC);
_FOSC(FCKSM_CSECMD & OSCIOFNC_OFF & POSCMD_XT);
_FGS(FWDTEN_OFF);
_FWDT(GCP_OFF );
int main()
{
TRISA = 0; // Set all port D pins as outputs

// Setup UART - most default options are fine
U1BRG = 48; // 38400 baud @ 30 MIPS
U1MODEbits.UARTEN = 1; // Enable UART

while(1)
{
printf("Hello\r\n"); // Send text via UART
_LATA0 = 1 - _LATA0; // Toggle LED on
__delay32(30000000); // 1 second delay
}

return 0;
}
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top