SlideShare a Scribd company logo
www.silabs.com | Smart. Connected. Energy-Friendly.
Configurable Logic
in Microcontrollers
Revolutionizes Small
Applications
By Stephen To, Applications Engineer,
Microcontrollers, Silicon Labs
www.silabs.com!!|!Configurable!Logic!in!Microcontrollers!Revolutionizes!Small!Applications!! ! !
! ! ! ! ! 1!
!
!
Introduction+
Microcontrollers!(MCU)!are!becoming!even!more!flexible!as!suppliers!integrate!more!external!components!onB
chip.!For!engineers,!this!means!a!new!arsenal!of!tools!and!possibilities!for!embedded!development.!Configurable!
logic!(CL)!hardware!is!one!of!these!relatively!new!addBons!to!the!microcontroller!market.!!
!
The!CL!hardware!implements!combinatorial!logic!like!the!basic!Boolean!AND,!OR,!or!XOR!functions,!as!well!as!
sequential!logic!like!latches.!This!flexibility!allows!embedded!programmers!to!easily!add!their!own,!custom!
functionality.!From!simple!signal!inverters!to!more!complex!Manchester!decoders,!the!configurable!logic!can!
operate!completely!independently!from!the!processor!core!(CPU).!The!configurable!logic!hardware!is!typically!
programmed!in!C!and!initializes!a!set!of!dedicated!registers.!With!C!as!the!programming!language,!embedded!
designers!will!not!need!to!learn!another!programming!language!such!as!VHDL.!!
!
Microcontrollers!with!configurable!logic!help!reduce!BOM!costs!and!minimize!board!size!by!integrating!offBchip!
glue!logic.!CPU!resources!are!freed!because!configurable!logic!operates!independently!from!the!core.!In!addition,!
the!capabilities!of!other!peripherals!are!extended!when!they!are!connected!to!configurable!logic.!With!all!this!
flexibility,!small,!powerBefficient!MCUs!can!be!used!in!applications!previously!exclusive!to!larger,!fullyBconfigurable!
devices!like!FPGAs!or!expensive!ASICs.!!
!
To!understand!the!capabilities!of!the!highlyBflexible!features!of!configurable!logic,!this!paper!will!explore!the!
general!operation!of!CL!hardware!on!currently!available!microcontrollers,!as!well!as!how!configurable!logic!drives!
smaller!and!cheaper!applications.!
!
!
Overview!
On!a!microcontroller,!a!configurable!logic!unit!(CLU)!is!a!piece!of!dedicated!hardware!consisting!of!userB
programmable!digital!logic!that!operates!without!CPU!intervention.!Multiple!CLUs!are!typically!provided!on!an!
MCU.!Figure!1!shows!a!simplified!block!diagram!of!a!single!CLU!with!three!inputs!and!one!output.!
!
www.silabs.com!!|!Configurable!Logic!in!Microcontrollers!Revolutionizes!Small!Applications!! ! !
! ! ! ! ! 2!
!
!
!
Figure'1:'Block'Diagram'of'a'Single'Configurable'Logic'Unit'
The!Configurable!Logic!Inputs!
The!three!key!input!signals!in!a!CLU!consists!of!!
•! Input!multiplexer!A!(MXA)!
•! Input!multiplexer!B!(MXB)!!
•! Carry!signal!
!
Multiplexer!A!can!select!from!a!set!of!inputs,!like!external!pins!or!signals!from!other!peripherals.!As!shown!in!
Figure!2,!these!inputs!can!vary!from!a!timer!overflow!to!a!PCA!channel.!The!CLU!can!also!operate!in!conjunction!
with!serial!peripherals!such!as!UART!or!SPI!because!the!external!pin!inputs!can!be!both!a!serial!peripheral!
output,!as!well!as!a!CLU!input.!Additionally,!input!multiplexer!A!can!select!the!output!of!any!CLU,!including!its!
own!output.!Input!multiplexer!B!operates!similarly,!but!with!a!different!set!of!external!pins!and!signals!from!other!
peripherals.!
!
!
!
!
!
!
www.silabs.com!!|!Configurable!Logic!in!Microcontrollers!Revolutionizes!Small!Applications!! ! !
! ! ! ! ! 3!
!
!
!
Figure'1:'Simplified'Block'Diagram'of'a'Configurable'Logic'Unit'
'
!
The!carry!signal!is!the!asynchronous!output!of!the!previous!CLU.!This!output!allows!multiple!CLUs!to!be!chained!
and!used!together.!For!example,!the!output!of!CLU0!is!the!carry!input!to!CLU1.!This!signal!assignment!is!fixed.!If!
an!embedded!programmer!wanted!to!connect!the!output!of!CLU0!to!CLU3,!they!would!use!the!destination!CLU’s!
input!multiplexers!A!or!B.!
!
Look!Up!Table+
At!the!heart!of!each!CLU!is!a!hardware!look!up!table,!which!is!a!multiplexer!with!MXA,!MXB,!and!the!carry!as!its!
select!signals!as!shown!in!Figure!3.!This!may!look!familiar!as!it’s!similar!to!a!lookBup,!tableBbased!FPGA!block.!
'
'
Figure'2:'Block'Diagram'of'a'Configurable'Logic'Unit'
The!embedded!programmer!chooses!the!output!state!for!every!possible!select!signal!state!combination.!Since!
there!are!three!select!signals,!there!are!8!possible!inputs,!and!8!LUT!outputs!must!be!determined.!An!incomplete!
lookup!table!is!shown!in!Table!1.!
www.silabs.com!!|!Configurable!Logic!in!Microcontrollers!Revolutionizes!Small!Applications!! ! !
! ! ! ! ! 4!
!
!
!
'
'
'
'
'
Table'1:'Look'Up'Table'
Implementing!AND!and!XORi!
Wth!MXA!and!MXB!as!the!inputs,!the!Boolean!AND!could!easily!be!implemented!in!the!CLU.!The!output!is!logic!
high!when!both!multiplexer!inputs!are!logic!high,!otherwise,!the!output!is!logic!low.!The!completed!look!up!table!is!
shown!in!Table!2.!
''
'
'
'
'
Table'2:'Look'Up'Table'–'MXA'AND'MXB'
Once!the!look!up!table!is!determined,!the!desired!LUT!output!is!written!to!a!CLU!register!by!firmware!during!
initialization.!In!the!example!above,!the!hex!value!0xC0!should!be!written!to!the!dedicated!CLU!LUT!output!
register.!
As!a!second!example,!let’s!implement!a!Boolean!XOR!function!with!MXA!and!MXB!as!the!inputs.!The!output!is!
logic!high!only!when!only!one!of!the!inputs!is!logic!high]!otherwise,!the!output!is!logic!low.!The!completed!look!up!
table!is!shown!in!Table!3,!and!the!value!0x3C!should!be!written!to!the!corresponding!CLU!register.!
!
!
www.silabs.com!!|!Configurable!Logic!in!Microcontrollers!Revolutionizes!Small!Applications!! ! !
! ! ! ! ! 5!
!
!
®'Copyright'2015,'Silicon'Laboratories'Inc.'All'Rights'Reserved.'Silicon'Laboratories,'Silicon'Labs,'SiLabs'and'the'
Silicon'Labs'logo,'CMEMS®,'EFM,'EFM32,'EFR,'Energy'Micro,'Energy'Micro'logo'and'combinations'thereof,'"the'
world’s'most'energy'friendly'microcontrollers",'Ember®,'EZLink®,'EZMac®,'EZRadio®,'EZRadioPRO®,'DSPLL®,'
ISOmodem'®,'Precision32®,'ProSLIC®,'SiPHY®,'USBXpress®'and'others'are'trademarks'or'registered'trademarks'of'
Silicon'Laboratories'Inc.'All'other'products'or'brand'names'mentioned'herein'are'trademarks'of'their'respective'holders.!
!
!
!
!
!
!
!
!
'
Table'3:'Look'Up'Table'–'MXA'XOP'MXB'
The!Configurable!Logic!Output!
The!asynchronous!output!of!the!CLU!look!up!table!is!connected!to!the!carry!input!of!the!next!CLU.!This!
asynchronous!output!can!also!be!routed!directly!to!a!port!pin,!for!instance,!to!connect!to!and!control!external!
components.!The!output!pin!of!a!CLU!can!also!be!an!input!pin!for!other!peripherals.!
Synchronizing!the!Output!!
Each!CLU!has!an!integrated!D!flipBflop.!Asynchronous!LUT!output!can!pass!through!this!optional!D!flipBflop!before!
the!signal!is!routed!to!a!port!pin.!The!D!flipBflop!can!be!clocked!by!number!of!sources,!including!the!MXA!and!
carry!inputs,!a!timer!overflow,!or!a!system!clock.!The!asynchronous!output!is!synchronized!to!the!system!clock!
and!routed!to!other!peripherals!on!the!MCU.!The!rising!and/or!falling!edge!of!the!synchronized!output!can!all!
trigger!an!interrupt,!allowing!firmware!to!take!action!upon!a!CLU!event.!
Applications!and!Benefits!
Microcontrollers!now!come!with!more!integrated!peripherals!and!building!blocks!than!ever!before,!and!some!of!
these!features!have!configurable!logic!that!allows!complex!functions!to!be!implemented!without!the!need!for!
external!components.!With!less!than!four!builtBin!configurable!logic!units!(CLUs),!an!embedded!programmer!now!
can!decide!to!implement!custom!and!integrated!button!debouncing,!D!and!SR!latching,!Manchester!
encoding/decoding,!or!Biphase!Mark!encoding/decoding!hardware.!!
!
For!more!information!on!these!examples!and!start!using!the!configurable!logic!units,!see!Silicon+Labs+
Application+Note+AN921,!which!uses!the!EFM8+Laser+Bee!(EFM8LB1)!microcontroller!family!featuring!4!CLUs,!
a!14Bbit!ADC!with!automatic!sequencing,!4!voltage!DACs,!calibrated!temperature!sensor,!and!a!72!MHz!pipelined!
8051!core.!!

More Related Content

Similar to Configurable Logic in Microcontrollers Revolutionizes Small Applications

Codemotion 2013 Madrid - Modern OOP embedded development with .NET Micro Fram...
Codemotion 2013 Madrid - Modern OOP embedded development with .NET Micro Fram...Codemotion 2013 Madrid - Modern OOP embedded development with .NET Micro Fram...
Codemotion 2013 Madrid - Modern OOP embedded development with .NET Micro Fram...
Lorenzo Maiorfi
 
22 Re-Engineering Traditional Learning Model with Outcome-Based Learning Curv...
22 Re-Engineering Traditional Learning Model with Outcome-Based Learning Curv...22 Re-Engineering Traditional Learning Model with Outcome-Based Learning Curv...
22 Re-Engineering Traditional Learning Model with Outcome-Based Learning Curv...
ijtsrd
 

Similar to Configurable Logic in Microcontrollers Revolutionizes Small Applications (20)

Our Brave Modular Future
Our Brave Modular FutureOur Brave Modular Future
Our Brave Modular Future
 
Use open source and rapid prototyping to put magic in magical products in IoT
Use open source and rapid prototyping to put magic in magical products in IoTUse open source and rapid prototyping to put magic in magical products in IoT
Use open source and rapid prototyping to put magic in magical products in IoT
 
Robust MLOps with Open-Source: ModelDB, Docker, Jenkins, and Prometheus
Robust MLOps with Open-Source: ModelDB, Docker, Jenkins, and PrometheusRobust MLOps with Open-Source: ModelDB, Docker, Jenkins, and Prometheus
Robust MLOps with Open-Source: ModelDB, Docker, Jenkins, and Prometheus
 
Best Practices to create High Load Websites
Best Practices to create High Load WebsitesBest Practices to create High Load Websites
Best Practices to create High Load Websites
 
Microservices, Kubernetes and Istio - A Great Fit!
Microservices, Kubernetes and Istio - A Great Fit!Microservices, Kubernetes and Istio - A Great Fit!
Microservices, Kubernetes and Istio - A Great Fit!
 
Beginners_Guide_to_PLC_Programming_How_t.pdf
Beginners_Guide_to_PLC_Programming_How_t.pdfBeginners_Guide_to_PLC_Programming_How_t.pdf
Beginners_Guide_to_PLC_Programming_How_t.pdf
 
Building frameworks: from concept to completion
Building frameworks: from concept to completionBuilding frameworks: from concept to completion
Building frameworks: from concept to completion
 
Codemotion 2013 Madrid - Modern OOP embedded development with .NET Micro Fram...
Codemotion 2013 Madrid - Modern OOP embedded development with .NET Micro Fram...Codemotion 2013 Madrid - Modern OOP embedded development with .NET Micro Fram...
Codemotion 2013 Madrid - Modern OOP embedded development with .NET Micro Fram...
 
ES~Conference Mexico Nowadays Architecture Trends, from Monolith to Microserv...
ES~Conference Mexico Nowadays Architecture Trends, from Monolith to Microserv...ES~Conference Mexico Nowadays Architecture Trends, from Monolith to Microserv...
ES~Conference Mexico Nowadays Architecture Trends, from Monolith to Microserv...
 
IoT in the Cloud: Build & Unleash the Value in your Renewable Energy System
IoT in the Cloud: Build & Unleash the Value in your Renewable Energy SystemIoT in the Cloud: Build & Unleash the Value in your Renewable Energy System
IoT in the Cloud: Build & Unleash the Value in your Renewable Energy System
 
Node-RED workshop at IoT Toulouse
Node-RED workshop at IoT ToulouseNode-RED workshop at IoT Toulouse
Node-RED workshop at IoT Toulouse
 
Software Patterns
Software PatternsSoftware Patterns
Software Patterns
 
20240303 QFM006 Elixir Reading List February 2024
20240303 QFM006 Elixir Reading List February 202420240303 QFM006 Elixir Reading List February 2024
20240303 QFM006 Elixir Reading List February 2024
 
Apiworld
ApiworldApiworld
Apiworld
 
Jconf Colombia Nowadays Architecture Trends, from Monolith to Microservices a...
Jconf Colombia Nowadays Architecture Trends, from Monolith to Microservices a...Jconf Colombia Nowadays Architecture Trends, from Monolith to Microservices a...
Jconf Colombia Nowadays Architecture Trends, from Monolith to Microservices a...
 
Coder sans peur du changement avec la meme pas mal hexagonal architecture
Coder sans peur du changement avec la meme pas mal hexagonal architectureCoder sans peur du changement avec la meme pas mal hexagonal architecture
Coder sans peur du changement avec la meme pas mal hexagonal architecture
 
nikhil.pptx
nikhil.pptxnikhil.pptx
nikhil.pptx
 
22 Re-Engineering Traditional Learning Model with Outcome-Based Learning Curv...
22 Re-Engineering Traditional Learning Model with Outcome-Based Learning Curv...22 Re-Engineering Traditional Learning Model with Outcome-Based Learning Curv...
22 Re-Engineering Traditional Learning Model with Outcome-Based Learning Curv...
 
Lean and Easy IoT Applications with OSGi and Eclipse Concierge
Lean and Easy IoT Applications with OSGi and Eclipse ConciergeLean and Easy IoT Applications with OSGi and Eclipse Concierge
Lean and Easy IoT Applications with OSGi and Eclipse Concierge
 
WebLogic Event Server - Alexandre Alves, BEA
WebLogic Event Server - Alexandre Alves, BEAWebLogic Event Server - Alexandre Alves, BEA
WebLogic Event Server - Alexandre Alves, BEA
 

Recently uploaded

anas about venice for grade 6f about venice
anas about venice for grade 6f about veniceanas about venice for grade 6f about venice
anas about venice for grade 6f about venice
anasabutalha2013
 
Cree_Rey_BrandIdentityKit.PDF_PersonalBd
Cree_Rey_BrandIdentityKit.PDF_PersonalBdCree_Rey_BrandIdentityKit.PDF_PersonalBd
Cree_Rey_BrandIdentityKit.PDF_PersonalBd
creerey
 
FINAL PRESENTATION.pptx12143241324134134
FINAL PRESENTATION.pptx12143241324134134FINAL PRESENTATION.pptx12143241324134134
FINAL PRESENTATION.pptx12143241324134134
LR1709MUSIC
 
NewBase 24 May 2024 Energy News issue - 1727 by Khaled Al Awadi_compresse...
NewBase   24 May  2024  Energy News issue - 1727 by Khaled Al Awadi_compresse...NewBase   24 May  2024  Energy News issue - 1727 by Khaled Al Awadi_compresse...
NewBase 24 May 2024 Energy News issue - 1727 by Khaled Al Awadi_compresse...
Khaled Al Awadi
 

Recently uploaded (20)

Lookback Analysis
Lookback AnalysisLookback Analysis
Lookback Analysis
 
Transforming Max Life Insurance with PMaps Job-Fit Assessments- Case Study
Transforming Max Life Insurance with PMaps Job-Fit Assessments- Case StudyTransforming Max Life Insurance with PMaps Job-Fit Assessments- Case Study
Transforming Max Life Insurance with PMaps Job-Fit Assessments- Case Study
 
Taurus Zodiac Sign_ Personality Traits and Sign Dates.pptx
Taurus Zodiac Sign_ Personality Traits and Sign Dates.pptxTaurus Zodiac Sign_ Personality Traits and Sign Dates.pptx
Taurus Zodiac Sign_ Personality Traits and Sign Dates.pptx
 
8 Questions B2B Commercial Teams Can Ask To Help Product Discovery
8 Questions B2B Commercial Teams Can Ask To Help Product Discovery8 Questions B2B Commercial Teams Can Ask To Help Product Discovery
8 Questions B2B Commercial Teams Can Ask To Help Product Discovery
 
anas about venice for grade 6f about venice
anas about venice for grade 6f about veniceanas about venice for grade 6f about venice
anas about venice for grade 6f about venice
 
Cree_Rey_BrandIdentityKit.PDF_PersonalBd
Cree_Rey_BrandIdentityKit.PDF_PersonalBdCree_Rey_BrandIdentityKit.PDF_PersonalBd
Cree_Rey_BrandIdentityKit.PDF_PersonalBd
 
Meaningful Technology for Humans: How Strategy Helps to Deliver Real Value fo...
Meaningful Technology for Humans: How Strategy Helps to Deliver Real Value fo...Meaningful Technology for Humans: How Strategy Helps to Deliver Real Value fo...
Meaningful Technology for Humans: How Strategy Helps to Deliver Real Value fo...
 
Byrd & Chen’s Canadian Tax Principles 2023-2024 Edition 1st edition Volumes I...
Byrd & Chen’s Canadian Tax Principles 2023-2024 Edition 1st edition Volumes I...Byrd & Chen’s Canadian Tax Principles 2023-2024 Edition 1st edition Volumes I...
Byrd & Chen’s Canadian Tax Principles 2023-2024 Edition 1st edition Volumes I...
 
Improving profitability for small business
Improving profitability for small businessImproving profitability for small business
Improving profitability for small business
 
India’s Recommended Women Surgeons to Watch in 2024.pdf
India’s Recommended Women Surgeons to Watch in 2024.pdfIndia’s Recommended Women Surgeons to Watch in 2024.pdf
India’s Recommended Women Surgeons to Watch in 2024.pdf
 
Unlock Your TikTok Potential: Free TikTok Likes with InstBlast
Unlock Your TikTok Potential: Free TikTok Likes with InstBlastUnlock Your TikTok Potential: Free TikTok Likes with InstBlast
Unlock Your TikTok Potential: Free TikTok Likes with InstBlast
 
FINAL PRESENTATION.pptx12143241324134134
FINAL PRESENTATION.pptx12143241324134134FINAL PRESENTATION.pptx12143241324134134
FINAL PRESENTATION.pptx12143241324134134
 
Pitch Deck Teardown: RAW Dating App's $3M Angel deck
Pitch Deck Teardown: RAW Dating App's $3M Angel deckPitch Deck Teardown: RAW Dating App's $3M Angel deck
Pitch Deck Teardown: RAW Dating App's $3M Angel deck
 
Hyundai capital 2024 1quarter Earnings release
Hyundai capital 2024 1quarter Earnings releaseHyundai capital 2024 1quarter Earnings release
Hyundai capital 2024 1quarter Earnings release
 
Cracking the Workplace Discipline Code Main.pptx
Cracking the Workplace Discipline Code Main.pptxCracking the Workplace Discipline Code Main.pptx
Cracking the Workplace Discipline Code Main.pptx
 
RMD24 | Retail media: hoe zet je dit in als je geen AH of Unilever bent? Heid...
RMD24 | Retail media: hoe zet je dit in als je geen AH of Unilever bent? Heid...RMD24 | Retail media: hoe zet je dit in als je geen AH of Unilever bent? Heid...
RMD24 | Retail media: hoe zet je dit in als je geen AH of Unilever bent? Heid...
 
Using Generative AI for Content Marketing
Using Generative AI for Content MarketingUsing Generative AI for Content Marketing
Using Generative AI for Content Marketing
 
NewBase 24 May 2024 Energy News issue - 1727 by Khaled Al Awadi_compresse...
NewBase   24 May  2024  Energy News issue - 1727 by Khaled Al Awadi_compresse...NewBase   24 May  2024  Energy News issue - 1727 by Khaled Al Awadi_compresse...
NewBase 24 May 2024 Energy News issue - 1727 by Khaled Al Awadi_compresse...
 
TriStar Gold Corporate Presentation May 2024
TriStar Gold Corporate Presentation May 2024TriStar Gold Corporate Presentation May 2024
TriStar Gold Corporate Presentation May 2024
 
Global Interconnection Group Joint Venture[960] (1).pdf
Global Interconnection Group Joint Venture[960] (1).pdfGlobal Interconnection Group Joint Venture[960] (1).pdf
Global Interconnection Group Joint Venture[960] (1).pdf
 

Configurable Logic in Microcontrollers Revolutionizes Small Applications

  • 1. www.silabs.com | Smart. Connected. Energy-Friendly. Configurable Logic in Microcontrollers Revolutionizes Small Applications By Stephen To, Applications Engineer, Microcontrollers, Silicon Labs
  • 2. www.silabs.com!!|!Configurable!Logic!in!Microcontrollers!Revolutionizes!Small!Applications!! ! ! ! ! ! ! ! 1! ! ! Introduction+ Microcontrollers!(MCU)!are!becoming!even!more!flexible!as!suppliers!integrate!more!external!components!onB chip.!For!engineers,!this!means!a!new!arsenal!of!tools!and!possibilities!for!embedded!development.!Configurable! logic!(CL)!hardware!is!one!of!these!relatively!new!addBons!to!the!microcontroller!market.!! ! The!CL!hardware!implements!combinatorial!logic!like!the!basic!Boolean!AND,!OR,!or!XOR!functions,!as!well!as! sequential!logic!like!latches.!This!flexibility!allows!embedded!programmers!to!easily!add!their!own,!custom! functionality.!From!simple!signal!inverters!to!more!complex!Manchester!decoders,!the!configurable!logic!can! operate!completely!independently!from!the!processor!core!(CPU).!The!configurable!logic!hardware!is!typically! programmed!in!C!and!initializes!a!set!of!dedicated!registers.!With!C!as!the!programming!language,!embedded! designers!will!not!need!to!learn!another!programming!language!such!as!VHDL.!! ! Microcontrollers!with!configurable!logic!help!reduce!BOM!costs!and!minimize!board!size!by!integrating!offBchip! glue!logic.!CPU!resources!are!freed!because!configurable!logic!operates!independently!from!the!core.!In!addition,! the!capabilities!of!other!peripherals!are!extended!when!they!are!connected!to!configurable!logic.!With!all!this! flexibility,!small,!powerBefficient!MCUs!can!be!used!in!applications!previously!exclusive!to!larger,!fullyBconfigurable! devices!like!FPGAs!or!expensive!ASICs.!! ! To!understand!the!capabilities!of!the!highlyBflexible!features!of!configurable!logic,!this!paper!will!explore!the! general!operation!of!CL!hardware!on!currently!available!microcontrollers,!as!well!as!how!configurable!logic!drives! smaller!and!cheaper!applications.! ! ! Overview! On!a!microcontroller,!a!configurable!logic!unit!(CLU)!is!a!piece!of!dedicated!hardware!consisting!of!userB programmable!digital!logic!that!operates!without!CPU!intervention.!Multiple!CLUs!are!typically!provided!on!an! MCU.!Figure!1!shows!a!simplified!block!diagram!of!a!single!CLU!with!three!inputs!and!one!output.! !
  • 3. www.silabs.com!!|!Configurable!Logic!in!Microcontrollers!Revolutionizes!Small!Applications!! ! ! ! ! ! ! ! 2! ! ! ! Figure'1:'Block'Diagram'of'a'Single'Configurable'Logic'Unit' The!Configurable!Logic!Inputs! The!three!key!input!signals!in!a!CLU!consists!of!! •! Input!multiplexer!A!(MXA)! •! Input!multiplexer!B!(MXB)!! •! Carry!signal! ! Multiplexer!A!can!select!from!a!set!of!inputs,!like!external!pins!or!signals!from!other!peripherals.!As!shown!in! Figure!2,!these!inputs!can!vary!from!a!timer!overflow!to!a!PCA!channel.!The!CLU!can!also!operate!in!conjunction! with!serial!peripherals!such!as!UART!or!SPI!because!the!external!pin!inputs!can!be!both!a!serial!peripheral! output,!as!well!as!a!CLU!input.!Additionally,!input!multiplexer!A!can!select!the!output!of!any!CLU,!including!its! own!output.!Input!multiplexer!B!operates!similarly,!but!with!a!different!set!of!external!pins!and!signals!from!other! peripherals.! ! ! ! ! ! !
  • 4. www.silabs.com!!|!Configurable!Logic!in!Microcontrollers!Revolutionizes!Small!Applications!! ! ! ! ! ! ! ! 3! ! ! ! Figure'1:'Simplified'Block'Diagram'of'a'Configurable'Logic'Unit' ' ! The!carry!signal!is!the!asynchronous!output!of!the!previous!CLU.!This!output!allows!multiple!CLUs!to!be!chained! and!used!together.!For!example,!the!output!of!CLU0!is!the!carry!input!to!CLU1.!This!signal!assignment!is!fixed.!If! an!embedded!programmer!wanted!to!connect!the!output!of!CLU0!to!CLU3,!they!would!use!the!destination!CLU’s! input!multiplexers!A!or!B.! ! Look!Up!Table+ At!the!heart!of!each!CLU!is!a!hardware!look!up!table,!which!is!a!multiplexer!with!MXA,!MXB,!and!the!carry!as!its! select!signals!as!shown!in!Figure!3.!This!may!look!familiar!as!it’s!similar!to!a!lookBup,!tableBbased!FPGA!block.! ' ' Figure'2:'Block'Diagram'of'a'Configurable'Logic'Unit' The!embedded!programmer!chooses!the!output!state!for!every!possible!select!signal!state!combination.!Since! there!are!three!select!signals,!there!are!8!possible!inputs,!and!8!LUT!outputs!must!be!determined.!An!incomplete! lookup!table!is!shown!in!Table!1.!
  • 5. www.silabs.com!!|!Configurable!Logic!in!Microcontrollers!Revolutionizes!Small!Applications!! ! ! ! ! ! ! ! 4! ! ! ! ' ' ' ' ' Table'1:'Look'Up'Table' Implementing!AND!and!XORi! Wth!MXA!and!MXB!as!the!inputs,!the!Boolean!AND!could!easily!be!implemented!in!the!CLU.!The!output!is!logic! high!when!both!multiplexer!inputs!are!logic!high,!otherwise,!the!output!is!logic!low.!The!completed!look!up!table!is! shown!in!Table!2.! '' ' ' ' ' Table'2:'Look'Up'Table'–'MXA'AND'MXB' Once!the!look!up!table!is!determined,!the!desired!LUT!output!is!written!to!a!CLU!register!by!firmware!during! initialization.!In!the!example!above,!the!hex!value!0xC0!should!be!written!to!the!dedicated!CLU!LUT!output! register.! As!a!second!example,!let’s!implement!a!Boolean!XOR!function!with!MXA!and!MXB!as!the!inputs.!The!output!is! logic!high!only!when!only!one!of!the!inputs!is!logic!high]!otherwise,!the!output!is!logic!low.!The!completed!look!up! table!is!shown!in!Table!3,!and!the!value!0x3C!should!be!written!to!the!corresponding!CLU!register.! ! !
  • 6. www.silabs.com!!|!Configurable!Logic!in!Microcontrollers!Revolutionizes!Small!Applications!! ! ! ! ! ! ! ! 5! ! ! ®'Copyright'2015,'Silicon'Laboratories'Inc.'All'Rights'Reserved.'Silicon'Laboratories,'Silicon'Labs,'SiLabs'and'the' Silicon'Labs'logo,'CMEMS®,'EFM,'EFM32,'EFR,'Energy'Micro,'Energy'Micro'logo'and'combinations'thereof,'"the' world’s'most'energy'friendly'microcontrollers",'Ember®,'EZLink®,'EZMac®,'EZRadio®,'EZRadioPRO®,'DSPLL®,' ISOmodem'®,'Precision32®,'ProSLIC®,'SiPHY®,'USBXpress®'and'others'are'trademarks'or'registered'trademarks'of' Silicon'Laboratories'Inc.'All'other'products'or'brand'names'mentioned'herein'are'trademarks'of'their'respective'holders.! ! ! ! ! ! ! ! ! ' Table'3:'Look'Up'Table'–'MXA'XOP'MXB' The!Configurable!Logic!Output! The!asynchronous!output!of!the!CLU!look!up!table!is!connected!to!the!carry!input!of!the!next!CLU.!This! asynchronous!output!can!also!be!routed!directly!to!a!port!pin,!for!instance,!to!connect!to!and!control!external! components.!The!output!pin!of!a!CLU!can!also!be!an!input!pin!for!other!peripherals.! Synchronizing!the!Output!! Each!CLU!has!an!integrated!D!flipBflop.!Asynchronous!LUT!output!can!pass!through!this!optional!D!flipBflop!before! the!signal!is!routed!to!a!port!pin.!The!D!flipBflop!can!be!clocked!by!number!of!sources,!including!the!MXA!and! carry!inputs,!a!timer!overflow,!or!a!system!clock.!The!asynchronous!output!is!synchronized!to!the!system!clock! and!routed!to!other!peripherals!on!the!MCU.!The!rising!and/or!falling!edge!of!the!synchronized!output!can!all! trigger!an!interrupt,!allowing!firmware!to!take!action!upon!a!CLU!event.! Applications!and!Benefits! Microcontrollers!now!come!with!more!integrated!peripherals!and!building!blocks!than!ever!before,!and!some!of! these!features!have!configurable!logic!that!allows!complex!functions!to!be!implemented!without!the!need!for! external!components.!With!less!than!four!builtBin!configurable!logic!units!(CLUs),!an!embedded!programmer!now! can!decide!to!implement!custom!and!integrated!button!debouncing,!D!and!SR!latching,!Manchester! encoding/decoding,!or!Biphase!Mark!encoding/decoding!hardware.!! ! For!more!information!on!these!examples!and!start!using!the!configurable!logic!units,!see!Silicon+Labs+ Application+Note+AN921,!which!uses!the!EFM8+Laser+Bee!(EFM8LB1)!microcontroller!family!featuring!4!CLUs,! a!14Bbit!ADC!with!automatic!sequencing,!4!voltage!DACs,!calibrated!temperature!sensor,!and!a!72!MHz!pipelined! 8051!core.!!