Autor Tema: Fallo en el SPI PIC32  (Leído 969 veces)

0 Usuarios y 1 Visitante están viendo este tema.

Desconectado isfan

  • PIC16
  • ***
  • Mensajes: 145
Fallo en el SPI PIC32
« en: 23 de Marzo de 2015, 06:39:30 »
Hola haber alguien si me puede ayudar con este proyecto con la Comunicación SPI.

Este proyecto falla, ya que la interrupción de recepción no salta nunca.

 

Lo que estoy haciendo, es hacer un puente entre el MISO (Master Input Slave Output) y el MOSI (Master Output Slave Input), y de esta forma recibir lo mismo que estoy enviando.

le adjunto el proyecto en un ZIP si puede ver por lo alto y comentar lo agradeceria mucho estoy bien atascado y no encuentro soluciones



Aqui le pongo un ejemplo de SPI.C

//EVITAR LOS WARNINGS QUE SALEN SIEMPRE

#define __SUPPRESS_PLIB_WARNING 1
#define __DISABLE_OPENADC10_CONFIGPORT_WARNING 1

//------------------------------------------------------------------------------
//INCLUIR LIBRERIAS NECESARIAS PARA EL PROYECTO
#include <p32xxxx.h>
#include <plib.h>
#include "Compiler.h"
#include "Explorer 16.h"



//------------------------------------------------------------------------------
//PROGRAMA QUE REALIZA UNA COMUNICACION VIA SPI
short int DadaTx=0, DadaRx;
int main(void){
    char x=0;
    //inicialización del programa
    inicialitzacio();
    open_timer();
    inicialitzar_SPI();

    //habilitar todas las interrupciones
    habilitar_interrupcions();

    DadaTx=0x07;

    while (1){
        PORTAbits.RA0=0;
        PORTAbits.RA1=0;
        DadaRx=0;
        SpiChnPutC(SPI_CHANNEL2,DadaTx);   // send data
        //for(x=0;x<0xF;x++);
        //x=0;
    };
}


Con el que estoy trabajando.
« Última modificación: 23 de Marzo de 2015, 06:44:44 por isfan »