You are here

CY3280 MBR3 & WICED CYW843807 | Cypress Semiconductor

CY3280 MBR3 & WICED CYW843807

[re-printed from iotexpert.com]

In the last Article I talked about the GE Megahackathon. One of the groups at the event got interested in using a CY3280 MBR3 to send signals via a WICED CYW943907 to the Particle IO server which was connected to a Particle Photon.  I helped them with the implementation and thought that it would be useful to show here.

CY3295 Kit Image

 

Cypress CY3280 MBR3

The CY3280 MBR development kit is a CapSense demonstration kit that shows the Mechanical Button Replacement 3 chip.  It features 4 CapSense buttons with LEDs, a proximity sensor, and a buzzer.  It is connected to another MCU via the Arduino pins. of the WICED CYW943907.  The device sits on the I2C bus and acts as an I2C Slave.  You configure it using EZ Click.

When you run EZ Click you can setup the configure the internal registers of the MBR3 to make the board act like a bunch of different things.  In this case I turned on

The MBR buttons 1-4 (you can see them in the picture above)
The Flanking Sensor rejection which makes it so that you can only press one button at a time.
All of the automatic tuning features.

CY3295 Kit Image

 

Once the main CapSense is configured, I moved to the other part of the configuration where I setup

The 4 LEDs to toggle and be full brightness when on
The buzzer to buzz for 100ms at 4kHz when something happens
The host interrupt pin as CS15/SH/HI.  This made the Arduino pin D2 be an interrupt when something happened so that WICED would poll the MBR3

CY3295 Kit Image

 

Once these settings were all done, I downloaded the firmware configuration via the KitProg USB connector.  Then I tested it using the bridge control panel which I have shown you a bunch of different times in the past.  The MBR3 acts as an I2C slave.  To find out what the state of the buttons are you need to read register 0xAA.  The only little trick is that the chip goes to sleep to save power.  In order to wake it up you need to send an I2C transaction, which ends up getting NAK’d.  But the next transaction you send will be ACKd.  In the screenshot below you can see that I tried two of the buttons (0x08 and 0x20)

CY3295 Kit Image

 

One problem that I had is that the power system of this board is setup to take 5V from the Arduino base board but the WICED development kit gives only 3.3v.  Here is a picture of the power system from the MBR3 schematic.

CY3295 Kit Image

 

The MBR3 can run on 3.3Vs.  In fact it can run all the way down to 1.7v and up to 5.5v, but for some reason (which I can’t remember) we made the board only work with 5.0v.  To fix this problem I removed J12 and then wired a wire from the 3.3V Arduino pin.  The wire is soldered onto the 3.3v pin, but has a female connector on the other side so that it can be plugged into J12.  Here is a picture:

Comparator Diagram CY3280

 

The last thing that I needed to do was move the jumpers to position “A” which made the host interrupt pin be connected to D2, and move the I2C jumpers so that the MBR3 was connected to the Arduino instead of the P5LP kitprog.  You can see that in the J3_scl and J3_sda in the picture above.

WICED CYW943907

The CYW934907AEVAL1F is an development kit for the Cypress 43907 MCU+WiFi module.  The WICED CYW943907 board can do dual band (2.4 and 5Ghz), 802.11 a/b/g/n,  Ethernet and a whole bunch of other stuff.

CY3295 Kit Image

 

The first firmware that I wrote in WICED Studio:

  • Sets up an ISR to unlock a semaphore when the interrupt occurs
  • Initialized WICED_GPIO_9 to be an input and connected to an ISR … this is also known as Arduino D2
  • Setup the I2C Master Hardware in the 43907
  • Wait for a semaphore (from the ISR)
  • Read the I2C register 0xAA from the MBR

The only trick in the firmware is that I read the I2C with a “do” loop until I get a valid result, meaning that the MBR3 has woken up.

#include "wiced.h"
 
#define I2C_ADDRESS (0x37)
#define BUTTON_REG (0xAA)
 
wiced_semaphore_t buttonPress;
 
/* Interrupt service routine for the button */
void button_isr(void* arg)
{
    wiced_rtos_set_semaphore(&buttonPress);
}
 
/* Main application */
void application_start( )
{
    wiced_init(); /* Initialize the WICED device */
    WPRINT_APP_INFO(("Started\n"));
 
    wiced_result_t result;
    wiced_rtos_init_semaphore(&buttonPress);
 
    // WICED_GPIO_9 is the MBR3 Interrupt Pin
    wiced_gpio_init(WICED_GPIO_9,INPUT_PULL_UP);
    wiced_gpio_input_irq_enable(WICED_GPIO_9, IRQ_TRIGGER_FALLING_EDGE, button_isr, NULL); /* Setup interrupt */
 
    /* Setup I2C master */
    const wiced_i2c_device_t i2cDevice = {
            .port = WICED_I2C_2,
            .address = I2C_ADDRESS,
            .address_width = I2C_ADDRESS_WIDTH_7BIT,
            .speed_mode = I2C_STANDARD_SPEED_MODE
    };
 
    wiced_i2c_init(&i2cDevice);
 
    /* Tx buffer is used to set the offset */
    uint8_t tx_buffer[] = {BUTTON_REG};
    uint8_t buttonStatus;
 
    while ( 1 )
    {
 
        wiced_rtos_get_semaphore(&buttonPress,WICED_WAIT_FOREVER);
 
        // Do this until the MBR3 is alive.  It goes into deep sleep and wakes when you
        // send the first command.
        do {
            result = wiced_i2c_write(&i2cDevice, WICED_I2C_START_FLAG | WICED_I2C_STOP_FLAG, tx_buffer, sizeof(tx_buffer));
        }
        while(result != WICED_SUCCESS);
 
        result=wiced_i2c_read(&i2cDevice, WICED_I2C_START_FLAG | WICED_I2C_STOP_FLAG, &buttonStatus, sizeof(buttonStatus));
        WPRINT_APP_INFO(("Button State = %X\n", buttonStatus)); /* Print data to terminal */
    }
}

Once that is programmed I program and test the firmware.

CY3295 Kit Image

 

In the next article I will modify all of this firmware and make the WICED CYW943907 send data via HTTP to the Cloud.

Blog: 

Comments

irriddiky-6766_2918761's picture

Your blogs further more each else volume is so entertaining further serviceable It appoints me befall retreat encore. I will instantly grab your feed to stay informed of any custom essay updates.

shaneryer8_2942541's picture

Great article. It was very detailed and helpful! The MBR3 has woken up.

- json formatter

samwithers_3002041's picture

i have read whole of your article and i really like it.

domhive_3005521's picture

The information you share is very useful. and also whatsapp android app information is useful.

shehryarbhatti507_3008241's picture

This Cypress CY3280 MBR3 & WICED CYW843807 kit is really useful I must say and I agree with all the information you have posted on your article. I have the live view of this kit with the college paper writing service reviews team and it was a great experience.

mondevoyance_3031296's picture

Thank you for taking the time to publish this information very useful!I assure this would be beneficial for most of the people.  Any way I'll be subscribing to your feed and I hope you post again soon. Voyance amour en ligne.

 

pepperwilliamss_3035671's picture

Wow, The information you share is very useful. and also WhatsApp android app information is useful. You can use HideMyAss Promo Codes that will help you to browse any website local.

 

jackieclapton_3039846's picture

This is also a very good post which I really enjoyed reading with play android games

Vishal Tyagi's picture

One do not know how to delete browsing history can visit this website and can learn in the simplest form.

catherinebarrett525_3079256's picture

Really amazing post you always post different college paper writing service reviews article that very important and helpful in our daily routine matter. So I suggest to every visitor who read this post they must read this because they tells us about yoga who lose the weight.

nehasharma7057_3210786's picture

I really impressed with your work. I loved to read such kind of article and this is one of them, I have found here lots of interesting information. this website perfect for my knowledge I need.

Independent Escorts Service in Delhi

Jessica Kale's picture

So I suggest to every visitor who read this post they must read this because they tells us about yoga who lose the weight. 192.168.1.1 login

ALL CONTENT AND MATERIALS ON THIS SITE ARE PROVIDED "AS IS". CYPRESS SEMICONDUCTOR AND ITS RESPECTIVE SUPPLIERS MAKE NO REPRESENTATIONS ABOUT THE SUITABILITY OF THESE MATERIALS FOR ANY PURPOSE AND DISCLAIM ALL WARRANTIES AND CONDITIONS WITH REGARD TO THESE MATERIALS, INCLUDING BUT NOT LIMITED TO, ALL IMPLIED WARRANTIES AND CONDITIONS OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT OF ANY THIRD PARTY INTELLECTUAL PROPERTY RIGHT. NO LICENSE, EITHER EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, IS GRANTED BY CYPRESS SEMICONDUCTOR. USE OF THE INFORMATION ON THIS SITE MAY REQUIRE A LICENSE FROM A THIRD PARTY, OR A LICENSE FROM CYPRESS SEMICONDUCTOR.

Content on this site may contain or be subject to specific guidelines or limitations on use. All postings and use of the content on this site are subject to the Terms and Conditions of the site; third parties using this content agree to abide by any limitations or guidelines and to comply with the Terms and Conditions of this site. Cypress Semiconductor and its suppliers reserve the right to make corrections, deletions, modifications, enhancements, improvements and other changes to the content and materials, its products, programs and services at any time or to move or discontinue any content, products, programs, or services without notice.