No I2c Slave Address for Communication - protocols

i am using I2C base sensor. But that sensor is not having address(slave). So can i communicate with it without address. It will send ack and data?.

According to the The Slave Address chapter (p. 21, Figure 10, MMA7660FC datasheet), MMA7660FC has fixed (hardwired) slave address which is normally 1001100 (0x4C). It could be changed to another in range (0x08 to 0xEF) by request to factory.
So, this is normal I2C device (with address), you could communicate with it using 0x4C slave address.
Well, if you unsure what address the sensor has, try to poll sensor with different addresses in a loop. Sensor must answer to one of addresses.

Related

How ports for communicating with I/O devices are chosen and how do they know when the CPU talks to one of them?

I was wondering how a port for a given device controller is chosen and how it knows the values on address/data/control bus are for him.
Let's take the 8259A PIC for example, which is connected that way to the address/data/control bus:
8952A Programmable Interrupt Controller
I can see the active low CS (Chip Select) pin that is used to enable the PIC and be able to read/write on it, is connected to the address bus... But to what line? (That is the part I don't get). How does the address bus know when to activate the CS pin?
I believe that CS pin must be activated when the address bus is 0x20 or 0x21 (ports used by master PIC) and the CPU did not assert the M/#IO control line to read/write from/into I/O space (with the IN and OUT x86 instructions). But I don't get why the CS pin is connected to whatever address bus line since other ports are used by other devices controller.

I am working with vlan, I have to write a server which used vlan interface to accept the packet?

Hints about working with VLAN? I have to write a client-server program, where the client will send a packet through eth0 and the server will receive the packet on VLAN, and to send it to a concerned VLAN client should parse on which command line VLAN will receive it?
Usually there is nothing to do in the application to work with a VLAN. The VLAN is realized using a virtual network interface with its own IP address. From the perspective of the application this is not different from a real network interface with own IP address. The OS will take care about routing and encapsulation of packets and there is nothing to do from the application itself.

Is there anyway through which USB device know that the Data is read from endpoint buffer?

I'm trying to emulate a USB Keyboard with help of STM32 USB Device Library. The host here is not a Computer/ laptop, but a custom device to which a HID keyboard can be connected. I send data using API USBD_HID_SendReport(); but the host doesn't seem to recognize or read it by the time I write new data via same API. If I send same data for say 7 times the host reads it for 4 times only.
So is there anyway to know that the data is being read by USB Host from the EP Buffer?
Shall I change the bInterval in endpoint descriptor, what is the standard interval used in case of all keyboards?
P.S. The same data when sent to Computer or Laptop does gets read quickly by the host.
USBD_HID_SendReport only prepares the data for the next transmition when host requires one. It does not matter how many times you call this function. It will be send only as many times as host requested. The moment when it is send depends on the host only.
Device does not transmit anything without the host request

Using Bluetooth LE devices with same BDADDR

A lot of "cheap" bluetooth adapters unfortunately have the same address assigned to them. If more than one client uses these adapters to connect to a common set of servers, what would the impact of the client having the same address be?
My understanding is once the ADV_CONNECT_REQ sets up the connection with the Access Address and after that the BDADDR is not used. Is this correct?
For BLE, the BD address is used only when scanning/advertising and initiating connections. Once a connection has been established, the BD address is not sent explicitly in any packets. So in practice, if you have two devices with the same BD address, you can theoretically have two separate connections, one for each device. However these sessions won't interfere with each other.

Coding for Ethernet PHY Loopback Test

I have to write a Ethernet PHY loopback test in Linux. I've never done it before and had no clue where to start. After some researching, I came up with the plan for the test, and I wonder if anyone can help me to verify it and give me some pointers to my questions.
This is a external loopback setup. It connects the TX+/- to RX+/- pins for each internal PHY's on the Ethernet switch chip.
So the loopback high level packet path is as follow:
CPU->PHY0(chip)->Ethernet switch(chip)'s internal PHY->PHY0(chip)->CPU
For this test, I plan to
configure the internal PHYs on the Ethernet switch with specific MAC addresses,
pack the Ethernet test packet using CPU's MAC address as the source address and the
MAC address configured in step 1. as the destination address,
send and wait to receive the test packet,
compare sent and received data pattern.
Any suggestions? Also, I wonder if there are functions in Linux that I can use to generate the packets for step 2, and send the packets for step 3.
Thank you very much.
Most Phys can be switched to a test mode. We used the bootloader to write directly to the
Phy and switch to testing mode.
There is also an ioctl taken from documentation/networking/phy.txt
Ethtool convenience functions.
int phy_mii_ioctl(struct phy_device *phydev,
struct mii_ioctl_data *mii_data, int cmd);
The MII ioctl. Note that this function will completely screw up the state
machine if you write registers like BMCR, BMSR, ADVERTISE, etc. Best to
use this only to write registers which are not standard, and don't set off
a renegotiation.

Resources