Hola!!
Estoy intentando comunicarme con un GLCD a través de SPI, pero estoy teniendo problemas para hacerlo funcionar. He usado un osciloscopio para ver cómo actúan las patillas SCK y SDO, pero están siempre en HIGH.
Para iniciar el SPI he usado:
#include <16F887.h>
#fuses XT,NOWDT,NOPROTECT,NOLVP
#use delay(clock=4000000)
#define SPI_MODE_0 (SPI_L_TO_H | SPI_XMIT_L_TO_H)
#define SPI_MODE_1 (SPI_L_TO_H)
#define SPI_MODE_2 (SPI_H_TO_L)
#define SPI_MODE_3 (SPI_H_TO_L | SPI_XMIT_L_TO_H)
void main() {
setup_spi(SPI_MASTER|SPI_MODE_3|SPI_CLK_DIV_4); // Modo maestro, idle clock high, sample on low2high, Fosc/4
spi_write(0b11100100); // Secuencia a enviar
while(1){}
}
¿Sabéis qué me puede estar faltando?
Gracias de antemano!