This document contains information about various digital and analog input/output components that can be used with an mbed microcontroller board. It discusses digital input and output pins, interrupt inputs, analog inputs and outputs, pulse width modulation outputs, LCD displays, timers and more. Code examples are provided to demonstrate how to use these components to control LEDs, read button presses, take analog sensor readings and display text on an LCD. Links are included to relevant mbed documentation pages for more details on each topic.
intel core i7 is almost the best processor which is available in market.in many respect either of speed,concurrency increased cache ,QPI ,Hyper threading and many more!
intel core i7 is almost the best processor which is available in market.in many respect either of speed,concurrency increased cache ,QPI ,Hyper threading and many more!
Compare Performance-power of Arm Cortex vs RISC-V for AI applications_oct_2021Deepak Shankar
Abstract: In the Webinar, we will show you how to construct, simulate, analyze, validate, optimize an architecture model using pre-built components. We will compare micro and application benchmarks on system SoC models containing clusters of ARM Cortex A53, SiFive u74, ARM Cortex A77, and other vendor cores. The system will be built around custom switches, Ingress/Egress buffers, credit flow control, AI accelerators, NoC and AMBA AXI buses with multi-level caches, DDR4 DRAM and DMA. The evaluation and optimization criteria will be task latency, dCache hit-ratio, power consumed/task and memory bandwidth. The parameters to be modified are bus topology, cache size, processor clock speed, custom arbiters, task thread allocation and changing the processor pipeline.
Selection of cores is a combination of financial and technical bias. Technical comparison of processor cores requires the understanding of the workload, task partitioning and cache-memory structure. A core must be evaluated in the context of the target application. To evaluate these selections, architecture simulation software must be fortified with a library of Intellectual property for power and timing accurate processor cores, simulator at 100 million events per second, peripherals, and all possible traffic distributions
Key Takeaways:
1. Validating architecture models using mathematical calculus and hardware traces
2. Construct custom policies, arbitrations and configure processor cores
3. Select the right combination of statistics to detect bottlenecks and optimize the architecture
4. Identify the right use of stochastic, transaction, cycle-accurate and traces to construct the model
Speaker Bio:
Alex Su is a FPGA solution architect at E-Elements Technology, Hsinchu, Taiwan. He has been an FPGA Solution Architect and Xilinx FPGA Trainer for a number of years, supporting companies, research centers and universities in China and Taiwan. Prior to that, Mr Su has worked at ARM Ltd for 5 years in technical support of Arm CPU and System IP. Alex has also been engaged with a variety of FPGA-based Hardware Emulation System and over ten years in ASIC/SoC design and verification engineer.
Deepak Shankar is the Founder of Mirabilis Design and has been involved in the architecture exploration of over 250 SoC and processors. Mr. Shankar started Mirabilis Design because of a vacuum in the systems engineering and modeling space with the focus shifting to network design and early software development. Deepak has published over 50 articles and presented at over 30 conferences in EDA, semiconductors and embedded computing. Mr. Shankar has an MBA from UC Berkeley, MS in from Clemson University and BS from Coimbatore Institute of Technology, both in Electronics and Communication.
Architecture Exploration of RISC-V Processor and Comparison with ARM Cortex-A53KarthiSugumar
This presentation focuses on the architectural exploration of RISC-V ISA based processor for networking applications such as a Router, using the trade-off between power consumption and performance. The optimized architecture is compared against commercially available RISC processors from ARM. A model of RISC-V based Solid-State Drive is also proposed.
BTech Electronics & Communication Engineering Project for Embedded Systems on Temperature Controlled Fan using ATMega8 Controller and LM35 Temperature Sensor.
Compare Performance-power of Arm Cortex vs RISC-V for AI applications_oct_2021Deepak Shankar
Abstract: In the Webinar, we will show you how to construct, simulate, analyze, validate, optimize an architecture model using pre-built components. We will compare micro and application benchmarks on system SoC models containing clusters of ARM Cortex A53, SiFive u74, ARM Cortex A77, and other vendor cores. The system will be built around custom switches, Ingress/Egress buffers, credit flow control, AI accelerators, NoC and AMBA AXI buses with multi-level caches, DDR4 DRAM and DMA. The evaluation and optimization criteria will be task latency, dCache hit-ratio, power consumed/task and memory bandwidth. The parameters to be modified are bus topology, cache size, processor clock speed, custom arbiters, task thread allocation and changing the processor pipeline.
Selection of cores is a combination of financial and technical bias. Technical comparison of processor cores requires the understanding of the workload, task partitioning and cache-memory structure. A core must be evaluated in the context of the target application. To evaluate these selections, architecture simulation software must be fortified with a library of Intellectual property for power and timing accurate processor cores, simulator at 100 million events per second, peripherals, and all possible traffic distributions
Key Takeaways:
1. Validating architecture models using mathematical calculus and hardware traces
2. Construct custom policies, arbitrations and configure processor cores
3. Select the right combination of statistics to detect bottlenecks and optimize the architecture
4. Identify the right use of stochastic, transaction, cycle-accurate and traces to construct the model
Speaker Bio:
Alex Su is a FPGA solution architect at E-Elements Technology, Hsinchu, Taiwan. He has been an FPGA Solution Architect and Xilinx FPGA Trainer for a number of years, supporting companies, research centers and universities in China and Taiwan. Prior to that, Mr Su has worked at ARM Ltd for 5 years in technical support of Arm CPU and System IP. Alex has also been engaged with a variety of FPGA-based Hardware Emulation System and over ten years in ASIC/SoC design and verification engineer.
Deepak Shankar is the Founder of Mirabilis Design and has been involved in the architecture exploration of over 250 SoC and processors. Mr. Shankar started Mirabilis Design because of a vacuum in the systems engineering and modeling space with the focus shifting to network design and early software development. Deepak has published over 50 articles and presented at over 30 conferences in EDA, semiconductors and embedded computing. Mr. Shankar has an MBA from UC Berkeley, MS in from Clemson University and BS from Coimbatore Institute of Technology, both in Electronics and Communication.
Architecture Exploration of RISC-V Processor and Comparison with ARM Cortex-A53KarthiSugumar
This presentation focuses on the architectural exploration of RISC-V ISA based processor for networking applications such as a Router, using the trade-off between power consumption and performance. The optimized architecture is compared against commercially available RISC processors from ARM. A model of RISC-V based Solid-State Drive is also proposed.
BTech Electronics & Communication Engineering Project for Embedded Systems on Temperature Controlled Fan using ATMega8 Controller and LM35 Temperature Sensor.
Slide deck for talk at IETF#92 (Dallas, March 2015) at the IETF Light-Weight Implementation Guidance (lwig) working group about the performance of cryptographic algorithms on ARM processors.
SPEED CONTROL OF INDUCTION MACHINE WITH REDUCTION IN TORQUE RIPPLE USING ROBU...IAEME Publication
In this paper a novel and simple algorithm for three-phase induction motor(IM) under Direct Torque Control (DTC) scheme using Classic DTC switching table for dynamic torque ripple reduction and space-vector modulation scheme for steady state torque and flux control is proposed. The proposed scheme having the advantages of low torque ripples as well as constant switching frequency.
Simulation results are given to prove the ability of the proposed method obtaining good speed control bandwidth while overcoming classic DTC and DTC-SVM drawbacks.
Gain Experience with GPIO, LED Interface and Functions in TI TIVA C Launchpad...nipunkrn
● To gain experience with the ARM Assembly and the TI TIVA C Launchpad Development Board.
● To gain experience the CCS ARM development environment and debugging features.
● To gain experience writing subroutines and passing parameters.
● To gain experience with software delay loops and generating square waves, flashing LED.
● To gain experience with general purpose input/output (GPIO) subsystem initialization.
This is only for educational purposes. I openly declare a common courtesy to the video content owner.
It contains full tutorial as well as a video file inside the ppt file that will help you to build up a complete project.
Arduino is an open-source project that created microcontroller-based kits for building digital devices and interactive objects that can sense and control physical devices.
Switch Control and Time Delay
1. LEDs and switches
2. Keypad and LEDs
3. Keypad and 8-segment LED C language and Assembly Code for Freescale MC9S08AW60
Logic gate tester for IC's ( Digital Electronics and Logic deisgn EE3114 )Jikrul Sayeed
Name of the project: Logic Gate Tester for DELD EE3114
1.1Abstract:
Performing various types of logic operation we need to use logic gates and in integrated circuit there are more than one gates fabricated in a single IC. Before using gates for various purposes we need to check logic gates including all logic
combination considering in Binary (Logic 1 & 0) needs to implement. It is a time consuming task to check all the input combinations, thus the sole purpose of this project to make it automatic to check all the logic .
Student information management system project report ii.pdfKamal Acharya
Our project explains about the student management. This project mainly explains the various actions related to student details. This project shows some ease in adding, editing and deleting the student details. It also provides a less time consuming process for viewing, adding, editing and deleting the marks of the students.
Cosmetic shop management system project report.pdfKamal Acharya
Buying new cosmetic products is difficult. It can even be scary for those who have sensitive skin and are prone to skin trouble. The information needed to alleviate this problem is on the back of each product, but it's thought to interpret those ingredient lists unless you have a background in chemistry.
Instead of buying and hoping for the best, we can use data science to help us predict which products may be good fits for us. It includes various function programs to do the above mentioned tasks.
Data file handling has been effectively used in the program.
The automated cosmetic shop management system should deal with the automation of general workflow and administration process of the shop. The main processes of the system focus on customer's request where the system is able to search the most appropriate products and deliver it to the customers. It should help the employees to quickly identify the list of cosmetic product that have reached the minimum quantity and also keep a track of expired date for each cosmetic product. It should help the employees to find the rack number in which the product is placed.It is also Faster and more efficient way.
Explore the innovative world of trenchless pipe repair with our comprehensive guide, "The Benefits and Techniques of Trenchless Pipe Repair." This document delves into the modern methods of repairing underground pipes without the need for extensive excavation, highlighting the numerous advantages and the latest techniques used in the industry.
Learn about the cost savings, reduced environmental impact, and minimal disruption associated with trenchless technology. Discover detailed explanations of popular techniques such as pipe bursting, cured-in-place pipe (CIPP) lining, and directional drilling. Understand how these methods can be applied to various types of infrastructure, from residential plumbing to large-scale municipal systems.
Ideal for homeowners, contractors, engineers, and anyone interested in modern plumbing solutions, this guide provides valuable insights into why trenchless pipe repair is becoming the preferred choice for pipe rehabilitation. Stay informed about the latest advancements and best practices in the field.
TECHNICAL TRAINING MANUAL GENERAL FAMILIARIZATION COURSEDuvanRamosGarzon1
AIRCRAFT GENERAL
The Single Aisle is the most advanced family aircraft in service today, with fly-by-wire flight controls.
The A318, A319, A320 and A321 are twin-engine subsonic medium range aircraft.
The family offers a choice of engines
Forklift Classes Overview by Intella PartsIntella Parts
Discover the different forklift classes and their specific applications. Learn how to choose the right forklift for your needs to ensure safety, efficiency, and compliance in your operations.
For more technical information, visit our website https://intellaparts.com
Automobile Management System Project Report.pdfKamal Acharya
The proposed project is developed to manage the automobile in the automobile dealer company. The main module in this project is login, automobile management, customer management, sales, complaints and reports. The first module is the login. The automobile showroom owner should login to the project for usage. The username and password are verified and if it is correct, next form opens. If the username and password are not correct, it shows the error message.
When a customer search for a automobile, if the automobile is available, they will be taken to a page that shows the details of the automobile including automobile name, automobile ID, quantity, price etc. “Automobile Management System” is useful for maintaining automobiles, customers effectively and hence helps for establishing good relation between customer and automobile organization. It contains various customized modules for effectively maintaining automobiles and stock information accurately and safely.
When the automobile is sold to the customer, stock will be reduced automatically. When a new purchase is made, stock will be increased automatically. While selecting automobiles for sale, the proposed software will automatically check for total number of available stock of that particular item, if the total stock of that particular item is less than 5, software will notify the user to purchase the particular item.
Also when the user tries to sale items which are not in stock, the system will prompt the user that the stock is not enough. Customers of this system can search for a automobile; can purchase a automobile easily by selecting fast. On the other hand the stock of automobiles can be maintained perfectly by the automobile shop manager overcoming the drawbacks of existing system.
Courier management system project report.pdfKamal Acharya
It is now-a-days very important for the people to send or receive articles like imported furniture, electronic items, gifts, business goods and the like. People depend vastly on different transport systems which mostly use the manual way of receiving and delivering the articles. There is no way to track the articles till they are received and there is no way to let the customer know what happened in transit, once he booked some articles. In such a situation, we need a system which completely computerizes the cargo activities including time to time tracking of the articles sent. This need is fulfilled by Courier Management System software which is online software for the cargo management people that enables them to receive the goods from a source and send them to a required destination and track their status from time to time.
About
Indigenized remote control interface card suitable for MAFI system CCR equipment. Compatible for IDM8000 CCR. Backplane mounted serial and TCP/Ethernet communication module for CCR remote access. IDM 8000 CCR remote control on serial and TCP protocol.
• Remote control: Parallel or serial interface.
• Compatible with MAFI CCR system.
• Compatible with IDM8000 CCR.
• Compatible with Backplane mount serial communication.
• Compatible with commercial and Defence aviation CCR system.
• Remote control system for accessing CCR and allied system over serial or TCP.
• Indigenized local Support/presence in India.
• Easy in configuration using DIP switches.
Technical Specifications
Indigenized remote control interface card suitable for MAFI system CCR equipment. Compatible for IDM8000 CCR. Backplane mounted serial and TCP/Ethernet communication module for CCR remote access. IDM 8000 CCR remote control on serial and TCP protocol.
Key Features
Indigenized remote control interface card suitable for MAFI system CCR equipment. Compatible for IDM8000 CCR. Backplane mounted serial and TCP/Ethernet communication module for CCR remote access. IDM 8000 CCR remote control on serial and TCP protocol.
• Remote control: Parallel or serial interface
• Compatible with MAFI CCR system
• Copatiable with IDM8000 CCR
• Compatible with Backplane mount serial communication.
• Compatible with commercial and Defence aviation CCR system.
• Remote control system for accessing CCR and allied system over serial or TCP.
• Indigenized local Support/presence in India.
Application
• Remote control: Parallel or serial interface.
• Compatible with MAFI CCR system.
• Compatible with IDM8000 CCR.
• Compatible with Backplane mount serial communication.
• Compatible with commercial and Defence aviation CCR system.
• Remote control system for accessing CCR and allied system over serial or TCP.
• Indigenized local Support/presence in India.
• Easy in configuration using DIP switches.
Immunizing Image Classifiers Against Localized Adversary Attacksgerogepatton
This paper addresses the vulnerability of deep learning models, particularly convolutional neural networks
(CNN)s, to adversarial attacks and presents a proactive training technique designed to counter them. We
introduce a novel volumization algorithm, which transforms 2D images into 3D volumetric representations.
When combined with 3D convolution and deep curriculum learning optimization (CLO), itsignificantly improves
the immunity of models against localized universal attacks by up to 40%. We evaluate our proposed approach
using contemporary CNN architectures and the modified Canadian Institute for Advanced Research (CIFAR-10
and CIFAR-100) and ImageNet Large Scale Visual Recognition Challenge (ILSVRC12) datasets, showcasing
accuracy improvements over previous techniques. The results indicate that the combination of the volumetric
input and curriculum learning holds significant promise for mitigating adversarial attacks without necessitating
adversary training.
Event Management System Vb Net Project Report.pdfKamal Acharya
In present era, the scopes of information technology growing with a very fast .We do not see any are untouched from this industry. The scope of information technology has become wider includes: Business and industry. Household Business, Communication, Education, Entertainment, Science, Medicine, Engineering, Distance Learning, Weather Forecasting. Carrier Searching and so on.
My project named “Event Management System” is software that store and maintained all events coordinated in college. It also helpful to print related reports. My project will help to record the events coordinated by faculties with their Name, Event subject, date & details in an efficient & effective ways.
In my system we have to make a system by which a user can record all events coordinated by a particular faculty. In our proposed system some more featured are added which differs it from the existing system such as security.
6. Ngee Ann Polytechnic 6
http://mbed.org/handbook/DigitalOut
http://mbed.org/users/yoonghm/notebook/digital-output/
DigitalOut
http://mbed.org/projects/libraries/api/mbed/trunk/wait_api
7. Ngee Ann Polytechnic 7
Circuit 2
mbed
p5
Circuit 1
+3.3V
mbed
p5
When p5 is LOW (0 V), LED is ON When p5 is HIGH (+3.3 V), LED is ON
What is the use of the resistor?
DigitalOut
9. Ngee Ann Polytechnic 9
Digital IO pins are at 3.3 V, 40 mA each, 400 mA maximum total
How do you drive an application with larger current?
http://cq.cx/interface.pl
www.youtube.com/watch?v=Te5YYVZiOKs
10. Ngee Ann Polytechnic 10
Using BJT Using Darlington Pair Using Darlington Pair
with Relay
Using Power
MOSFET
11. BusOut
Ngee Ann Polytechnic 11
#include "mbed.h"
#define WAIT_SECOND 0.1
// LSB ... MSB
BusOut Bar(p20, p19, p18, p17, p16,
p15, p14, p13, p12, p11);
DigitalOut Led(LED1);
int main() {
Led = 0;
while(1) {
// Shift from LSB to MSB
for (int i = 0; i < 10; i++) {
Led = !Led;
Bar = 1 << i;
wait(WAIT_SECOND);
}
}
}
12. BusOut
Ngee Ann Polytechnic 12
#include "mbed.h"
#define WAIT_SECOND 0.1
// LSB ... MSB
BusOut Bar(p20, p19, p18, p17, p16,
p15, p14, p13, p12, p11);
DigitalOut Led(LED1);
int main() {
Led = 0;
while(1) {
// Shift from LSB to MSB
for (int i = 0; i < 10; i++) {
Led = !Led; Bar = 1 << i; wait(WAIT_SECOND);
}
// Shift from MSB to LSB
for (int i = 0; i < 10; i++) {
Led = !Led; Bar = 0x0200 >> i; wait(WAIT_SECOND);
}
}
}
13. BusOut
Ngee Ann Polytechnic 13
#include "mbed.h"
#define WAIT_SECOND 0.1
// LSB ... MSB
BusOut Bar(p20, p19, p18, p17, p16,
p15, p14, p13, p12, p11);
DigitalOut Led(LED1);
int main() {
Led = 0; Bar = 3;
wait(WAIT_SECOND); // Start from LSB first
while(1) {
// Shift from LSB to MSB
for (int i = 1; i < 10; i++) {
Led = !Led; Bar = 3 << i; wait(WAIT_SECOND);
}
// Shift from MSB to LSB
for (int i = 1; i < 10; i++) {
Led = !Led; Bar = 0x0300 >> i; wait(WAIT_SECOND);
}
}
}
14. DigitalIn
Ngee Ann Polytechnic 14
http://mbed.org/handbook/DigitalIn
http://mbed.org/users/yoonghm/notebook/digital-input/
15. Ngee Ann Polytechnic 15
• Pin p5 is pull-up to +3.3 V (HIGH)
• Negligible current flow into pin p5
+3.3V
mbed
p5 S1
• Pin p5 is shorted to ground (LOW)
• Resistor limits the current
// Toggle LED1 when button is pressed
#include "mbed.h"
DigitalIn enable(p5);
DigitalOut myled(LED1);
int main() {
while (1) {
if (!enable) {
myled = !myled;
wait(0.2);
}
}
}
+3.3V
mbed
p5 S1
16. Ngee Ann Polytechnic 16
// Toggle LED1 when button is pressed
#include "mbed.h"
DigitalIn enable(p5);
DigitalOut myled(LED1);
int main() {
while(1) {
if (enable) {
myled = !myled;
wait(0.2);
}
}
}
• Pin p5 is pull-down to ground (LOW)
+3.3V
mbed
p5 S1
• Pin p5 is connected to +3.3 V (HIGH)
+3.3V
mbed
p5 S1
17. Ngee Ann Polytechnic 17
• Pin p5 is pull-up to +3.3 V (HIGH) via
internal pull-up resistor
• Pin p5 is shorted to ground (LOW)
• Pull-up resistor limits the current
// Toggle LED1 when button is pressed
#include "mbed.h"
DigitalIn enable(p5);
DigitalOut myled(LED1);
int main()
{
enable.mode(PullUp);
while(1) {
if (!enable) { // p5 is +3.3 V
myled = !myled;
wait(0.2);
}
}
}
mbed
p5 S1
mbed
p5 S1
18. Ngee Ann Polytechnic 18
• Pin p5 is pull-down to 0 V (LOW)
via internal resistor
• Pin p5 is shorted to 3.3 V (HIGH)
• Internal pull-down resistor limits
the current
// Toggle LED1 when button is pressed
#include "mbed.h"
DigitalIn enable(p5);
DigitalOut myled(LED1);
int main()
{
enable.mode(PullDown);
while(1) {
if (enable) { // p5 is +3.3 V
myled = !myled;
wait(0.2);
}
}
}
+3.3V
mbed
p5 S1
+3.3V
mbed
p5 S1
19. Ngee Ann Polytechnic 19
ASIC
I/O
Devices
VCCA VCCB
If VccA is not equal to VccB
1. VOH of the driver must be greater than the VIH of the receiver
2. The VOL of the driver must be less than the VIL of the receiver
3. The output voltage from the driver must not exceed the I/O voltage
tolerance of the receiver
Logic Level
Translation
27. Ngee Ann Polytechnic 27
http://mbed.org/handbook/Debugging
printf(...) – Print out message on a PC terminal via USB
error(...) – Print out message on a PC terminal via USB and stop
Onboard LEDs blink blue in a distinctive pattern
when it encounters run time error
The program will stop running
You need the following software as stated in
http://mbed.org/handbook/Windows-serial-configuration
http://www.extraputty.com/
28. Ngee Ann Polytechnic 28
#include "mbed.h"
DigitalOut myled1(LED1);
DigitalOut myled2(LED2);
int main() {
int i = 5;
printf("Hi!n");
while (i--) {
myled1 = !myled1;
wait(0.25);
}
printf("Alive!n");
while (1) {
myled2 = !myled2;
wait(0.25);
}
}
#include "mbed.h"
DigitalOut myled1(LED1);
DigitalOut myled2(LED2);
int main() {
int i = 5;
printf("Hi!n");
while (i--) {
myled1 = !myled1;
wait(0.25);
}
error("Dead!n");
while (1) {
myled2 = !myled2;
wait(0.25);
}
}
42. Ngee Ann Polytechnic 42
AnalogOut
http://mbed.org/handbook/AnalogOut
http://mbed.org/users/yoonghm/notebook/analog-output/
Change wait(0.0001) to wait(0.001) to see effect faster
50. PwmOut
Ngee Ann Polytechnic 50
#include "mbed.h"
PwmOut led1(LED1);
PwmOut led2(LED2);
PwmOut led3(LED3);
PwmOut led4(LED4);
int main()
{
while (1) {
for (float f = 0.0; f < 1.0; f += 0.001) {
led1 = f;
led2 = f * f;
led3 = (f + 1.0) / 2.0;
led4 = 1.0 - f;
wait(0.01);
}
}
}
Take note that
• All LEDs are assigned values
from 0.0 to 1.0
• The brightness of the LEDs color
changed abruptly
51. PwmOut
Ngee Ann Polytechnic 51
#include "mbed.h"
#include <math.h>
#ifndef M_PI
#define M_PI 3.1415
#endif
PwmOut led1(LED1);
PwmOut led2(LED2);
PwmOut led3(LED3);
PwmOut led4(LED4);
int main()
{
float f = 0.0;
while (1) {
Take note that
• Using 4 sinusoidal waveforms, spaced 90o apart, the
brightness of the LEDs varies smoothly
• M_PI is a constant in <math.h> which is not defined in
the C library from mbed.org
• All sinusoidal values are computed dynamically only when
it is needed. It is a bit CPU intensive
// Add 1.0 to ensure all values are positive
led1 = sin( (f ) * M_PI / 180.0) + 1.0;
led2 = sin( (f + 90.0) * M_PI / 180.0) + 1.0;
led3 = sin( (f + 180.0) * M_PI / 180.0) + 1.0;
led4 = sin( (f + 270.0) * M_PI / 180.0) + 1.0;
f += 1.0;
wait(0.01);
}
}
52. PwmOut
Ngee Ann Polytechnic 52
#include "mbed.h"
#include <math.h>
#ifndef M_PI
#define M_PI 3.1415
#endif
#define STP 256 /* Step */
#define LED 4 /* Number of LEDs
int main()
{
PwmOut Leds[] = {(LED1), (LED2), (LED3), (LED4)};
float y[STP][LED]; // Store all values
float res = 360 / STP; // Resolution (degree per step)
float x = 0.0; // Current x
float ph = 360 / LED; // Phase different btw two successive LEDs
for (int i = 0; i < STP; i++) {
for (int j = 0; j < LED; j++) {
y[i][j] = sin( (x + ph * j) * M_PI / 180.0) + 1.0;
}
x += res; // increment x by each resolution
}
53. Ngee Ann Polytechnic 53
while (1) {
for (int i = 0; i < STP; i++) {
for (int j = 0; j < LED; j++) {
Leds[j] = y[i][j];
}
count++;
wait(0.01);
}
}
}
PwmOut
Take note that
• The code above run significantly faster than pervious example but consume slightly
more memory in flash and RAM
55.
Ngee Ann Polytechnic 55
Space Space
Mark
Time
Voltage
+25V
+3V
-3V
-25V
Logic '0'
Logic '1'
Transition Region
56. Vcc
Ngee Ann Polytechnic 56
Space Space
Mark
Time
Voltage
Vcc
V1H
V0L
Logic '0'
Logic '1'
Transition Region
0
57. Ngee Ann Polytechnic 57
+5 V
+15 V
-15 V
t
t
1 0 0 1 1 1 1 10 0 0 0
Idle Start B0 B1 B3 B6 Stop IdleB2 B4 B5 B7
Transmission of the letter ‘J’ from μC to PC
Logic value
Meaning
Signal level at the μC output pin (TX)
Signal level at the PC input pin (RX)
ASCII character ‘J’ is
represented by
• 0x4A or
• 01001010
μC PC
LevelShifter
TX
RX
RX
TX
TX
RX
RX
TX
LSB MSB
LSBMSB
62. Ngee Ann Polytechnic 62
If both devices are from the same
power source, use CMOS Output.
In this case, the input current to the
microcontroller is actually taken from
the +3V, and via the Source terminal
of the MOSFET of the OUT pin of the
Voltage Detector.
If both devices are from different power
sources, use Open Drain Output.
In this case, the input current to the
microcontroller is actually taken from
+5V, and via the Drain terminal of the N-
channel MOSFET of the OUT pin of the
Voltage Detector. A resistor is necessary
to reduce the amount of current drawn.