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
Smarter Life
  • Challenges & Projects
  • Design Challenges
  • Smarter Life
  • More
  • Cancel
Smarter Life
Blog Testing the New Prototype for the Brainwaves Appliance Controller
  • Blog
  • Forum
  • Documents
  • Files
  • Events
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
  • Share
  • More
  • Cancel
Group Actions
  • Group RSS
  • More
  • Cancel
Engagement
  • Author Author: ciorga
  • Date Created: 31 Jan 2015 8:52 PM Date Created
  • Views 1248 views
  • Likes 1 like
  • Comments 4 comments
  • brainwaves_appliance_control
  • smarter_life_challenge
  • smarter_life
  • psoc5lp
Related
Recommended

Testing the New Prototype for the Brainwaves Appliance Controller

ciorga
ciorga
31 Jan 2015

Here is the latest update on my work on the brainwaves appliance controller. Last update I showed how I designed a new prototype board, which probably will be the last prototype until I design the final product.   In the meantime the board came back from fabrication and I have soldered all the components.  Here is a picture of the assembled prototype board.  

 

image

 

In my last blog post I also described a weird problem I encountered with Cypress PSoC Creator Software.  I don’t know what generated that problem, but one day when I opened the design and tried to build it I got an error message pointing out that I am using four operational amplifiers but the device has only two.  I posted this question on the discussions board (link goes here) and I’ve got an answer explaining that it was a defect in PSoC Creator 2.1 and suggesting that I install the newly released version 3.1.

 

So I have downloaded and installed PSoC Creator version 3.1 and indeed the two missing operational amplifiers came back and now I see all four of them in the analog resources window.  Next I built the project and it worked fine without error.  I then programmed the PSoC5LP on my prototype assembly and I started to verify the functionality.

 

Here is a video showing how I “teach” the brainwaves appliance controller the infrared remote control codes for turning on and off a TV set and for changing the channels up and down.  So there are three buttons at the top of the prototype board: the one on the left selects one of the eight memorized codes, the one in the middle sends the infrared signal to the receiver, and the one on the right side puts the system in “learning” mode.  While in learning mode the LED display blinks, waiting for the user to point the remote control to the system and press the function button that needs to be memorized (there are two infrared receivers on this system).

 

 

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

 

 

So, close to the end of this video, after I made the system learn the three functions mentioned above, I selected memory location one and tried to send the memorized infrared code to the receiver.  But the receiver did not respond, so I knew that something is wrong.  This system worked well on a PSoC5LP part of a Cypress CY8CKIT-001 development kit, as I have shown in a previous blog post (link goes here), but now it does not work on the PSoC 5LP mounted on the Schmartboard module (which is part of this prototype system).

 

 

So I started to troubleshoot this problem, and the first thing I measured was the signal sent to the infrared LED, as you could see towards the end of the video.  This signal is shown in the picture below:

 

image

 

I then used the built in frequency measurement function of the oscilloscope to read the frequency, which came as expected around 38kHz.  The problem with this signal is that there is no pulse modulation; there is only the carrier transmitted in two sequential periods of time.  Next I measured what the infrared receivers read from the remote control during learning mode.  The waveform is shown in the figure below:

 

image

 

Notice on this picture the preamble followed by a sequence of pulse-width modulated square waves.  This is the demodulated signal which should correspond to sequences of 38kHz carrier for pulse low regions and flat zero volts for pulse high regions.  But the system does not recreate this signal; the signal sent to the infrared LED contains only the 38kHz carrier component.

 

This means that the prototype system does not work properly, so I continued with looking at the code that runs in the Cortex MCU inside the Cypress PSoC5LP.  So I opened the main.c file and to my surprise the file was unexpectedly ending at line 948, as I am showing in the following picture.

 

image

 

 

This was strange, so I thought that the main.c file somehow got corrupted while installing the new version of PSoC Creator.  So I said “no problem” I have the file saved in the archive.  I opened the main.c in the archive with notepad and it looked complete, so I copied it from the archive and reopened the project.  But PSoC Creator showed, like before, only 948 lines, which surprised me again.

 

I did not despair and I opened the old PSoC Creator 2.1  that I still have installed on a different computer, and there the main.c file looked complete, as I am showing in the following plot.

 

image

 

Notice the end of the file is now on line 1117.  So something is going wrong with the newly released 3.1 version of PSoC Creator that makes it not show all the lines in my main.c file.

 

Looking with more attention at the main.c opened in PSoC Creator version 3.1 I noticed that actually all lines between 949 and 1117 are “clustered” in a single very long line 948, as I am showing in the screenshot below.

 

image

 

Notice the end of the file that was supposed to be on line 1117 is now at the end of the long 948 line.  Sweeping left to right I could see that all the information contained in lines 948 to 1117 is contained now in line 948.  The square symbols might correspond to new line characters.

 

But again I did not despair and I started to “brute force” edit the main.c file to add “Enter” commands and split line 948 into individual lines all the way to 1117.  But PSoC Creator did not cooperate and acted strangely by changing my edits on previous lines, deleting some characters, so after a few tries I decided that all my efforts only prolonged the misery and the real solution would be to get the PSoC Creator fixed. 

 

So I am stuck now: I have a PSoC 2.1 project that has two missing operational amplifiers in PSoC5LP chip resources but it shows all lines in main.c, and I have a PSoC Creator 3.1 that has all four operational amplifiers in PSoC5LP resources but it “chops” my main.c file.

 

I will post another question on the discussion forum and wait for a Cypress application engineer to respond hoping that I will find a solution to this issue.

 

That’s it for now; I will come back with a new update as I get more work done.

 

Best Wishes,

Cosmin

  • Sign in to reply
  • ciorga
    ciorga over 10 years ago in reply to clem57

    Thank you Clem for the comments and advice.  I will check my code for repetitive code and long loops.

    Best Wishes,

    Cosmin

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • ciorga
    ciorga over 10 years ago in reply to DAB

    Thank yo DAB for the comments; I will contact Cypress to see if they have an idea why my PSoC Creator behaves this way.

    Best Wishes,

    Cosmin

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • clem57
    clem57 over 10 years ago

    @ Cosmin Iorga

    Can you break up the code into other libraries? In my world of software, big usually led to problems when debugging.. Look for any repetitive code or long loops.

     

    Clem

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

    Nice update Cosmin,

     

    When I got into this business over forty years ago the first thing I learned was to check on what the development tools did TO me.

     

    Over the years I have run into many interesting and subtle artifacts left in editors, assemblers, compilers and IDE's.

     

    Hopefully Cypress will clear up the issue.  I am looking forward to see how you develop this device.

     

    DAB

    • 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