7 Replies Latest reply on Feb 22, 2020 10:47 AM by AnGi_1678941

    Real Time Trace: SWV(Serial wire viewer) in PSoC3



      To start with SWV in PSoC3/5LP :-      



      Serial Wire Viewer (SWV):  Single Wire Viewer (SWV) interface, is used for program and data monitoring, where the firmware may output data in a method similar to “printf” debugging on PCs, using a single pin (P1[3]/SWO). MiniProg3 supports monitoring of PSoC 3 and PSoC 5LP firmware, using SWV, through the 10-pin connector (or SW0 and ground) and in conjunction with SWD only.     






      It is a run time debugger. You can print the values of the variables in run time like “printf” statement.     



      SWV Data trace is available via the SWO pin in two output formats:     


      • UART style (1Mb/s) – Advantage is no need of RS232 connector and not using PSoC’s UART block. In a big project, where UART is needed and still needs to know the values of variables, SWV is the best approach.      


      • Manchester Encoded (100Mb/s) – You can use this if high data rate is required.      






      How to use this application:      



      The attachment contains a project and application for SWV interface. Program the PSoC with this project. Then connect SWO pin /P1[3] and ground pin of PSoC to corresponding pins in MiniProg3 or connect MiniProg to PSoC via 10 pin connector(JTAG cable).      



      Pre Requisites:      



      1.      PSoC creator      



      2.      PSoC programmer 3.18.1      



      If you are using any other version of PSoC Programmer, then copy the PP_Com_Wrapper.dll from the installed location and paste where the application is present.      



      Open the application “MiniProg3_SWV” in the attached document.      



      Select the protocol that you have selected in the firmware. And start the operation.




       If the selected data is 1 byte and data is i=0,i++, then 01 00 01 01 01 02 01 03.. Here indicates the size of the received data and 07, 08.. indicates the data that has been sent.      



      Similarly, if  the selected data size is 2 bytes, then the received data will look like 02 01 00 02 02 00.. Here 02 is data size and 0001 is data ( LSB then MSB) .      



      Similarly, if the selected data size is 4 bytes, then the received data will look like 03 01 00 00 00 03 02 00 00 00.. Here 03 is data size and 00000001 is data ( LSB then MSB) .      



      Hence you can place this piece of code in any of your project and can monitor the variables.


      We have tested this only in PSoC3.






      Thank You,