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.
