Newbie searches for Help

Discussion of the PSoC Designer integrated development environment for PSoC1 devices.

Moderators: ericb, dcooper, jonp, dpfunston

Newbie searches for Help

Postby silencelights on Sun Feb 07, 2010 1:27 am

Hello,

i'm a noob in woking with PSoC and C language. I have nice skills in programming with VB and SQL.
I have some basic skills in Digital and analog electronics.

Is there any tutorial, which starts at the really beginning for programming PSoC 1 in Chip-Level Design?

Now here's my problem:

If i do a design in System-Level, I can set-up a pushbutton switch realy easy, but if I try the same in
the Chip-level, I'm not able to read the port.

My first aim: I want to enable a LED, when I press a pushbutton.

Here is my config:
I'm using the eval-board CY8CKIT-001. My pushbutton is connected to GND.

I have connected the pushbutton to port 1[6]. The LED is connected to port 2[7].
I have set-up the port 1[6] to the following mode:
Select: StdCPU
Drive: Pull Up
Interrupt: DisableInt

I have set-up the port 2[7] to the following mode:
Select: StdCPU
Drive: Strong
Interrupt: DisableInt

Here iy my C-Code:

Code: Select all
//----------------------------------------------------------------------------
// C main line
//----------------------------------------------------------------------------

#include <m8c.h>        // part specific constants and macros
#include "PSoCAPI.h"    // PSoC API definitions for all User Modules


void main(void)
{
    M8C_EnableGInt;                            // Turn on interrupts
    I2C_CFG &= 0xFC;                           // Disable I2C in case it's not used.

   while (1)
   {
      if (PRT1DR & 0x40)
      {
      PRT2DR |= 0x80;
      }
   }
}


The code seems to affect nothing. What is wrong with my code?
Thank's for any help.
silencelights
Newbie
Newbie
 
Posts: 9
Joined: Sun Feb 07, 2010 1:08 am

Re: Newbie searches for Help

Postby silencelights on Mon Feb 08, 2010 2:51 am

Hello,

the Problem is solved.
silencelights
Newbie
Newbie
 
Posts: 9
Joined: Sun Feb 07, 2010 1:08 am


Return to PSoC Designer (PSoC1 IDE)

Who is online

Users browsing this forum: No registered users and 1 guest