element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • 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
Cypress Kits
  • Products
  • Dev Tools
  • Cypress Kits
  • More
  • Cancel
Cypress Kits
Forum PSoC 4 Pioneer Kit Community Project#093 – 4 Channel Multiplexed Comparator (No Code)
  • Blog
  • Forum
  • Documents
  • Polls
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join Cypress Kits to participate - click to join for free!
Actions
  • Share
  • More
  • Cancel
Forum Thread Details
  • Replies 4 replies
  • Subscribers 26 subscribers
  • Views 958 views
  • Users 0 members are here
Related

PSoC 4 Pioneer Kit Community Project#093 – 4 Channel Multiplexed Comparator (No Code)

cy.wbz
cy.wbz over 11 years ago

Hello!

 

In today’s example we expand on the comparator example released last week (#090). In today’s example we are creating a multiplexed comparator that reads multiple signals using a single comparator. The example uses an analog multiplexer to change input and threshold signals all in the PSoC hardware. This means that the example requires no code and consumes no CPU time to execute. After we make three calls to start the components, the remaining firmware we write for this example is the following:

 

for(;;)

{

//Good job, go get some coffee

}

 

If you can remember from some of our earlier examples we talked about the advantage that PSoC has allowing customers to design and configure the chip hardware into the device they need not the device that is available. There is an enormous potential using the digital and analog resources to design hardware only functions into the chip, requiring little to no code to execute. We’ve seen this in examples #001 , #066 and our UDB training series (Training 110 to 211). In today’s example we increase the complexity of those base examples to show the user how to configure a 4 channel Multiplexed Comparator.

 


image

 

Forum Post Attachments:

 

At the bottom of this post we are including the following items:

  • Example Project Zip File
  • Project Images

 

Components Used: 

 

The user can download the example project at the bottom of this post. The project uses the following list of Creator Components:

  • Amux
  • Comparator
  • CySync
  • D-Flip Flop w/ Enable
  • IDAC
  • Counter
  • LUT
  • CyPins

 

Firmware Description:

 

The main.c firmware is included in the example project. Please review the commented sections for more details.

 

image


image

 

In the main function all components are started. Once started, at each clock pulse the multiplexer sequentially switches input signals and threshold voltages. Threshold voltages are generated by the resistances connected to the IDAC through the multiplexer. The input signal is compared to the corresponding threshold voltage and the output is fed to the latch logic block. The latch clock and channel select signal latches the comparator output to the active channel.

 

The Control logic if implemented using LUT based decoder and counter component. The Amux_Input and Amux_Th components are used to select input signals and corresponding comparator thresholds. The comparator is used to compare the input signal with the threshold signal and generate output signal accordingly. The IDAC is used to generate threshold voltages for comparison. The Sync component synchronizes the comparator output with the high frequency clock.

 

The threshold voltages fed to the comparator is like a staircase depending upon the resistances used. Resistances 2.2k, 4.4k, 6.8k, and 8k are connected to reference pins as described in development kit configuration section with an IDAC sourcing a current of 100 micro-amps. The following table describes the threshold voltages levels generated using the resistors.

 


image

 

The input, threshold signals and output waveform is shown in the following image. The project is designed for input signal frequency below 1KHz.

 


image

 

Hardware Connections:

 

There are no hardware configurations for this example. Simply attach your o-scope to output pins to see the signal output from the comparator.

 


image

 

Test Your Project:

 

Program the Pioneer kit with the example project, connect your input sources and connect the o-scope to the signal output. View the signal output.

 

I hope this example can help you in your design.

 

Best,

Matt

Attachments:
0804.Project Images.zip
Multiplexed_Comparator01.zip
  • Sign in to reply
  • Cancel
  • jesusantoniocar
    jesusantoniocar over 11 years ago

    Hello Matt.

    Great project.

    Psoc 4 and in general psoc families are a realy mixed signal system only on chip, excellent example , i am very surprised  with the little code in the main c file for this application.

    regards,

    Jesus

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • DAB
    DAB over 11 years ago

    Hi Matt,

     

    An interesting way to do multiplexing.

     

    I definately need to take some time to look at the circuit in detail.  You are doing some really interesting things with the programmable hardware.

     

    Thanks

    DAB

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • Former Member
    Former Member over 9 years ago

    if i want to do this project in psoc3 what are the changes i have to do

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • DAB
    DAB over 9 years ago in reply to Former Member

    If you check the PSOC software, it provides a wealth of information about how to use each PSOC series device.

     

    You will find that the PSOC 3 does not include some PSOC 4 capability, but you might be able to use some of the programmable features to bridge the gap.

     

    DAB

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • 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