- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
what I am trying to do is pass different period values (2 bytes) to counter 1, 2, and 3 through the hyper terminal (have them saved in a memory or buffer) then after I do a an external reset my outputs from the TCPWM will all start at the same time (by the aid of the one shot counter 4) and they will use the period values I input through the terminal. What I am currently stuck at is how do I change the fixed period values every time I do an external reset (is there a way to pass new period values for the TCPWM and have them sit in a buffer or internal memory until I change them again). And how to I combine two bytes from the hyper terminal and use this value to pass unto the period register, any help or direction is greatly appreciated
Solved! Go to Solution.
- Labels:
-
PSoC 4 Architecture
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
Thanks for this three days weekend in Japan, I had some time to play with my PSoC board.
I tried with CY8CKIT-044, so pin and other config may different with yours.
And this is a quick prototype so (as usual) may not work correctly.
Having written that, as you were writing that you want to run the board with given setting after reset,
I assumed that you need some non volatile memory to store the configuration.
So I used Em_EEPROM.
Note: The fourth PWM is used to generate 25kHz external clock, so if you have an external 25kHz clock
this PWM is not required. (I jumpered Clock_Out_25KHz with Clock_In_25KHz outside the board).
As you were using most of ISRs only to flip the signal, instead I used TCPWM with period and compare.
And I cheated terminal I/O using my tty utility sample.
When my program is down loaded to the board and get reset, its Em_EEPROM has no content
so the program uses the default value and start running after setting the default values.
All three signals are running with period = 100 and compare = 50.
(Actually in the TCPWM 99 and 49)
Then I stopped the PWM by typing "stop".
I could type "stop 1" to stop counter1, "stop 2" for Counter 2, "stop 4" for Counter3.
So typing stop is equal to typing "stop 7"
Then I set period of Counter2 to 200 by typing "period 2 200"
period of Coutner3 to 300 by typing "period 4 300" (Note period 3 300 will set Counter1 and Counter2 to 300)
Then again started all by typing "start"
Then to test "save" function, I typed "save" which will save current settings to Em_EEPROM.
Then I hit "reset" button of the board.
So the greeting message was displayed but this time each pwm has different values,
which was read from Em_EEPROM.
The waves on my Oscilloscope.
At first I was trying to make the project simple, but I'm afraid that I failed to accomplish orz.
Anyway, yet another sample for you 😉
moto