PSoC™ 5, 3 & 1 Forum Discussions
I need to put a few lines of code in an interrupt service routine (ISR) to print the value in a variable at the time of the interrupt. Timing is not critical, this is just a test to check an operation. I have a CY8CKIT-059 board and use a counter (Counter_3X) to create the interrupt. Here is the ISR
* Place your includes, defines and code here
********************************************************************************/
/* `#START Counter_3X_Done_intc` */
extern void Counter_3X_Stop(); //Stop Counter_3X
extern uint16 charindex; //Value from main program
char strMsg3X[30]; //Set up array for characters to print
sprintf(strMsg3X,"CharIndex = %u\r\n",charindex); //Line 34
int UART_1_PutString(strMsg3X); //Line 35
/* `#END` */
The first line (Line 34 in boldface) produces the Build error, "expected ')' before string constant" and when I hover over the string, the cursor shows "expected identifier".
When I hover over Line 35, I read the following, "a parameter list without types is only allowed in a function definition." I have no idea what this means.
I have attached an image of the error and warning messages. All I need is a way to display a value on a terminal for tests. No printing will occur in the finished code. If you can suggest an alternate way to accomplish my testing goal, I welcome your ideas. Thank you. --Jon
Show LessUsing MiniProg 3 to program PSOC1. Component "TVS" on MiniProg3 unit burned out on second day of use. Looking to find possible reason this would have happened. Can the orientation (putting the programmer pins on backwards) cause this? Can it be related to a short in the usb cable we are using to hook up to the computer (using an extension type usb, not the one provided in the kit)? Any feedback would be greatly appreciated so that we don't burn the next one out.
Show LessIn fact this design is absolute,but i want to work on it so that get some insight to analog input sensing and PWM and controlling IGBT and capsense.and where can i get the Bill of material of it(of its correct specification as required) so that i can fully test the designed hardware.
Show LessI am trying to send some data from one I2C master to one non-exist I2C slave on the bus.
the I2C bus only has one master and the SDA/SCL lines have been pull-up as suggested by the spec.
could anyone help me to understand if that is even possible?
seems after master received the NACK after tx of Address, it wouldn't take any write to the I2C_DATA_REG and STOP condition will generated after TRANSMIT bit been set (this may because the lines are all been pull-up?).
Show LessThere is no configuration for Capture mode in the PWM_Init() function, there does not seem to exist any bits in the Control register to configure the edge of the Capture as opposed to the Counter module (see Datasheets), the PWM module does not work as expected when capturing events in Either edge mode.
Show LessHello, I have a circuit that decodes a signal using a parallel RC circuit and a comparator. When the voltage on C1 drops below Vref, Pin_2_4 is sampled and the comparator output is used to clock the shift register.
Unfortunately, when operating in fast mode, the comparator emits multiple pulses and clocks the shift register beyond the single pulse required. When set to 'slow' the comparator behaves (or to a much slower clock speed), however this results in a significantly larger pulse, up to 2uS in width.
I'm seeking clarification on what can be done to operate the comparator in this model and receive only the single desired short pulse, a well as understanding why the faster clock rate and 'fast' mode result in this behavior.
I have also attempted to enable and disable hysteresis with no change in behavior.
Signal captures and a sample project are both attached for clarity.
Thanks,
Karl
Show LessHello All
I am using timer component, while run time i want to change the timer period,
and as per this https://community.cypress.com/docs/DOC-12263
i wrote the code.
timer clock is 10Khz
default period is 900 (90ms)
i want to change it to 3000ms.
Timer_Start();
Timer_WritePeriod(30000);
Timer_WriteCounter(0);
isr_timer_StartEx(timer_int_handler);
after this lines of code the timer interrupt is activated in isr i wrote code to reset PSOC device.
the task is i had to reset the PSOC device whenever the timer count is completed and interrupted.
the period of timer is user changeable.
Is there any way to successfully do this.
Thanks.
Show LessNot sure if I am missing something but the PWM implementation doesn't appear support the full duty cycle range i.e. 0% and 100%.
I am about to utilise the Kill input to force the PWM to 0 when it's compare value is set to 0 when the compare logic set to <= (in order to get 100% duty cycle at compare value 255; 8-bit variant).
I thought I would ask this forum before adding this level of complexity.
Show LessI use a CY8CKIT-059 development board and have spent several hours trying to find a SIMPLE example that shows how to use a UART to send a value such as 316 to a terminal emulator so I can debug a program. I have found examples, but none that make sense. I have set up a UART, but discussions of commands sprintf and printf do not lead to a solution. My application will not need to display anything on a terminal, so I just need a UART so I can run tests. The simpler the better. Thanks for any assistance. --Jon
Show LessHi All,
I need into my project bootloader that does receive the firmare over Half-Duplex RS485, decrypts it and flashes into application area. Other functionality as verifying the bootloader itself and application checksum are needed. I also need to merge the bootloader commands with Modbus standard. The idea is to be able to upgrade device on Modbus without affecting other devices.
The available bootloader by Cypress does have no crypto functionality. I think that I am starting to invent a Bycicle. Thus I am looking around if somebody already has a bootloader project with very similar goals. I would gladly join with the project.
In past, I have implemented few bootloaders using XTEA (XTEA - Wikipedia) crypting method. It has fairly high protection in this kind of application and is relatively simple and fast.
Or, how would you append cryptography into existing bootloader component by cypress?
Show Less