You are on page 1of 5

Introduction

This Resource talks about the steps involved in using the PSoC IDE installed on a computer which is connected to the PSoC In-circuit Emulator board or the PSoC MiniEval1 (Rev E) board.

Steps for working on PSoC Designer


This section lists down the steps for getting started with the PSoC Designer IDE. The IDE can be installed on your Windows PC and the coding and compiling can be done on that. Only when the compiled code needs to be downloaded onto the PSoC device, connect to the remote computer which is connected to the PSoC ICE or Eval board.

The steps for getting started with PSoC Designer are as follows: Before you start PSoC Designer, download template project website and store in some known place, say, c:\psoc directory. Go to Start Cypress Microsystems---PSoC Designer. Close the Start box that pops up. Go to File----New Project---- Clone. In the New Project window and enter the name of your project in New Project Name box. For example, enter C:\ in New Project Name box and then click on Next. In Specify existing project path enter C:\psoc\ec209Base\ec209base.SOC Click on Application Editor in Select PSoC Designer state to proceed to item. Whenever Project Update window pops up, click Cancel Expand Source Files, and double click on main.asm. Start writing your code from the end of the file.

Compiling and generating the machine code (.hex file)


Building the code

The following steps should be followed after writing the code to compile the code. Go to Build and select Rebuild All. Fix errors that you get when you compile the code.

If you get no errors then the final .hex file gets created in the output directory in the project folder and is ready to be programmed into the Flash memory ((Instruction memory).

Executing program in PSoC ICE (In-circuit Emulator)

The following are steps should be followed if you are using the ICE for testing your program.

Click on Debug and Execute Program . If you want to run the program again and again, click on Debug and Reset

Alternatively, there are icons on the toolbar to do the above functions. Use the many features provided by the debugger such as Breakpoints , Step into , Step over etc to add a breakpoint in a statement and debug your program.

Executing the program on PSocEval1 Evaluation Kit

The following steps should be followed if the PSoC evaluation board with the serial port interface is used to run your program. Downloading machine code into the Flash In the toolbar, Go to Program---Program part In the Device Family box choose 29x66. In Device box choose CY8C29466.

In the Port box select port Miniprog\069727CC0808 and click on Connect. Click on Toggle Device Power in order to power the microcontroller kit on/off. The message Powered or Not Powered is shown at the bottom right of the window.

Click on File Load option and load your .hex file from your project s output directory Click on Program. This starts the flash programming. It displays messages like Programming starting , Programming succeeded , Verify starting , Verify succeeded etc. If this process gets stuck or if you see Verify failed , then contact us. While flash programming is being done a Busy message is also displayed at the botton right corner of the window.

After Flash programming, you are ready to run you program.

Program Execution Click on Toggle device power to see the output of your program on HyperTerminal (See below for details on using Hyperterminal). Debugging the progam

The debugger provided as part of the Integrated Development Environment (IDE) cannot be used with the Evaluation kit. In order to examine the register contents and memory contents, you need to instrument the code with your own debug functions. The values to be displayed can be directed to the serial port and displayed using Hyperterminal application provided by windows or an equivalent application on linux like minicom . Displaying registers and memory

Two sample functions are provided as part of the template project in order to display values of registers A, X, and PC and to display the value of a memory location. You may modify these functions or add more functions based on your requirement. For viewing the contents of registers A, X, SP, call Displayreg subroutine and for memory values call Displaymem. Before calling Displaymem pass the memory address in MEM_ADDRESS by using the mov instruction.

Example: call Displayreg mov [30],0x06 mov [MEM_ADDRESS], 30 call Displaymem Output: The above statements would result in display of PC, A, X registers and the display of memory content of address 30, which is 6.

Display using Hyperterminal The output of the above two sample functions get directed to RS232 (UART) port, also called as Serial Port, on the Evaluation board. This is connected to the serial port of the Windows machine to which the kit is connected. So, you may make use of the Hyperterminal application on the same machine to view the contents communicated through the serial port. Hyperterminal is invoked as follows:

Go to Start Program-Accessories-Communication Hyperterminal Give a name for the session. You may save this session for later use as well. Specify the following port parameters: 1. Bits per second: 152000 2. Data bits: 8 3. Parity: None 4. Stop bits: 1 5. Flow control: Hardware If connection is successful, your hyperterminal app is ready is receive/send data (You will see status as connected at the bottom left of the window) Use Transfer - Capture Text given on the toolbar, if you want to capture the display in a file.

Working on the kit from remote PC (Windows XP)

Steps for remote login

Go to Start Program-Accessories-Communication Remote Desktop Connections. Give the IP address of the remote PC (Will be given to you).

Login with the username and the password given to you. Launch PSoC Designer or Programmer on this machine.

Multiple users

If you are using the Evaluation Kit, when you launch the Programmer , you will observe the following: If somebody is already using the kit the Toggle Device Power option will not be accessible to you. Once the other person has finished using the kit reopen the Programmer window, you will be able to access the Toggle Device Power button and also the kit.