element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • About Us
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Sustain The World - Design Challenge
  • Challenges & Projects
  • Design Challenges
  • Sustain The World - Design Challenge
  • More
  • Cancel
Sustain The World - Design Challenge
Blog XMC4200 Interface with BLE Mesh Kit (Blog6)
  • Blog
  • Forum
  • Documents
  • Polls
  • Files
  • Events
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
  • Share
  • More
  • Cancel
Group Actions
  • Group RSS
  • More
  • Cancel
Engagement
  • Author Author: asokfair
  • Date Created: 23 Sep 2020 8:10 AM Date Created
  • Views 905 views
  • Likes 1 like
  • Comments 1 comment
  • xmc4200
  • uart
  • mesh
  • cypress
Related
Recommended

XMC4200 Interface with BLE Mesh Kit (Blog6)

asokfair
asokfair
23 Sep 2020

Hi All,

In the previous blog5 we have successfully brought the wireless communication between two mesh kits . And here we are going

to interface the MESH kit to XMC4200 via UART communication.

image

UART Interface:

UART example project is found under XMC4300 ->  XMC_Peripheral_Library_v2.1.24\XMCLib\examples\XMC4500_series

We use the project (UART_TRANSMIT_RECEIVE_FIFO_INTERRUPTS) as a reference to port into XMC4200.

Key changes are baudrate value and PIN numbers

 

#define UART_TX P1_5
#define UART_RX P2_15

/* Initialization structure for both USIC0_CH0 and USIC0_CH1 channels */
XMC_UART_CH_CONFIG_t uart_config =
{
  .data_bits = 8U,
  .stop_bits = 1U,
  .baudrate = 921600U //115200U
};

I have used TX Pin as P1_5 , which is connected to JTAG debugger UART , Its helps in debugging and another pin P2_15 Rx pin connected

to the MESH kit TX pin P12.

 

I'm using the UART1 handler to read and process the data from Mesh kit.

/* Receive handling IRQ */
void USIC1_1_IRQHandler(void)
{
 while(!XMC_USIC_CH_RXFIFO_IsEmpty(XMC_UART1_CH0))
  {

    rx_data[rx_index] = XMC_UART_CH_GetReceivedData(XMC_UART1_CH0);

}

 

These received data is filtered and processed to control the LED lights and PWM.

the data format is 0x00,0x00,0x00,0x00 4bytes (byte1 -> LED, byte2->motor, byte3->pwm_value, byte4->auto_timer)

Operation:

Two modes of operation here, one is user controlled from wireless remote and another mode is automatic. In automatic mode the

as per the scheduled time the MOTOR or LIGHT will be turned ON or OFF after timeout.

 

In the current setup,12V power supply is taken from the 7.5A battery connected to PROFET+2_12V Kit. 12V LED lights are used for now

to showcase the , for DC motor its required to build and 9V supply with 7809 regulator. Here is the working demo of controlling the 12V lights

from mesh remote.

You don't have permission to edit metadata of this video.
Edit media
x
image
Upload Preview
image

 

In the next blog7 we going to do some improvements on the current setup.

  • Sign in to reply
  • Kiera
    Kiera 4 months ago

    I have a number of wireless wearable mini projects that I'm hoping to be able to work together using ble mesh to do so  these board look larger than what I hope to use on my body to enhance performance and fun one Item will be a skirt that when I spin in 1 direction will light up in one colour  and when I spin in other direction it will be a different colour spin detected by 6Dof sensor built into hat that has light up elements  that may change based on movement or direct input from special box in handbag or on table that can be set to control different rgb lights and read different sensor  inputs from around my body.  curious if smaller boards boards that will be able to handle the ble-mesh side and connect to different sensors over I2C (preferably via a plug thanks to some health issues/ disablities I find soldering in some forms a bit too hard  but if these (dev boards) exist then I will soon be looking to make use of them.  Any links to good boards for me would be great.  Thanks Kiera

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube