Doy por hecho que la señal en MISO debería ser de 3.3V ¿no? Por favor, confírmenme esto. Porque, como les digo, el ENC28j60 funciona.
De momento no dispongo de otro osciloscopio, y el que estoy usando es el Velleman portátil de un sólo canal.
El finde probaré con mi otro osciloscopio.
Muchas gracias angel gris por confirmar mis conclusiones... ven más 4 ojos que 2.
Hemos llegado a las mismas conclusiones y, sin embargo, no funciona.
Me huelo que hay algo raro en el timing de las rutinas SPI hardware que no le gusta al CC1101... pero hasta que no tenga un osciloscopio con más canales no podré confirmarlo. A ver si el finde puedo contaros la resolución del misterio.
bit 7 SSP2IF: Master Synchronous Serial Port 2 Interrupt Flag bit
1 = The transmission/reception is complete *************(must be cleared in software)*************
0 = Waiting to transmit/receiveTABLE 2-11: MULTIPLE SPI™ PERIPHERAL FUNCTIONS
Function Description
CloseSPI Disable the SSP module used for SPI™ communications.
DataRdySPI Determine if a new value is available from the SPI buffer.
getcSPI Read a byte from the SPI bus.
getsSPI Read a string from the SPI bus.
OpenSPI Initialize the SSP module used for SPI communications.
putcSPI Write a byte to the SPI bus.
putsSPI Write a string to the SPI bus.
ReadSPI Read a byte from the SPI bus.
WriteSPI Write a byte to the SPI bus.
PPSUnLock();
PPSInput(PPS_SDI2, PPS_RP11);
PPSInput(PPS_SCK2IN, PPS_RP12); //NO SE POR QUÉ ES NECESARIO DEFINIR ESTO
PPSOutput(PPS_RP13, PPS_SDO2);
PPSOutput(PPS_RP12, PPS_SCK2);
//lock pps registers
PPSLock();
OpenSPI2(SPI_FOSC_64,MODE_01,SMPMID);
UINT8 cc1101_reg_read(UINT8 addr)
{
UINT8 val;
CS=0;
while(PORTCbits.RC0 == 1);//Espero a que baje el SO del cc1101 (SI del pic)
putcSPI2(addr | 0x80 | 0x00);
while(!DataRdySPI2()); //¿Esto tiene algo que ver con PIR3bits.SSP2IF o hay que borrar este flag manualmente?
getcSPI2();
putcSPI2(0x00);
while(!DataRdySPI2());
val = getcSPI2();
CS=1;
/* Return the data byte */
return val;
}
Hola Suky ¿puedes ponerme la parte en la que inicializas el servicio SPI?