This snippet application interfaces the Infrared contact-less temperature sensor (TMP007) module from Adafruit (https://www.adafruit.com/products/2023) using WICED SDK.
- The snippet application sets up the I2C device interface and probes the device.
- Then all register values are read and pushed to the serial terminal interface.
- To show writing to the I2C device, object high temperature alarm register is updated with a given value then the same register is register back.
- Every 1 second period, I2C device die and object temperature values are read from corresponding registers and printed on the serial terminal.
For BCM943362WCD4 evaluation platform update the platform.c and platform.h files for I2C device.
Update the .../platforms/BCM943362WCD4/platform.c file by adding the following changes to the file:
const platform_i2c_t platform_i2c_peripherals[] =
{
[WICED_I2C_1] =
{
.port = I2C1,
.pin_scl = &platform_gpio_pins[WICED_GPIO_11],
.pin_sda = &platform_gpio_pins[WICED_GPIO_12],
.peripheral_clock_reg = RCC_APB1Periph_I2C1,
.tx_dma = DMA1,
.tx_dma_peripheral_clock = RCC_AHB1Periph_DMA1,
.tx_dma_stream = DMA1_Stream7,
.rx_dma_stream = DMA1_Stream0,
.tx_dma_stream_id = 7,
.rx_dma_stream_id = 0,
.tx_dma_channel = DMA_Channel_1,
.rx_dma_channel = DMA_Channel_1,
.gpio_af = GPIO_AF_I2C1
}
};
For platforms/BCM943362WCD4/platform.h file add the WICED_I2C_1 to the wiced_i2c_t as below:
typedef enum
{
WICED_I2C_1,
WICED_I2C_MAX,
WICED_I2C_32BIT = 0x7FFFFFFF,
} wiced_i2c_t;
The platform files for BCM943362WCD4 are attached.
NOTE: On BCM943362WCD4 evaluation board, two 4.7K pull up resistors are needs on each of the SCL and SDA connections.
For BCM943341WCD1, the I2C device of WICED_I2C_1 is already defined in the platform files. Since the SCL and SDA pull resistors are already populated on the BCM943341WCD1 evaluation board, no hardware related modifications are needed.
Your application specific platform files can be updated as above to interface the chosen I2C device to the WICED SDK 3.x platforms.
1. To run the test, connect the I2C device to the evaluation board as following:
Connection setup for I2C device to STM32F4xx based WICED evaluation board
I2C-Device BCM943341WCD1 J7 Header
- J7-27
+ J7-28
SDA J7-26
SCL J7-25
Connection setup for I2C device to STM32F2xx based WICED evaluation board
I2C-Device BCM943362WCD4 J7 Header
- J7-2
+ J7-1
SDA J7-7
SCL J7-6
2. Unzip and copy the attached files to the WICED SDK-3.x version.
For I2C Temp application snippet:
Copy the content of the i2c_temp.7z source to .../apps/snip/i2c_temp
For BCM943362WCD4:
Copy the content of the BCM943362WCD4.7z source to .../platforms/BCM943362WCD4
For BCM943341WCD1:
Default platform files could be used.
3. To build, download and run the application below
For STM32F4xx MCU BCM943341WCD1:
snip.i2c_temp-BCM943341WCD1 download run
For STM32F2xx MCU BCM943362WCD4:
snip.i2c_temp-BCM943362WCD4 download run
Picture of setup:
Serial terminal log:
Show Less13:15:39.028: Starting WICED v3.3.DEVELOPMENT
13:15:39.028: Platform BCM943341WCD1 initialised
13:15:39.028: Started ThreadX v5.6
13:15:39.028: Initialising NetX_Duo v5.7_sp2
13:15:39.028: Creating Packet pools
13:15:39.028: WWD SDIO interface initialised
13:15:39.348: WLAN MAC Address : 6C:AD:F8:F0:E8:F1
13:15:39.364: WLAN Firmware : wl0: Nov 25 2015 14:01:39 version 6.49.2 (r602357) FWID 01-1302682f
13:15:39.364: I2C LED Interface Application.
13:15:39.396: Probe successful on address 64!
13:15:39.396: Manufacturer ID: 0x5449
13:15:39.396: Device ID: 0x0078
13:15:39.396: Voltage: -27.6562 uV
13:15:39.396: Die Temp: 25.22C
13:15:39.396: Object Temp: 25.12C
13:15:39.412: Alarms(L/H): Die -256.00C / 255.50C, Object -256.00C / 198.50C
13:15:39.412: Write: 6340 Read: 6340
13:15:39.412: Write: 198.50C Read: 198.50C
13:15:39.412: Die Temp: 25.22C (78.39F) - Object Temp: 25.12C (77.22F)
13:15:39.428: Die Temp: 25.19C (78.34F) - Object Temp: 25.19C (77.34F)
13:15:40.420: Die Temp: 25.19C (78.34F) - Object Temp: 25.34C (77.62F)
13:15:41.428: Die Temp: 25.19C (78.34F) - Object Temp: 26.38C (79.47F)
13:15:42.436: Die Temp: 25.19C (78.34F) - Object Temp: 28.12C (82.62F)
13:15:43.444: Die Temp: 25.19C (78.34F) - Object Temp: 30.03C (86.06F)
13:15:44.451: Die Temp: 25.22C (78.39F) - Object Temp: 32.50C (90.50F)
13:15:45.459: Die Temp: 25.22C (78.39F) - Object Temp: 34.25C (93.65F)
13:15:46.451: Die Temp: 25.22C (78.39F) - Object Temp: 33.12C (91.62F)
13:15:47.460: Die Temp: 25.22C (78.39F) - Object Temp: 32.47C (90.44F)
13:15:48.468: Die Temp: 25.22C (78.39F) - Object Temp: 33.06C (91.51F)
13:15:49.476: Die Temp: 25.22C (78.39F) - Object Temp: 33.91C (93.03F)
13:15:50.484: Die Temp: 25.22C (78.39F) - Object Temp: 34.59C (94.27F)
13:15:51.476: Die Temp: 25.22C (78.39F) - Object Temp: 34.97C (94.94F)
13:15:52.484: Die Temp: 25.25C (78.45F) - Object Temp: 35.38C (95.68F)
13:15:53.492: Die Temp: 25.25C (78.45F) - Object Temp: 35.06C (95.11F)
13:15:54.500: Die Temp: 25.25C (78.45F) - Object Temp: 33.53C (92.36F)
13:15:55.507: Die Temp: 25.22C (78.39F) - Object Temp: 32.19C (89.94F)
13:15:56.515: Die Temp: 25.22C (78.39F) - Object Temp: 30.94C (87.69F)
13:15:57.508: Die Temp: 25.22C (78.39F) - Object Temp: 31.34C (88.42F)
13:15:58.516: Die Temp: 25.28C (78.51F) - Object Temp: 34.59C (94.27F)
13:15:59.524: Die Temp: 25.34C (78.62F) - Object Temp: 38.72C (101.69F)
13:16:00.532: Die Temp: 25.38C (78.68F) - Object Temp: 41.81C (107.26F)
13:16:01.540: Die Temp: 25.44C (78.79F) - Object Temp: 44.59C (112.27F)
13:16:02.532: Die Temp: 25.50C (78.90F) - Object Temp: 47.03C (116.66F)
13:16:03.540: Die Temp: 25.53C (78.96F) - Object Temp: 48.81C (119.86F)
13:16:04.548: Die Temp: 25.59C (79.07F) - Object Temp: 49.91C (121.83F)
13:16:05.556: Die Temp: 25.62C (79.12F) - Object Temp: 50.91C (123.63F)
13:16:06.563: Die Temp: 25.66C (79.18F) - Object Temp: 51.44C (124.59F)
13:16:07.557: Die Temp: 25.72C (79.29F) - Object Temp: 52.41C (126.33F)
13:16:08.564: Die Temp: 25.75C (79.35F) - Object Temp: 52.94C (127.29F)
13:16:09.572: Die Temp: 25.81C (79.46F) - Object Temp: 54.03C (129.26F)
13:16:10.580: Die Temp: 25.88C (79.58F) - Object Temp: 54.62C (130.32F)
13:16:11.588: Die Temp: 25.91C (79.63F) - Object Temp: 55.19C (131.34F)
13:16:12.596: Die Temp: 25.94C (79.69F) - Object Temp: 55.84C (132.52F)
13:16:13.588: Die Temp: 26.00C (79.80F) - Object Temp: 56.59C (133.87F)
13:16:14.596: Die Temp: 26.06C (79.91F) - Object Temp: 57.34C (135.22F)
13:16:15.604: Die Temp: 26.09C (79.97F) - Object Temp: 58.06C (136.51F)
13:16:16.612: Die Temp: 26.16C (80.08F) - Object Temp: 58.78C (137.81F)
13:16:17.621: Die Temp: 26.22C (80.19F) - Object Temp: 59.47C (139.04F)
13:16:18.613: Die Temp: 26.28C (80.31F) - Object Temp: 60.03C (140.06F)
13:16:19.620: Die Temp: 26.34C (80.42F) - Object Temp: 60.38C (140.68F)
13:16:20.628: Die Temp: 26.41C (80.53F) - Object Temp: 60.84C (141.52F)
13:16:21.636: Die Temp: 26.50C (80.70F) - Object Temp: 60.62C (141.12F)
13:16:22.644: Die Temp: 26.59C (80.87F) - Object Temp: 60.34C (140.62F)
13:16:23.653: Die Temp: 26.69C (81.04F) - Object Temp: 60.22C (140.39F)
13:16:24.644: Die Temp: 26.75C (81.15F) - Object Temp: 60.56C (141.01F)
13:16:25.652: Die Temp: 26.81C (81.26F) - Object Temp: 58.62C (137.53F)
13:16:26.660: Die Temp: 26.78C (81.21F) - Object Temp: 53.47C (128.24F)
13:16:27.669: Die Temp: 26.78C (81.21F) - Object Temp: 48.19C (118.74F)
13:16:28.677: Die Temp: 26.81C (81.26F) - Object Temp: 44.44C (111.99F)
13:16:29.669: Die Temp: 26.81C (81.26F) - Object Temp: 41.47C (106.64F)
13:16:30.677: Die Temp: 26.81C (81.26F) - Object Temp: 39.09C (102.37F)
13:16:31.684: Die Temp: 26.84C (81.32F) - Object Temp: 37.34C (99.22F)
13:16:32.692: Die Temp: 26.84C (81.32F) - Object Temp: 36.00C (96.80F)
13:16:33.700: Die Temp: 26.84C (81.32F) - Object Temp: 34.84C (94.72F)
13:16:34.692: Die Temp: 26.84C (81.32F) - Object Temp: 34.00C (93.20F)
13:16:35.700: Die Temp: 26.84C (81.32F) - Object Temp: 33.25C (91.85F)
13:16:36.708: Die Temp: 26.84C (81.32F) - Object Temp: 32.84C (91.12F)
13:16:37.717: Die Temp: 26.84C (81.32F) - Object Temp: 32.59C (90.67F)
The attached application creates threads, waits for each thread to end and then deletes the threads.
Each thread prints thread specific information on the serial terminal.
To synchronize the printing on the serial terminal, semaphore is created and passed to the each thread, along with some other data, as a thread parameter.
Block of threads are created and waited on to be joined before they are deleted.
Setting up and running the application:
Unzip the attached zip file and copy the "create_delete_thread" directory to .../apps/snip/ directory, /apps/snip/create_delete_thread.
Add "snip.create_delete_thread-<YourPlatform> download run" to the Make Target
For BCM943362WCD4 platform: "snip.create_delete_thread-BCM943362WCD4 download run"
Connect your target module to your development host computer.
Open WicedSerial or serial terminal to observe serial data sent from the target device.
Below is the output captured via WicedSerial:
This blog is about basic debug information and configuration details for OS X on WICED SDK 2.4.1
The video shows very basic debug details
Before debugging always run 'Clean' from the 'Make Target' Window and not eclipse-->build-->clean
Debug Configuration on WICED SDK (2.4.1)
1) Main configuration tab
2) Debugger Tab (Make sure the 'Force thread list update on suspend' is unchecked)
3) Startup tab
4)Source tab
5) Common tab
HTH
vik86
Show LessAfter successfully associating the IoT device as a client to a known network, the device connects to the associated network after each reset. This works fine for the most part, but if the known network credentials are changed, the device needs to be reconfigured with the new network.
The following application switches the device from client mode to access point (AP) mode for future configurations so that the device can be associated with a new network to communicate.
Press and hold the push button switch (SW1) on the evaluation board which initiates switching from client mode to AP mode. This is the same as using the webpage hosted by the evaluation board.
1. Right-click on the project and using "Team -> Apply Patch" apply the attached patch to the SDK.
The client2ap demo application is added to .../Apps/demo/client2ap.
The client2ap resource file is added to .../Resources/apps/client2ap.
2. Build and download the client2ap application by adding the following to Make Target.
demo.client2ap-<Your Platform> download run
For example if you are using a BCM943362WCD4 platform:
demo.client2ap-BCM943362WCD4 download run
3. Next you need to connect the WICED device to your network.
The console output will show you the IP address of where the configuration page is being hosted. In this case: 192.168.0.1
Navigate to this page from any browser (obviously connected to same AP.)
Follow the browser instructions to associate and pass your credentials to the WICED device:
Here is WicedSerial output after connecting to the selected network.
4. Once the device is associated to your network, it will always try to connect to the same network after resets, however; in the background your WICED device is hosting a Webpage. At anytime you can navigate to this webpage from a device on the same subnet.
5. If you would like to get back into AP mode (to pass new credentials for example), use your browser to navigate to the IP address, in this case 10.16.100.229, and click on "Switch To AP Mode" to restart the configure AP mode.
6. Alternatively; you can press and hold the SW1 on the WICED eval board for 3 seconds to switch to AP mode.
7. After switching to AP mode the WICED device reboots. Here is the console output after switching to AP mode. Now are are back at Step 3:
Thanks to seyhan for putting this snip together.
It is a good use of the scan application, the push button SW, and the GPIOs
This "snip" will launch the "scan" snip, scan for WiFi networks and display the details on the Console.
The red LED will remain illuminated while the scan is running.
The scan will repeat until the button press and the LED will go out.
Here's how to use it...
Extract the attached "push2scan.zip" directory, to a directory of your choice.
Copy the directory to your WICED SDKs .../Apps/snip directory. You will see the other snips there as well.
When you launch the Eclipse SDK (or Refresh/F5) next you will see your new push2scan "snip" populated.
Copy and Paste the "scan" make target and rename it "snip.push2scan-BCM943362WCD4 download run"
Keep in mind it has to match exactly the name of the directory "push2scan"...
Your "Make Target" should look similar to this
Double-click the target and let it complete until "Target running" is displayed in the "Console" tab
Now have a look at your Console window. In this example we are using the WICEDSerial Windows executable provided here:
WICEDSerial - Console tool to communicate to your WICED Board
You will see the following output on the console:
Notice the red LED is illuminated. This indicates the "scan" is running.
Push SW1 (lower left corner in this photo) to "stop" and "start" the scanning and toggle the LED on/off.
Thank you.seyhan
Show Less