same problem, multiple slaves on spi with wishield :
I have change scp1000::init to make the sensor work on another pin (7) slave as explained here: http://www.arduino.cc/cgi-bin/yabb2/YaB ... 1227719581
If i disable Wifi.init() and Wifi.run() the sensor works but when i enable these two methods, it doesn't.
The problem comes certainly from the double initialization of spi interface ?
I have look into wishield spi initilization and i think i must disable the scp1000 init and modify something into (but how please?) :
spi.h here ?
- Code: Select all
#ifdef USE_DIG8_INTR
#define SPI0_Init() DDRB |= SPI0_SS_BIT|SPI0_SCLK_BIT|SPI0_MOSI_BIT|LEDConn_BIT;\
DDRB &= ~(SPI0_MISO_BIT|ZG2100_INTR);\
PORTB = SPI0_SS_BIT;\
SPCR = 0x50;\
SPSR = 0x01
#else
#define SPI0_Init() DDRB |= SPI0_SS_BIT|SPI0_SCLK_BIT|SPI0_MOSI_BIT|LEDConn_BIT;\
DDRB &= ~SPI0_MISO_BIT;\
PORTB = SPI0_SS_BIT;\
SPCR = 0x50;\
SPSR = 0x01
#endif
//ZG2100 SPI HAL
#define ZG2100_SpiInit SPI0_Init
or into zg_init into g2100c :
- Code: Select all
void zg_init()
{
U8 clr;
ZG2100_SpiInit();
clr = SPSR;
clr = SPDR;
intr_occured = 0;
intr_valid = 0;
zg_drv_state = DRV_STATE_INIT;
Thanks in advance,