I am having trouble configuring the GPIOB port on the SUB-20-B.
Here is my code:
// --- Set GPIOB port Configuration
// Since the SPI port is shared with GPIOB, need to disable SPI functionality (see below)
retval = sub_spi_config(handle, 0, 0);
// 7654 3210
// GPIOB set 0000 0000; 0-Input, 1-Output
// GPIOB mask 1111 1111; 1-Bit Enabled
retval = sub_gpiob_config(handle, 0x00, &pin_config, 0xFF);
if (retval != 0)
{
printf("\nsub_gpiob_config(): %s\n", sub_strerror(retval));
Sleep(5000);
return 0;
}
retval = sub_gpiob_config(handle, 0, &pin_config, 0);
printf("\nGPIOB Config: %d", pin_config);
If sub_spi_config(handle, 0, 0) isn't used before sub_gpiob_config(handle, 0x00, &pin_config, 0xFF), I get the 13 error - Wrong tag size in response
If I include sub_spi_config(handle, 0, 0) the 13 error goes away, but the GPIOB Config always stays at 16 (0x10).
Any ideas ?
Configuring GPIOB port on SUB-20-B
Moderator: serg
Re: Configuring GPIOB port on SUB-20-B
hi rkuenzi,
I cannot reproduce the problem on a board with firmware version 0.3.0.
I get retval == 0 and pin_config == 0 ( no sub_spi_config call). What firmware version do you use? If its older than 0.3.0 could you please update it and try again?
thanks
I cannot reproduce the problem on a board with firmware version 0.3.0.
I get retval == 0 and pin_config == 0 ( no sub_spi_config call). What firmware version do you use? If its older than 0.3.0 could you please update it and try again?
thanks
Re: Configuring GPIOB port on SUB-20-B
I have version 0.2.18 Were do I get version 0.3.0
Re: Configuring GPIOB port on SUB-20-B
The latest release includes the v0.2.9 firmware. Try this one first. Just download and install the latest build from the release section of this forum. The firmware is located under \program files\sub-20\firmware
Re: Configuring GPIOB port on SUB-20-B
I tried firmware version 0.2.9 and everything is now working correctly. Thanks 
