Hola estoy trabajando sobre un dsPIC30F3014 he hecho un sencillo programa en mplab, pero a la hora de mandar el hex me dice el programa del programador master prog que hacen falta los bit de configuración, les dejo el programa que intento enviar al dspic, alguna idea porque no se están generando los bits de configuración:
#include "p30f3014.h"
#include "libpic30.h"
_FOSC(CSW_FSCM_OFF & XT);
_FWDT(WDT_OFF);
_FBORPOR(PBOR_OFF & PWRT_16 & MCLR_DIS);
_FGS(CODE_PROT_OFF);
#define FOSC 8000000
#define PLL 1
#define BAUDRATE 19200
#define FCY FOSC*PLL/4
void Init232(void);
void Send232(int);
int Read232(void);
void Texto(char *);
/************************************************/
/* Inicializa la UART1 */
/************************************************/
void Init232(void){
U1MODE=0;
U1STA=0;
U1MODEbits.UARTEN=1; //Enable UART (implies reception)
U1BRG=25;//(((FCY/BAUDRATE) / 16) - 1); //Initialize BRG
IFS0bits.U1TXIF=0; //Clear the interrupt flag
IEC0bits.U1TXIE=0; //Disable ISR processing
U1STAbits.UTXEN=1; //Enable Transmission
}
/************************************************/
/* ENVIA RS 232 */
/************************************************/
void Send232(int envio){
while (U1STAbits.UTXBF==1){}
U1TXREG=envio;
}
/************************************************/
/* Recibe RS 232 */
/************************************************/
int Read232(void){
if (U1STAbits.URXDA==0) return(1000); // no hay dato en el buffer
return (U1RXREG);
}
/******************************************************/
void Texto(char *caracter) {//MANDA LETRAS POR PUERTO SERIE
/******************************************************/
char letra;
letra=*caracter;
while (letra!=0){
Send232(letra);
caracter++;
letra=*caracter;
}
}
int main(){
Init232();
Texto("Hola");
return 0;
}