Re: UART Communication block

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
lock attach
Attachments are accessible only for community members.
misa_4395186
Level 2
Level 2
First like given

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

0 Likes
1 Solution
lock attach
Attachments are accessible only for community members.
MotooTanaka
Level 9
Level 9
Distributor - Marubun (Japan)
First comment on blog Beta tester First comment on KBA

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.

000-schematic.JPG

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.

000-teraterm.JPG

001-oscillo.JPG

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"

002-teraterm.JPG

003-oscillo.JPG

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.

003-teraterm.JPG

The waves on my Oscilloscope.

004-oscillo.JPG

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

View solution in original post

0 Likes
8 Replies