SlideShare una empresa de Scribd logo
1 de 10
Descargar para leer sin conexión
Available functions for Nano 5 Cards
I2C (I2C_FUNC.c):
// I2C Functions – Master
void i2c_start (void)
void i2c_stop (void)
bit i2c_write (unsigned char output_data)
unsigned char i2c_read (bit send_ack)
LCD (LCD_Func.c):
void sendCharLCD (unsigned char DIR_DISP, unsigned char CONT_DISP)
void SendStringLCD (unsigned short int LINE, char src[])
Example:
char string1[] = "-----Reference------";
SendStringLCD (2, string1); // line(1-4), string
void Clear_Screen (void)
Figure 1.- LCD interface using I2C communication
Pins definition (Init.h):
Example:
// Timers Tester & Cayenne Interface
sbit TEST_P23 = P2^3; // Control of Relay 1
sbit TEST_P22 = P2^2; // Control of Relay 2
sbit TEST_P21 = P2^1; // Reset
Initial conditions (BasicRut.c):
void System_Setup (void)
Example:
// %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% UART Setup
// Initialize the serial port (115200, 8, N, 1) [see page 32 of data sheet]
PLLCON = 0x50;
SCON = 0x50; // 0101,0000 (Mode 1 and RxD enable)
T3CON = 0x83;
T3FD = 0x09;
TI = 1; // Set UART to send first char
Delays (BasicRut.c):
// delay of 0.1 mseg at 16MHz, fixed by oscilloscope
void delay01(unsigned int num_01delay)
// delay of 0.02 mseg at 16MHz, fixed by oscilloscope
void delay002(unsigned int num_01delay)
Relays (BasicRut.c):
// SET_Relay (RELAY, STATUS_R) // RELAY {LS1 == 0, LS2 == 1}, STATUS_R { 0 == OFF, 1 == ON}
void Set_Relay (bit RELAY, bit STATUS_R)
LED:
TEST_LED = 1; // LED == P2.5 // TEST_LED = {1 == OFF, 0 == ON}
Switch (BasicRut.c):
bit Get_Key(void) // KEY_FLAGE = 0 (Pressed), KEY_FLAGE = 1 (No Pressed)
void Wait_KitKey (void) // Wait for key pressed
Figure 2.- Hardware setup (initial conditions) and test of Delays (based in machine cycles), Relays,
Kit Switch and Led
Internal Temperature, ADC8 (TEMP_INTERNAL.c):
unsigned int Get_InternalTemp (void)
Temperature in LCD:
void SendToLCD_InternalTemp (unsigned char dir_disp, unsigned short int valuetoshow)
Unsigned int to LCD (BasicRut.c):
void HEXtoASCII (unsigned int adc16value)
// valuetoshow == (0 - 65535, unsigned int)
void SendToLCD_ASCII (unsigned int valuetoshow, unsigned char ini_dir)
Figure 3.- Temperature sensor of ADuC842 and unsigned integer shows in LCD
Analog to Digital Converter (ADC_DAC.c):
// channel number: 1, 2, 3, 4, 6, 7 // numsamples: {1, 65535} // 12 bits ADC
unsigned int GetVal (unsigned char CHAN, unsigned int numsamples)
Digital to Analog Converter (ADC_DAC.c):
// voltage: {0, (2.5-1/4096)} 12 bits DAC // DAC_chan: 0, 1
void GenVal (float outputvolt, bit DAC_flag)
Voltage to LCD (BasicRut.c):
// Used for ADCs and DACs, format X.XXX Volts
void SendToLCD_Volt (unsigned short int valuetoshow, unsigned char ini_dir)
Figure 4.- ADCs and DACs (ADC1 is connected to DAC1 for test purpose)
UART Communication (UART.c):
char getChar()
void sendChar(char c)
void UART_OutString(char *pttt)
char * getline( char *Storage )
Example:
TESTER_UART.c
Voltage to UART (BasicRut.c):
// Used for ADCs and DACs, format X.XXX Volts
void SendToTerminal (unsigned short int valuetoshow)
Software Reset (BasicRut.c):
void Soft_Res (void)
IR Remote Controller (IRREMOTE.c):
// Interrupt INT0 // Flag: IRSET
unsigned char GET_KEY_IR (void)
Figure 5.- UART interface. Test of ADCs and DACs (ADC1 is connected to DAC1 for test purpose)
Keypad 4x4 (KEYPAD4x4_Func.c):
// Interrupt INT1 // Flag: KEYSET
char Read_Keypad(void)
IR Remote Controller + Keypad 4x4 (IR_KEYPAD4x4_Func.c):
char Get_Key_Multi(void)
// wait keypressed
void Wait_Keypressed_Multiple (void)
Figure 6.- Testing the IR Remote Controller or Keypad 4x4 using LCD (right)
Figure 7.- Testing the IR Remote Controller or Keypad 4x4 using UART
Rotary Encoder (ROT_ENCODER.c):
unsigned char Ask_Encoder (void)
Figure 8.- Testing the Rotary Encoder
Timer Counters (TIMERS_Func.c):
// Init_Timers(Timer, Interrupt Time) // Timer: 0, 1, 2
void Init_Timers (unsigned char TC_chan, float Def_time_seg)
Interrupt Response (Init_Cond.c):
Interrupts: 1, 3, 5
Pulse Width Modulation (PWM_Func.c):
// Mode 1, PWM1 Control
void Init_PWMs_mode1 (float desired_freq, unsigned char duty_cycle)
Figure 9.- Testing the Timers Counters
Figure 10.- Testing the PWM1
Write to Flash Memory (WriteFlashp.asm):
// (DIR== (EADH EADL), Var1 == (EDATA1 EDATA2), Var2 == (EDATA3 EDATA4))
WriteFlash (dir_flash, EDATA1_EDATA2, EDATA3_EDATA4)
Read from Flash Memory (GetFlashp.asm):
// longvarout == (EDATA1 EDATA2 EDATA3 EDATA4), DIR == (EADH EADL)
longvarout = GetFlash(dir_flash) ;
var1= (longvarout >> 24) & 0x000000FF; //EDATA1
var2= (longvarout >> 16) & 0x000000FF; //EDATA2
var3= (longvarout >> 8) & 0x000000FF; //EDATA3
var4= longvarout & 0x000000FF; //EDATA4
Figure 11.- Testing the Flash Memory
ADC Calibration (ADC_CALIBRATION.c):
// ADC1 must be connected to GND
void CALIBRATION (void)
Figure 12.- Calibrating the ADCs
Set Time in RTC (SET_TIME.c):
// IR Remote or Keypad 4x4, LCD, Real Time Clock
void SetTime(void)
Read Time from RTC and shows in LCD (CURR_TIME.c):
// IR Remote or Keypad 4x4 (until keypressed), LCD, Real Time Clock
void CurrTime(void)
// Read Time (decimal values)
void get_values_rtc (void)
Example: See this support video
Figure 13.- Setting the time in the Real Time Clock
Kit to Slave, RPi Interface (RASPI2C_FUNC.c):
// Slave address: 0x34
void Change_Init_Cond (void)
Send Char to RPi (RASPI2C_FUNC.c):
void sendChar_i2c_rasp(char cc)
Receive Char from RPi (RASPI2C_FUNC.c):
unsigned char getChar_i2c_rasp(void)
Sync Kit - RPi (RASPI2C_FUNC.c):
void Sync_up (void)
Send float to RPi (RASPI2C_FUNC.c):
void sendfloat_i2c_rasp (float ff)
Send integer to RPi (RASPI2C_FUNC.c):
void sendinteger_i2c_rasp (unsigned int integer_2)
Kit Function, Send float and integer values to RPi (RASPPI_I2C.c):
void I2C_Raspberry(void)
RPI Functions (Receive float values from Kit and shows them):
Plot_Drawnow.py
Plot_General.py
Figure 14.- Making the connection with internet and sending the data to Raspberry Pi
Figure 15.- Raspberry Pi: Receiving and plotting the data from Nano 5 Card
Relays Controlled by Cayenne (Rasp_Cayenne.c):
// Must be connected:
// Pin 40 (GPIO 21) Raspberry Pi conected to P2^3, Control of Relay 1
// Pin 38 (GPIO 20) Raspberry Pi conected to P2^2, Control of Relay 2
// Pin 12 (GPIO 18) Raspberry Pi conected to P2^1, Reset Kit
void Rasp_Cayenne(void)
Figure 16.- Pins connection for Cayenne interface
Figure 17.- Cayenne interface: Setting on Relay 2 of Nano 5 Card
Figure 18.- Cayenne interface: Scheduling an event for Relay 1: Turn On at 7:33 pm

Más contenido relacionado

La actualidad más candente

Lcd module interface with xilinx software using verilog
Lcd module interface with xilinx software using verilogLcd module interface with xilinx software using verilog
Lcd module interface with xilinx software using verilogsumedh23
 
Dam gate open close lpc prog
Dam gate open close lpc progDam gate open close lpc prog
Dam gate open close lpc prognikhil dixit
 
Data Acquisition
Data AcquisitionData Acquisition
Data Acquisitionazhar557
 
8051-mazidi-solution
8051-mazidi-solution8051-mazidi-solution
8051-mazidi-solutionZunAib Ali
 
Uart VHDL RTL design tutorial
Uart VHDL RTL design tutorialUart VHDL RTL design tutorial
Uart VHDL RTL design tutorialNabil Chouba
 
VHdl lab report
VHdl lab reportVHdl lab report
VHdl lab reportJinesh Kb
 
Solution manual 8051 microcontroller by mazidi
Solution manual 8051 microcontroller by mazidiSolution manual 8051 microcontroller by mazidi
Solution manual 8051 microcontroller by mazidiMuhammad Abdullah
 
Getting Started With Raspberry Pi - UCSD 2013
Getting Started With Raspberry Pi - UCSD 2013Getting Started With Raspberry Pi - UCSD 2013
Getting Started With Raspberry Pi - UCSD 2013Tom Paulus
 
Lecture 2 verilog
Lecture 2   verilogLecture 2   verilog
Lecture 2 verilogvenravi10
 
VLSI Lab manual PDF
VLSI Lab manual PDFVLSI Lab manual PDF
VLSI Lab manual PDFUR11EC098
 
Microcontroller Programming Assignment
Microcontroller Programming AssignmentMicrocontroller Programming Assignment
Microcontroller Programming Assignmentbabak danyal
 

La actualidad más candente (20)

Lcd module interface with xilinx software using verilog
Lcd module interface with xilinx software using verilogLcd module interface with xilinx software using verilog
Lcd module interface with xilinx software using verilog
 
Dam gate open close lpc prog
Dam gate open close lpc progDam gate open close lpc prog
Dam gate open close lpc prog
 
FPGA Tutorial - LCD Interface
FPGA Tutorial - LCD InterfaceFPGA Tutorial - LCD Interface
FPGA Tutorial - LCD Interface
 
Fpga creating counter with external clock
Fpga   creating counter with external clockFpga   creating counter with external clock
Fpga creating counter with external clock
 
Programs of VHDL
Programs of VHDLPrograms of VHDL
Programs of VHDL
 
Data Acquisition
Data AcquisitionData Acquisition
Data Acquisition
 
VHDL Programs
VHDL ProgramsVHDL Programs
VHDL Programs
 
8051-mazidi-solution
8051-mazidi-solution8051-mazidi-solution
8051-mazidi-solution
 
Uart VHDL RTL design tutorial
Uart VHDL RTL design tutorialUart VHDL RTL design tutorial
Uart VHDL RTL design tutorial
 
VHdl lab report
VHdl lab reportVHdl lab report
VHdl lab report
 
Solution manual 8051 microcontroller by mazidi
Solution manual 8051 microcontroller by mazidiSolution manual 8051 microcontroller by mazidi
Solution manual 8051 microcontroller by mazidi
 
ECAD lab manual
ECAD lab manualECAD lab manual
ECAD lab manual
 
VERILOG CODE
VERILOG CODEVERILOG CODE
VERILOG CODE
 
Getting Started With Raspberry Pi - UCSD 2013
Getting Started With Raspberry Pi - UCSD 2013Getting Started With Raspberry Pi - UCSD 2013
Getting Started With Raspberry Pi - UCSD 2013
 
microprocessors
microprocessorsmicroprocessors
microprocessors
 
Lecture 2 verilog
Lecture 2   verilogLecture 2   verilog
Lecture 2 verilog
 
Q 1
Q 1Q 1
Q 1
 
Direct analog
Direct analogDirect analog
Direct analog
 
VLSI Lab manual PDF
VLSI Lab manual PDFVLSI Lab manual PDF
VLSI Lab manual PDF
 
Microcontroller Programming Assignment
Microcontroller Programming AssignmentMicrocontroller Programming Assignment
Microcontroller Programming Assignment
 

Destacado

Algunas consideraciones
Algunas consideracionesAlgunas consideraciones
Algunas consideracionesOmar Sanchez
 
Ejemplos de modelos basados en adaptacion parametrica
Ejemplos de modelos basados en adaptacion parametricaEjemplos de modelos basados en adaptacion parametrica
Ejemplos de modelos basados en adaptacion parametricaOmar Sanchez
 
Denavit hartenberg convention
Denavit hartenberg conventionDenavit hartenberg convention
Denavit hartenberg conventionnguyendattdh
 
Dr. Jármi Éva: Internetes bántalmazás az iskolában
Dr. Jármi Éva: Internetes bántalmazás az iskolábanDr. Jármi Éva: Internetes bántalmazás az iskolában
Dr. Jármi Éva: Internetes bántalmazás az iskolábanSulinetwork
 
Cinemática de los manipuladores
Cinemática de los manipuladoresCinemática de los manipuladores
Cinemática de los manipuladoresOmar Sanchez
 
Cinematica Vehiculos
Cinematica VehiculosCinematica Vehiculos
Cinematica VehiculosOmar Sanchez
 
Agrupamiento Kmeans
Agrupamiento KmeansAgrupamiento Kmeans
Agrupamiento KmeansOmar Sanchez
 
Fuzzy c-means clustering
Fuzzy c-means clusteringFuzzy c-means clustering
Fuzzy c-means clusteringOmar Sanchez
 
Fuzzy c-Means Clustering Algorithms
Fuzzy c-Means Clustering AlgorithmsFuzzy c-Means Clustering Algorithms
Fuzzy c-Means Clustering AlgorithmsJustin Cletus
 
Fuzzy c-means clustering for image segmentation
Fuzzy c-means  clustering for image segmentationFuzzy c-means  clustering for image segmentation
Fuzzy c-means clustering for image segmentationDharmesh Patel
 
K means Clustering
K means ClusteringK means Clustering
K means ClusteringEdureka!
 
Fuzzy image processing- fuzzy C-mean clustering
Fuzzy image processing- fuzzy C-mean clusteringFuzzy image processing- fuzzy C-mean clustering
Fuzzy image processing- fuzzy C-mean clusteringFarah M. Altufaili
 

Destacado (16)

Algunas consideraciones
Algunas consideracionesAlgunas consideraciones
Algunas consideraciones
 
Nano5 features
Nano5 featuresNano5 features
Nano5 features
 
Ejemplos de modelos basados en adaptacion parametrica
Ejemplos de modelos basados en adaptacion parametricaEjemplos de modelos basados en adaptacion parametrica
Ejemplos de modelos basados en adaptacion parametrica
 
Denavit hartenberg convention
Denavit hartenberg conventionDenavit hartenberg convention
Denavit hartenberg convention
 
Dr. Jármi Éva: Internetes bántalmazás az iskolában
Dr. Jármi Éva: Internetes bántalmazás az iskolábanDr. Jármi Éva: Internetes bántalmazás az iskolában
Dr. Jármi Éva: Internetes bántalmazás az iskolában
 
Cinemática de los manipuladores
Cinemática de los manipuladoresCinemática de los manipuladores
Cinemática de los manipuladores
 
Cinematica Vehiculos
Cinematica VehiculosCinematica Vehiculos
Cinematica Vehiculos
 
kinematic synthesis
kinematic synthesiskinematic synthesis
kinematic synthesis
 
Clustering
ClusteringClustering
Clustering
 
Agrupamiento Kmeans
Agrupamiento KmeansAgrupamiento Kmeans
Agrupamiento Kmeans
 
Fuzzy c-means clustering
Fuzzy c-means clusteringFuzzy c-means clustering
Fuzzy c-means clustering
 
Fuzzy c-Means Clustering Algorithms
Fuzzy c-Means Clustering AlgorithmsFuzzy c-Means Clustering Algorithms
Fuzzy c-Means Clustering Algorithms
 
Fuzzy c means manual work
Fuzzy c means manual workFuzzy c means manual work
Fuzzy c means manual work
 
Fuzzy c-means clustering for image segmentation
Fuzzy c-means  clustering for image segmentationFuzzy c-means  clustering for image segmentation
Fuzzy c-means clustering for image segmentation
 
K means Clustering
K means ClusteringK means Clustering
K means Clustering
 
Fuzzy image processing- fuzzy C-mean clustering
Fuzzy image processing- fuzzy C-mean clusteringFuzzy image processing- fuzzy C-mean clustering
Fuzzy image processing- fuzzy C-mean clustering
 

Similar a Functions for Nano 5 Card

m.tech esd lab manual for record
m.tech esd lab manual for recordm.tech esd lab manual for record
m.tech esd lab manual for recordG Lemuel George
 
Automatic room light controller with visible counter
Automatic room light controller with visible counterAutomatic room light controller with visible counter
Automatic room light controller with visible counterMafaz Ahmed
 
Embedded systems design @ defcon 2015
Embedded systems design @ defcon 2015Embedded systems design @ defcon 2015
Embedded systems design @ defcon 2015Rodrigo Almeida
 
SIMPLE Frequency METER using AT89c51
SIMPLE Frequency METER using AT89c51 SIMPLE Frequency METER using AT89c51
SIMPLE Frequency METER using AT89c51 aroosa khan
 
Analog To Digital Conversion (ADC) Programming in LPC2148
Analog To Digital Conversion (ADC) Programming in LPC2148Analog To Digital Conversion (ADC) Programming in LPC2148
Analog To Digital Conversion (ADC) Programming in LPC2148Omkar Rane
 
Itsp documentation quadcopter flight controller based on kalman filters
Itsp documentation   quadcopter flight controller based on kalman filtersItsp documentation   quadcopter flight controller based on kalman filters
Itsp documentation quadcopter flight controller based on kalman filtersJyotirmaya Mahanta
 
Keypad interfacing 8051 -NANOCDAC
Keypad interfacing 8051 -NANOCDACKeypad interfacing 8051 -NANOCDAC
Keypad interfacing 8051 -NANOCDACnanocdac
 
Lab #5_Revised  (Due 121315)This is a revision on the previous.docx
Lab #5_Revised  (Due 121315)This is a revision on the previous.docxLab #5_Revised  (Due 121315)This is a revision on the previous.docx
Lab #5_Revised  (Due 121315)This is a revision on the previous.docxVinaOconner450
 
Getting Started with Raspberry Pi - USC 2013
Getting Started with Raspberry Pi - USC 2013Getting Started with Raspberry Pi - USC 2013
Getting Started with Raspberry Pi - USC 2013Tom Paulus
 

Similar a Functions for Nano 5 Card (20)

LCD_Example.pptx
LCD_Example.pptxLCD_Example.pptx
LCD_Example.pptx
 
131080111003 mci
131080111003 mci131080111003 mci
131080111003 mci
 
m.tech esd lab manual for record
m.tech esd lab manual for recordm.tech esd lab manual for record
m.tech esd lab manual for record
 
PIC and LCD
PIC and LCDPIC and LCD
PIC and LCD
 
ESD -DAY 24.pptx
ESD -DAY 24.pptxESD -DAY 24.pptx
ESD -DAY 24.pptx
 
Automatic room light controller with visible counter
Automatic room light controller with visible counterAutomatic room light controller with visible counter
Automatic room light controller with visible counter
 
Experiment 16 x2 parallel lcd
Experiment   16 x2 parallel lcdExperiment   16 x2 parallel lcd
Experiment 16 x2 parallel lcd
 
Embedded systems design @ defcon 2015
Embedded systems design @ defcon 2015Embedded systems design @ defcon 2015
Embedded systems design @ defcon 2015
 
Analog to Digital Converter
Analog to Digital ConverterAnalog to Digital Converter
Analog to Digital Converter
 
Basic standard calculator
Basic standard calculatorBasic standard calculator
Basic standard calculator
 
SIMPLE Frequency METER using AT89c51
SIMPLE Frequency METER using AT89c51 SIMPLE Frequency METER using AT89c51
SIMPLE Frequency METER using AT89c51
 
Analog To Digital Conversion (ADC) Programming in LPC2148
Analog To Digital Conversion (ADC) Programming in LPC2148Analog To Digital Conversion (ADC) Programming in LPC2148
Analog To Digital Conversion (ADC) Programming in LPC2148
 
Itsp documentation quadcopter flight controller based on kalman filters
Itsp documentation   quadcopter flight controller based on kalman filtersItsp documentation   quadcopter flight controller based on kalman filters
Itsp documentation quadcopter flight controller based on kalman filters
 
Keypad interfacing 8051 -NANOCDAC
Keypad interfacing 8051 -NANOCDACKeypad interfacing 8051 -NANOCDAC
Keypad interfacing 8051 -NANOCDAC
 
Picmico
PicmicoPicmico
Picmico
 
Lab #5_Revised  (Due 121315)This is a revision on the previous.docx
Lab #5_Revised  (Due 121315)This is a revision on the previous.docxLab #5_Revised  (Due 121315)This is a revision on the previous.docx
Lab #5_Revised  (Due 121315)This is a revision on the previous.docx
 
chapter 4
chapter 4chapter 4
chapter 4
 
Anup2
Anup2Anup2
Anup2
 
Lcd n PIC16F
Lcd n PIC16FLcd n PIC16F
Lcd n PIC16F
 
Getting Started with Raspberry Pi - USC 2013
Getting Started with Raspberry Pi - USC 2013Getting Started with Raspberry Pi - USC 2013
Getting Started with Raspberry Pi - USC 2013
 

Más de Omar Sanchez

Assembly programming II
Assembly programming IIAssembly programming II
Assembly programming IIOmar Sanchez
 
Assembly programming
Assembly programmingAssembly programming
Assembly programmingOmar Sanchez
 
Assembler Programming
Assembler ProgrammingAssembler Programming
Assembler ProgrammingOmar Sanchez
 
Sistemas numericos
Sistemas numericosSistemas numericos
Sistemas numericosOmar Sanchez
 
Referencias MATLAB
Referencias MATLABReferencias MATLAB
Referencias MATLABOmar Sanchez
 
Control Modelo de Referencia y Linealizacion po Realimentacion
Control Modelo de Referencia y Linealizacion po RealimentacionControl Modelo de Referencia y Linealizacion po Realimentacion
Control Modelo de Referencia y Linealizacion po RealimentacionOmar Sanchez
 
Segmentación de imagenes
Segmentación de imagenesSegmentación de imagenes
Segmentación de imagenesOmar Sanchez
 
Imagen e histograma
Imagen e histogramaImagen e histograma
Imagen e histogramaOmar Sanchez
 
Funciones de Lyapunov basado en Krasovskii
Funciones de Lyapunov basado en KrasovskiiFunciones de Lyapunov basado en Krasovskii
Funciones de Lyapunov basado en KrasovskiiOmar Sanchez
 
Sensores de robots
Sensores de robotsSensores de robots
Sensores de robotsOmar Sanchez
 
Vehiculos no tripulados
Vehiculos no tripuladosVehiculos no tripulados
Vehiculos no tripuladosOmar Sanchez
 
Algunos aspectos de estabilidad
Algunos aspectos de estabilidadAlgunos aspectos de estabilidad
Algunos aspectos de estabilidadOmar Sanchez
 
Control basado en modelo
Control basado en modeloControl basado en modelo
Control basado en modeloOmar Sanchez
 
Sistemas jerárquicos
Sistemas jerárquicosSistemas jerárquicos
Sistemas jerárquicosOmar Sanchez
 

Más de Omar Sanchez (20)

Assembler4
Assembler4Assembler4
Assembler4
 
Assembly programming II
Assembly programming IIAssembly programming II
Assembly programming II
 
Assembly programming
Assembly programmingAssembly programming
Assembly programming
 
Assembler Programming
Assembler ProgrammingAssembler Programming
Assembler Programming
 
Sistemas numericos
Sistemas numericosSistemas numericos
Sistemas numericos
 
Ensamblador
EnsambladorEnsamblador
Ensamblador
 
Referencias MATLAB
Referencias MATLABReferencias MATLAB
Referencias MATLAB
 
Control Modelo de Referencia y Linealizacion po Realimentacion
Control Modelo de Referencia y Linealizacion po RealimentacionControl Modelo de Referencia y Linealizacion po Realimentacion
Control Modelo de Referencia y Linealizacion po Realimentacion
 
Fundposori
FundposoriFundposori
Fundposori
 
Segmentación de imagenes
Segmentación de imagenesSegmentación de imagenes
Segmentación de imagenes
 
Imagen e histograma
Imagen e histogramaImagen e histograma
Imagen e histograma
 
Funciones de Lyapunov basado en Krasovskii
Funciones de Lyapunov basado en KrasovskiiFunciones de Lyapunov basado en Krasovskii
Funciones de Lyapunov basado en Krasovskii
 
Sensores de robots
Sensores de robotsSensores de robots
Sensores de robots
 
Vehiculos no tripulados
Vehiculos no tripuladosVehiculos no tripulados
Vehiculos no tripulados
 
Algunos aspectos de estabilidad
Algunos aspectos de estabilidadAlgunos aspectos de estabilidad
Algunos aspectos de estabilidad
 
Control basado en modelo
Control basado en modeloControl basado en modelo
Control basado en modelo
 
Grupos próximos
Grupos próximosGrupos próximos
Grupos próximos
 
Redes Neuronales
Redes NeuronalesRedes Neuronales
Redes Neuronales
 
Sistemas jerárquicos
Sistemas jerárquicosSistemas jerárquicos
Sistemas jerárquicos
 
Lógica Borrosa
Lógica BorrosaLógica Borrosa
Lógica Borrosa
 

Último

College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCollege Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCall Girls in Nagpur High Profile
 
result management system report for college project
result management system report for college projectresult management system report for college project
result management system report for college projectTonystark477637
 
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...ranjana rawat
 
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...Soham Mondal
 
KubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghlyKubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghlysanyuktamishra911
 
UNIT-II FMM-Flow Through Circular Conduits
UNIT-II FMM-Flow Through Circular ConduitsUNIT-II FMM-Flow Through Circular Conduits
UNIT-II FMM-Flow Through Circular Conduitsrknatarajan
 
Porous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writingPorous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writingrakeshbaidya232001
 
AKTU Computer Networks notes --- Unit 3.pdf
AKTU Computer Networks notes ---  Unit 3.pdfAKTU Computer Networks notes ---  Unit 3.pdf
AKTU Computer Networks notes --- Unit 3.pdfankushspencer015
 
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICSHARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICSRajkumarAkumalla
 
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...ranjana rawat
 
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur High Profile
 
The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...
The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...
The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...ranjana rawat
 
SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )Tsuyoshi Horigome
 
Introduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptxIntroduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptxupamatechverse
 
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINEMANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINESIVASHANKAR N
 
Software Development Life Cycle By Team Orange (Dept. of Pharmacy)
Software Development Life Cycle By  Team Orange (Dept. of Pharmacy)Software Development Life Cycle By  Team Orange (Dept. of Pharmacy)
Software Development Life Cycle By Team Orange (Dept. of Pharmacy)Suman Mia
 
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130Suhani Kapoor
 
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICSAPPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICSKurinjimalarL3
 
Java Programming :Event Handling(Types of Events)
Java Programming :Event Handling(Types of Events)Java Programming :Event Handling(Types of Events)
Java Programming :Event Handling(Types of Events)simmis5
 
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130Suhani Kapoor
 

Último (20)

College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCollege Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
 
result management system report for college project
result management system report for college projectresult management system report for college project
result management system report for college project
 
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
 
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
 
KubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghlyKubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghly
 
UNIT-II FMM-Flow Through Circular Conduits
UNIT-II FMM-Flow Through Circular ConduitsUNIT-II FMM-Flow Through Circular Conduits
UNIT-II FMM-Flow Through Circular Conduits
 
Porous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writingPorous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writing
 
AKTU Computer Networks notes --- Unit 3.pdf
AKTU Computer Networks notes ---  Unit 3.pdfAKTU Computer Networks notes ---  Unit 3.pdf
AKTU Computer Networks notes --- Unit 3.pdf
 
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICSHARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
 
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
 
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
 
The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...
The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...
The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...
 
SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )
 
Introduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptxIntroduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptx
 
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINEMANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
 
Software Development Life Cycle By Team Orange (Dept. of Pharmacy)
Software Development Life Cycle By  Team Orange (Dept. of Pharmacy)Software Development Life Cycle By  Team Orange (Dept. of Pharmacy)
Software Development Life Cycle By Team Orange (Dept. of Pharmacy)
 
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
 
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICSAPPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
 
Java Programming :Event Handling(Types of Events)
Java Programming :Event Handling(Types of Events)Java Programming :Event Handling(Types of Events)
Java Programming :Event Handling(Types of Events)
 
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
 

Functions for Nano 5 Card

  • 1. Available functions for Nano 5 Cards I2C (I2C_FUNC.c): // I2C Functions – Master void i2c_start (void) void i2c_stop (void) bit i2c_write (unsigned char output_data) unsigned char i2c_read (bit send_ack) LCD (LCD_Func.c): void sendCharLCD (unsigned char DIR_DISP, unsigned char CONT_DISP) void SendStringLCD (unsigned short int LINE, char src[]) Example: char string1[] = "-----Reference------"; SendStringLCD (2, string1); // line(1-4), string void Clear_Screen (void) Figure 1.- LCD interface using I2C communication Pins definition (Init.h): Example: // Timers Tester & Cayenne Interface sbit TEST_P23 = P2^3; // Control of Relay 1 sbit TEST_P22 = P2^2; // Control of Relay 2 sbit TEST_P21 = P2^1; // Reset Initial conditions (BasicRut.c): void System_Setup (void) Example: // %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% UART Setup // Initialize the serial port (115200, 8, N, 1) [see page 32 of data sheet] PLLCON = 0x50; SCON = 0x50; // 0101,0000 (Mode 1 and RxD enable) T3CON = 0x83; T3FD = 0x09; TI = 1; // Set UART to send first char
  • 2. Delays (BasicRut.c): // delay of 0.1 mseg at 16MHz, fixed by oscilloscope void delay01(unsigned int num_01delay) // delay of 0.02 mseg at 16MHz, fixed by oscilloscope void delay002(unsigned int num_01delay) Relays (BasicRut.c): // SET_Relay (RELAY, STATUS_R) // RELAY {LS1 == 0, LS2 == 1}, STATUS_R { 0 == OFF, 1 == ON} void Set_Relay (bit RELAY, bit STATUS_R) LED: TEST_LED = 1; // LED == P2.5 // TEST_LED = {1 == OFF, 0 == ON} Switch (BasicRut.c): bit Get_Key(void) // KEY_FLAGE = 0 (Pressed), KEY_FLAGE = 1 (No Pressed) void Wait_KitKey (void) // Wait for key pressed Figure 2.- Hardware setup (initial conditions) and test of Delays (based in machine cycles), Relays, Kit Switch and Led Internal Temperature, ADC8 (TEMP_INTERNAL.c): unsigned int Get_InternalTemp (void) Temperature in LCD: void SendToLCD_InternalTemp (unsigned char dir_disp, unsigned short int valuetoshow) Unsigned int to LCD (BasicRut.c): void HEXtoASCII (unsigned int adc16value) // valuetoshow == (0 - 65535, unsigned int) void SendToLCD_ASCII (unsigned int valuetoshow, unsigned char ini_dir) Figure 3.- Temperature sensor of ADuC842 and unsigned integer shows in LCD
  • 3. Analog to Digital Converter (ADC_DAC.c): // channel number: 1, 2, 3, 4, 6, 7 // numsamples: {1, 65535} // 12 bits ADC unsigned int GetVal (unsigned char CHAN, unsigned int numsamples) Digital to Analog Converter (ADC_DAC.c): // voltage: {0, (2.5-1/4096)} 12 bits DAC // DAC_chan: 0, 1 void GenVal (float outputvolt, bit DAC_flag) Voltage to LCD (BasicRut.c): // Used for ADCs and DACs, format X.XXX Volts void SendToLCD_Volt (unsigned short int valuetoshow, unsigned char ini_dir) Figure 4.- ADCs and DACs (ADC1 is connected to DAC1 for test purpose) UART Communication (UART.c): char getChar() void sendChar(char c) void UART_OutString(char *pttt) char * getline( char *Storage ) Example: TESTER_UART.c Voltage to UART (BasicRut.c): // Used for ADCs and DACs, format X.XXX Volts void SendToTerminal (unsigned short int valuetoshow) Software Reset (BasicRut.c): void Soft_Res (void) IR Remote Controller (IRREMOTE.c): // Interrupt INT0 // Flag: IRSET unsigned char GET_KEY_IR (void)
  • 4. Figure 5.- UART interface. Test of ADCs and DACs (ADC1 is connected to DAC1 for test purpose) Keypad 4x4 (KEYPAD4x4_Func.c): // Interrupt INT1 // Flag: KEYSET char Read_Keypad(void) IR Remote Controller + Keypad 4x4 (IR_KEYPAD4x4_Func.c): char Get_Key_Multi(void) // wait keypressed void Wait_Keypressed_Multiple (void) Figure 6.- Testing the IR Remote Controller or Keypad 4x4 using LCD (right)
  • 5. Figure 7.- Testing the IR Remote Controller or Keypad 4x4 using UART Rotary Encoder (ROT_ENCODER.c): unsigned char Ask_Encoder (void) Figure 8.- Testing the Rotary Encoder Timer Counters (TIMERS_Func.c): // Init_Timers(Timer, Interrupt Time) // Timer: 0, 1, 2 void Init_Timers (unsigned char TC_chan, float Def_time_seg) Interrupt Response (Init_Cond.c): Interrupts: 1, 3, 5 Pulse Width Modulation (PWM_Func.c): // Mode 1, PWM1 Control void Init_PWMs_mode1 (float desired_freq, unsigned char duty_cycle)
  • 6. Figure 9.- Testing the Timers Counters Figure 10.- Testing the PWM1 Write to Flash Memory (WriteFlashp.asm): // (DIR== (EADH EADL), Var1 == (EDATA1 EDATA2), Var2 == (EDATA3 EDATA4)) WriteFlash (dir_flash, EDATA1_EDATA2, EDATA3_EDATA4)
  • 7. Read from Flash Memory (GetFlashp.asm): // longvarout == (EDATA1 EDATA2 EDATA3 EDATA4), DIR == (EADH EADL) longvarout = GetFlash(dir_flash) ; var1= (longvarout >> 24) & 0x000000FF; //EDATA1 var2= (longvarout >> 16) & 0x000000FF; //EDATA2 var3= (longvarout >> 8) & 0x000000FF; //EDATA3 var4= longvarout & 0x000000FF; //EDATA4 Figure 11.- Testing the Flash Memory ADC Calibration (ADC_CALIBRATION.c): // ADC1 must be connected to GND void CALIBRATION (void) Figure 12.- Calibrating the ADCs
  • 8. Set Time in RTC (SET_TIME.c): // IR Remote or Keypad 4x4, LCD, Real Time Clock void SetTime(void) Read Time from RTC and shows in LCD (CURR_TIME.c): // IR Remote or Keypad 4x4 (until keypressed), LCD, Real Time Clock void CurrTime(void) // Read Time (decimal values) void get_values_rtc (void) Example: See this support video Figure 13.- Setting the time in the Real Time Clock Kit to Slave, RPi Interface (RASPI2C_FUNC.c): // Slave address: 0x34 void Change_Init_Cond (void) Send Char to RPi (RASPI2C_FUNC.c): void sendChar_i2c_rasp(char cc) Receive Char from RPi (RASPI2C_FUNC.c): unsigned char getChar_i2c_rasp(void) Sync Kit - RPi (RASPI2C_FUNC.c): void Sync_up (void) Send float to RPi (RASPI2C_FUNC.c): void sendfloat_i2c_rasp (float ff) Send integer to RPi (RASPI2C_FUNC.c): void sendinteger_i2c_rasp (unsigned int integer_2) Kit Function, Send float and integer values to RPi (RASPPI_I2C.c): void I2C_Raspberry(void) RPI Functions (Receive float values from Kit and shows them): Plot_Drawnow.py Plot_General.py
  • 9. Figure 14.- Making the connection with internet and sending the data to Raspberry Pi Figure 15.- Raspberry Pi: Receiving and plotting the data from Nano 5 Card Relays Controlled by Cayenne (Rasp_Cayenne.c): // Must be connected: // Pin 40 (GPIO 21) Raspberry Pi conected to P2^3, Control of Relay 1 // Pin 38 (GPIO 20) Raspberry Pi conected to P2^2, Control of Relay 2 // Pin 12 (GPIO 18) Raspberry Pi conected to P2^1, Reset Kit void Rasp_Cayenne(void)
  • 10. Figure 16.- Pins connection for Cayenne interface Figure 17.- Cayenne interface: Setting on Relay 2 of Nano 5 Card Figure 18.- Cayenne interface: Scheduling an event for Relay 1: Turn On at 7:33 pm