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.
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).
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:
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:
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.
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.
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.
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.