Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a simple C program to do a true LED toggle using the built-in LED and switch on your PSOC5 dev board. Your program should

Write a simple C program to do a true LED toggle using the built-in LED and switch on your PSOC5 dev board. Your program should poll for the switch to be pressed, and when it is, you should turn the LED on if it was off and vice versa, one toggle per button press, which is going to require some debouncing. To learn how low-level microcontroller programming goes, you will use only memory mapped registers to do so.

  • Connect the circuit as shown in Part 3 - Hitachi LCDs

  • Find the correct addresses for Port3s Drive Mode and Pin State registers in the PSoC5 Registers TRM

  • Your program should configure Port 2[1] to be in drive mode Strong Drive like in the introduction above. Port 3[4] should be configured to be in Resistive Pull-Up or High Impedance Digital mode in a similar fashion, depending on if you have the external resistor or not. Do this using the registers + memory-mapping, NOT THROUGH THE SCHEMATIC WINDOW

  • You program should then poll for the switch on P3[4] of the CY8CKIT-059 (Your dev board) to be pressed

  • When the switch is pressed, you are to toggle the LED on Port 2[1] on if it was off, or off it was on.

  • Your code should be debounced properly so that the LED only toggles once per press

  • If you get confused, you can always go digging in the automatically generated C API to see the code PSoC Creator generates to do the Pin_Write() and Pin_Read() functions.

image text in transcribed

Hardware Diagram: 17 18 19 18 19 12 11 10 15 - :::: Figure 1 : LCD + Button Wiring Diagram Hardware Diagram: 17 18 19 18 19 12 11 10 15 - :::: Figure 1 : LCD + Button Wiring Diagram

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Machine Learning And Knowledge Discovery In Databases European Conference Ecml Pkdd 2015 Porto Portugal September 7 11 2015 Proceedings Part 3 Lnai 9286

Authors: Albert Bifet ,Michael May ,Bianca Zadrozny ,Ricard Gavalda ,Dino Pedreschi ,Francesco Bonchi ,Jaime Cardoso ,Myra Spiliopoulou

1st Edition

ISBN: 3319234609, 978-3319234601

More Books

Students also viewed these Databases questions

Question

=+With whom does the firm have to negotiate?

Answered: 1 week ago

Question

=+Are there shop stewards?

Answered: 1 week ago