How to Interface Switch with CY8C3866

Interfacing Switch with CY8C3866

Tags: Psoc3, cy8c3866, cypress microcontroller, cy8c3866 microcontroller, cypress 8051 microcontroller, cypress, SWITCH interface with psoc3, SWITCH interface with cy8c3866 , SWITCH interface with cypress microcontroller, SWITCH interface, psoc3 interface with, psoc3 interfacing, psoc3 interfacing document, SWITCH with cypress microcontroller, SWITCH, 8051 interfacing, how to interface SWITCH with cypress microcontroller, how to interface SWITCH with cy8c3866, how to interface SWITCH with psoc3 getting started cy8c3866, getting started psoc3, psoc3 development kit, psoc3 kit manual, psoc3 interface manual, cy8c3866 interface manual
Overall rating
PSoC 3 Primer kit

The PSoc 3 Primer kit is specifically designed to help students to master the required skills in the area of embedded systems. The kit is designed in such way that all the possible features of the microcontroller will be easily used by the students. The kit supports FX2LP Programmer which is done through USB port.

Cypress 8051 core (CY8C3866), PSoc 3 Primer Kit is proposed to smooth the progress of developing and debugging of various designs encompassing of speed 8-bit Microcontrollers. It integrates on board CAPSENSE BUTTONS, CAPSENSE LINEAR SLIDER, UART, ADC, DAC, Relay, Buzzer, Seven Segment, Serial EEPROM, Temperature Sensor LM35, Matrix Keypad, Switch, LED, Stepper Motor Driver, Traffic Light Controller, RTC, LCD & GLCD Display to create a stand-alone versatile test platform. User can easily engage in Primer in this platform, or use it as reference to application Primer.


A switch is an electrical component that can break an electrical circuit, interrupting the current or diverting it from one conductor to another. A switch may be directly manipulated by a human as a control signal to a system, or to control power flow in a circuit.

Interfacing Switch with CY8C3866

Figure shows how to interface the switch to microcontroller. A simple switch has an open state and closed state. However, a microcontroller needs to see a definite high or low voltage level at a digital input.

A switch requires a pull-up or pull-down resistor to produce a definite high or low voltage when it is open or closed. A resistor placed between a digital input and the supply voltage is called a "pull-up" resistor because it normally pulls the pin's voltage up to the supply.


We now want to control the LED by using switches in CY8C3866 Primer Board. It works by turning ON a LED & then turning it OFF when switch is going to LOW or HIGH.

The CY8C3866 Primer board has eight numbers of point LEDs, connected with I/O Port lines (P0.0 – P0.7) to make port pins high. Eight switches, connected with I/O port lines (P3.0 – P3.7) are used to control eight LEDs.

Pin Assignment with CY8C3866


Slide Switch

CY8C3866A lines

Input Logic Selection




















Circuit Diagram to Interface Switch with CY8C3866


Program to switch ON and OFF LED using CY8C3866


Title : Program to Blink LEDs controlling by switches



#include <device.h>


void main()


    uint8 a0;




                a0 = SW_Read();






Join the World's Largest Technical Community

we respect your privacy.