Some questions regarding the sub-20

All about Sub-20 Multi Interface USB Adapter USB to I2C, SPI, GPIO, RS232, RS485, Ir, LCD

Moderator: serg

Post Reply
niror
Posts: 1
Joined: Thu Feb 11, 2010 7:05 am

Some questions regarding the sub-20

Post by niror »

Hi,

I'm interesting in the sub-20 model for debugging proposes.
I have a couple of questions though:

1. Can I use this product as an i2c monitor?
That means sniffing all communication between devices on the i2c bus?
2. Can I emulate 2 or three slave devices on the i2c bus?

thanks,
ran.

xol
Site Admin
Posts: 241
Joined: Sat Aug 29, 2009 8:04 am

Re: Some questions regarding the sub-20

Post by xol »

1. SUB-20 is not an I2C monitor. It can be I2C master or I2C slave. To implement monitor more complex and powerfull core required. Price of such device is also not under $100
2. Yes. Not simultaneously. You can change slave address of SUB-20 board in I2C slave mode.
http://www.xdimax.com/sub20/doc/HTML/sub_i2c_config.htm
This requires synchronization between I2C master and your software changing slave address.
Another option is to use a number of SUB-20 boards connected to the same I2C bus (and more likely to the same PC)

eryaf
Posts: 6
Joined: Fri Jun 04, 2010 11:43 am

Re: Some questions regarding the sub-20

Post by eryaf »

Question :)

1. Can I ask SUB20 to do multiple lets say SPI communication? So can I say to the SUB20: "Do this SPI 32 times and report the result to me." either than executing one by one SPI until 32 time.
2. Can I use SPI and I2C at the same time? Or do I need 2 SUB20 to do that?

Kindest Regards :) E

eryaf
Posts: 6
Joined: Fri Jun 04, 2010 11:43 am

Re: Some questions regarding the sub-20

Post by eryaf »

Another question :)

3. What ll happen if during I2C or SPI communication, I unplug the cable of the I2C or SPI to the slave?
4. What ll happen if there is address mismatch for I2C?
5. What ll happen if the reply for I2C is more than the slave used to give, for example we ask 5bytes while the slave only gives 3?
6. Can I use this SUB20 for hot swapping/hot plugging?

Thanks a lot :D

serg
Posts: 143
Joined: Mon Aug 31, 2009 9:17 pm

Re: Some questions regarding the sub-20

Post by serg »

eryaf wrote: 1. Can I ask SUB20 to do multiple lets say SPI communication? So can I say to the SUB20: "Do this SPI 32 times and
report the result to me." either than executing one by one SPI until 32 time.
No, you have to send the "transfer" command 32 times to the board or use customized firmware
eryaf wrote: 2. Can I use SPI and I2C at the same time? Or do I need 2 SUB20 to do that?
Well, not "at the same time", but one after another. You need only one board for this. SPI and I2C use different connectors on the board. You just call different API functions/methods
eryaf wrote: 3. What ll happen if during I2C or SPI communication, I unplug the cable of the I2C or SPI to the slave?
You will get an error from the board's firmware in this case
eryaf wrote: 4. What ll happen if there is address mismatch for I2C?
The board's firmware and then the interface library return appropriate error code, i.e "no ack"
eryaf wrote: 5. What ll happen if the reply for I2C is more than the slave used to give, for example we ask 5bytes while the slave only gives 3?
You will get, probably 3 bytes, but I am not sure, I have to check this.
eryaf wrote: 6. Can I use this SUB20 for hot swapping/hot plugging
Since the SUB-20 is a USB(bus powered) board it supports hot swapping/hot plugging I guess

eryaf
Posts: 6
Joined: Fri Jun 04, 2010 11:43 am

Re: Some questions regarding the sub-20

Post by eryaf »

Dear serg,

thanks for your reply :)
eryaf wrote:
6. Can I use this SUB20 for hot swapping/hot plugging

Since the SUB-20 is a USB(bus powered) board it supports hot swapping/hot plugging I guess
What i mean here is for I2C and SPI, so if there is I2C or SPI transaction in the bus, and I plug new I2C or SPI device, what will happen?
eryaf wrote:
2. Can I use SPI and I2C at the same time? Or do I need 2 SUB20 to do that?

Well, not "at the same time", but one after another. You need only one board for this. SPI and I2C use different connectors on the board. You just call different API functions/methods
How about if the SUB-20 is configured as slave, both SPI and I2C slave, and there are 2 communications, SPI and I2C at the same time. Can the SUB20 handle this? a PC can have more than 1 SUB20 attached to it, right?

Kindest Regards :) E

serg
Posts: 143
Joined: Mon Aug 31, 2009 9:17 pm

Re: Some questions regarding the sub-20

Post by serg »

Hi eryaf,
eryaf wrote: What i mean here is for I2C and SPI, so if there is I2C or SPI transaction in the bus, and I plug new I2C or SPI device, what will happen?
I would say nothing. What do you expect to happen?
eryaf wrote: How about if the SUB-20 is configured as slave, both SPI and I2C slave, and there are 2 communications, SPI and I2C at the same time. Can the SUB20 handle this?
We didn't test this scenario, but in general, should work
eryaf wrote: PC can have more than 1 SUB20 attached to it, right?
right

hero_hont
Posts: 2
Joined: Fri Aug 20, 2010 10:39 am

Re: Some questions regarding the sub-20

Post by hero_hont »

thanks your reply.
That's good when i can read this topic.

Post Reply