SlideShare a Scribd company logo
1 of 15
DATA SERIALIZING, BCD
& ASCII
GAURAVSINH PARMAR
(170410117023)
AADARSH PATEL
(170410117025)
SERIALIZING DATA
• SERIALIZING DATA IS A WAY OF SENDING A BYTE OF DATA ONE
BIT AT A TIME THROUGH A SINGLE PIN OF MICROCONTROLLER.
• DATA SERIALIZING FOR BYTE TRANSFER CAN BE DONE BY TWO
WAYS
DATA SERIALIZING
1. BY USING THE SERIAL PORT.
HERE, THE PROGRAMMERS HAVE VERY LIMITED CONTROL OVER THE SEQUENCE OF
DATA TRANSFER.
2. BY TRANSFER 1 BIT DATA AT A TIME AND CONTROL THE SEQUENCE OF DATA AND
SPACES IN BETWEEN THEM. NEW GENERATION DEVICES SUCH AS LCD, ADC & ROM, THE
SERIAL VERSIONS OF THESE DEVICES ARE BECOMING POPULAR SINCE THEY TAKE LESS
SPACE ON A PRINTED CIRCUIT BOARD.
SERIALIZING A BYTE OF DATA
• SERIALIZING DATA IS ONE THE MOST WIDELY USED APPLICATION.
• HERE THE CY FLAG STATUS CAN BE MOVED TO ANY PIN OF PORTS P0-P3.
• USING THIS CONCEPT, TRANSFER A BYTE OF A DATA SERIALLY (1 BIT AT A TIME)
REPEATING THE FOLLOWING SEQUENCE 8 TIMES AN ENTIRE BYTE TRANSFER
MOV A,#41H
SETB P2.1
SETB P2.1
MOV R5,#8
RRC A
MOV P2.1,C
DJNZ R5, HERE
SET P2.1
SETB P2.1
HERE:
Q:- write a prog. To transfer value 41H serially ( 1 bit at time)via pin
P2.1. put 2 high at the start and end of the data.
SWAP A
• SWAP INSTRUCTION IS ONLY WORKS ON ACCUMULATOR(A).
• IT SWAPS THE LOWER NIBBLE & THE HIGHER NIBBLE.
• THE 4 BITS ARE PUT INTO THE HIGHER 4 BITS, & THE HIGHER 4 BITS ARE PUT INTO THE
LOWER 4 BITS.
Q:- PORT LINES P0.0-P0.3 ARE USED TO TAKE 4 BIT
DATA FROM I/P DEVICE. THIS DATA IS TO BE
DISPLAYED ON 4 LEDS CONNECTED TO PORT LINES
P1.4-P1.7.
• SOL:-
MOV P0,#0FFH
MOV A,P0
ANL A, #0FH
SWAP A
MOV P1,A
ASCII NUMBERS
• AMERICAN STANDARD CODE FOR INFORMATION INTERCHANGE, IS A CHARACTER
ENCODING STANDARD FOR ELECTRONIC COMMUNICATIONS.
• MOST MODERN CHARACTER-ENCODING SCHEMES ARE BASED ON ASCII, ALTHOUGH
THEY SUPPORT MANY ADDITIONAL CHARACTERS.
• THE KEY “0” IS ACTIVATED, 011 0000(30H) IS PROVIDED TO THE COMPUTER.
• BCD NUMBERS ARE UNIVERSAL, ALTHOUGH ASCII IS STANDARD IN US.
• MOST I/O DEVICES USE ASCII.
ASCII TO PACKED BCD CONVERSION
• TO CONVERT ASCII TO PACKED BCD, IT IS 1ST CONVERTED TO UNPACKED BCD (
TO GET RID OF THE 3) & THEN COMBINED TO MAKE PACKED BCD.
• FOR EX:- 4 & 7 THE KEYBOARD GIVES 34 & 37 RESPECTIVELY. THE GOAL IS TO
PRODUCE 47H OR “0100 0111” WHICH IS PACKED BCD.
CONVERT ASCII TO PACKED BCD
MOV A, #4
MOV R1,#7
ANL A,#0FH
ANL R1,#OFH
SWAP A
ORL A,R1
PACKED BCD TO ASCII
• MANY SYSTEMS HAVE WHAT IS CALLED A REAL-TIME CLOCK (RTC). THE RTC
PROVIDES THE TIME OF DAY (HOUR, MINUTE, SECOND) AND THE DATE (YEAR,
MONTH, DAY) CONTINUOUSLY, REGARDLESS OF WHETHER THE POWER IS ON OR
OFF . HOWEVER, THIS DATA IS PROVIDED IN PACKED BCD. FOR THIS DATA TO BE
DISPLAYED ON A DEVICE SUCH AS AN LCD, OR TO BE PRINTED BY THE PRINTER,
IT MUST BE IN ASCII FORMAT.
• TO CONVERT PACKED BCD TO ASCII, IT MUST FIRST BE CONVERTED TO
UNPACKED BCD. THEN UNPACKED BCD IS TAGGED WITH 011 0000(30H)
ASSUME THAT REGISTER A HAS PACKED BCD, WRITE A
PROGRAM TO CONVERT PACKED BCD TO TWO ASCII NUMBERS
AND PLACE THEM IN R2 AND R6.
MOV A,#29H
MOV R2,A
ANL A,#0FH
ORL A,#30H
MOV R6,A
MOV A,R2
DATA
ANL A,#0F0H
RR A
RR A
RR A
RR A
ORL A,#30H
MOV R2,A
PACKED BCD TO ASCII CONVERSION IN C
Q:- CONVERT PACKED BCD NO. 37 H TO ASCII AND DISPLAY THE BYTES
ON PORT 0 & 1.
#include<reg51.h>
void main()
{
unsigned char dat = 0x37;
P0= (dat & 0xf0) + 0x30;
P1 = (( dat & 0xf0) >>4) + 0X30;
While(1)
}
ASCII TO PACKED BCD CONVERSION IN C
• CONVERT ASCII DIGIT 3 & 8 TO PACKED BCD & DISPLAY IT ON PORT0.
#include<reg51.h>
void main()
{
unsigned char dat1= 0x33;
unsigned char dat2= 0x38;
PO = (dat2 & 0x0F) + (( dat1 & 0x0F) <<4);
while(1)
}
Data serializing

More Related Content

What's hot

Amvdd Data Converter Fundamentals
Amvdd Data Converter FundamentalsAmvdd Data Converter Fundamentals
Amvdd Data Converter FundamentalsNiket Chandrashekar
 
adc dac converter
adc dac converteradc dac converter
adc dac converterGaurav Rai
 
Lecture 11 (dac and comparator) rv01
Lecture 11 (dac and comparator) rv01Lecture 11 (dac and comparator) rv01
Lecture 11 (dac and comparator) rv01cairo university
 
Data converter fundamentals
Data converter fundamentalsData converter fundamentals
Data converter fundamentalsAbhishek Kadam
 
Digital to Analog conversion
Digital to Analog conversionDigital to Analog conversion
Digital to Analog conversionMariam Butt
 
Converter specification
Converter specificationConverter specification
Converter specificationViju Jigajinni
 
ANALOG TO DIGITAL AND DIGITAL TO ANALOG CONVERTER
ANALOG TO DIGITAL AND DIGITAL TO ANALOG CONVERTERANALOG TO DIGITAL AND DIGITAL TO ANALOG CONVERTER
ANALOG TO DIGITAL AND DIGITAL TO ANALOG CONVERTERSripati Mahapatra
 
Digital to analog convertor
Digital to analog convertorDigital to analog convertor
Digital to analog convertorsartaj ahmed
 
Adc and dac
Adc and dacAdc and dac
Adc and dacboarddk1
 
Difference amplifier and subtractor
Difference amplifier and subtractorDifference amplifier and subtractor
Difference amplifier and subtractorBhaveshChaudhari30
 
DAC-digital to analog converter
DAC-digital to analog converterDAC-digital to analog converter
DAC-digital to analog converterShazid Reaj
 

What's hot (20)

Amvdd Data Converter Fundamentals
Amvdd Data Converter FundamentalsAmvdd Data Converter Fundamentals
Amvdd Data Converter Fundamentals
 
Filters DAC and ADC
Filters DAC and ADCFilters DAC and ADC
Filters DAC and ADC
 
Data convertors
Data convertorsData convertors
Data convertors
 
ADC and DAC Best Ever Pers
ADC and DAC Best Ever PersADC and DAC Best Ever Pers
ADC and DAC Best Ever Pers
 
Vlsi dac
Vlsi dacVlsi dac
Vlsi dac
 
Adc
AdcAdc
Adc
 
ADC
ADCADC
ADC
 
adc dac converter
adc dac converteradc dac converter
adc dac converter
 
Lecture 11 (dac and comparator) rv01
Lecture 11 (dac and comparator) rv01Lecture 11 (dac and comparator) rv01
Lecture 11 (dac and comparator) rv01
 
Digital to analog conversion
Digital to analog                    conversionDigital to analog                    conversion
Digital to analog conversion
 
ADC & DAC
ADC & DAC ADC & DAC
ADC & DAC
 
Data converter fundamentals
Data converter fundamentalsData converter fundamentals
Data converter fundamentals
 
Digital to Analog conversion
Digital to Analog conversionDigital to Analog conversion
Digital to Analog conversion
 
Converter specification
Converter specificationConverter specification
Converter specification
 
Dac, adc architecture
Dac, adc architectureDac, adc architecture
Dac, adc architecture
 
ANALOG TO DIGITAL AND DIGITAL TO ANALOG CONVERTER
ANALOG TO DIGITAL AND DIGITAL TO ANALOG CONVERTERANALOG TO DIGITAL AND DIGITAL TO ANALOG CONVERTER
ANALOG TO DIGITAL AND DIGITAL TO ANALOG CONVERTER
 
Digital to analog convertor
Digital to analog convertorDigital to analog convertor
Digital to analog convertor
 
Adc and dac
Adc and dacAdc and dac
Adc and dac
 
Difference amplifier and subtractor
Difference amplifier and subtractorDifference amplifier and subtractor
Difference amplifier and subtractor
 
DAC-digital to analog converter
DAC-digital to analog converterDAC-digital to analog converter
DAC-digital to analog converter
 

Similar to Data serializing

Interfacing with peripherals: analog to digital converters and digital to ana...
Interfacing with peripherals: analog to digital converters and digital to ana...Interfacing with peripherals: analog to digital converters and digital to ana...
Interfacing with peripherals: analog to digital converters and digital to ana...NimeshSingh27
 
I2C And SPI Part-23
I2C And  SPI Part-23I2C And  SPI Part-23
I2C And SPI Part-23Techvilla
 
Peripherals and interfacing
Peripherals  and interfacingPeripherals  and interfacing
Peripherals and interfacingRAMPRAKASHT1
 
The presentation is about USART and serial communication
The presentation is about USART and serial communicationThe presentation is about USART and serial communication
The presentation is about USART and serial communicationsinaankhalil
 
8051 serial communication
8051 serial communication8051 serial communication
8051 serial communicationcanh phan
 
Digital switching system PDH-SDH-sonet.ppt
Digital switching system PDH-SDH-sonet.pptDigital switching system PDH-SDH-sonet.ppt
Digital switching system PDH-SDH-sonet.pptssuser08a5ab
 
336760739-Pdh-Sdh-Sonet.ppt
336760739-Pdh-Sdh-Sonet.ppt336760739-Pdh-Sdh-Sonet.ppt
336760739-Pdh-Sdh-Sonet.pptssuserefc414
 
FPGA implementation of synchronous and asynchronous counter and simulation of...
FPGA implementation of synchronous and asynchronous counter and simulation of...FPGA implementation of synchronous and asynchronous counter and simulation of...
FPGA implementation of synchronous and asynchronous counter and simulation of...ASHIMA GUPTA
 
Microcontroller.pptx
Microcontroller.pptxMicrocontroller.pptx
Microcontroller.pptxSaba651353
 
CAN Bus and OBD-II
CAN Bus and OBD-II CAN Bus and OBD-II
CAN Bus and OBD-II roadster43
 
Microprocessor and Application (8085)
Microprocessor and Application (8085)Microprocessor and Application (8085)
Microprocessor and Application (8085)ufaq kk
 

Similar to Data serializing (20)

Interfacing with peripherals: analog to digital converters and digital to ana...
Interfacing with peripherals: analog to digital converters and digital to ana...Interfacing with peripherals: analog to digital converters and digital to ana...
Interfacing with peripherals: analog to digital converters and digital to ana...
 
I2C And SPI Part-23
I2C And  SPI Part-23I2C And  SPI Part-23
I2C And SPI Part-23
 
8251 USART.pptx
8251 USART.pptx8251 USART.pptx
8251 USART.pptx
 
8251 USART
8251 USART8251 USART
8251 USART
 
Wds
WdsWds
Wds
 
8251 a basic
8251 a basic8251 a basic
8251 a basic
 
Peripherals and interfacing
Peripherals  and interfacingPeripherals  and interfacing
Peripherals and interfacing
 
The presentation is about USART and serial communication
The presentation is about USART and serial communicationThe presentation is about USART and serial communication
The presentation is about USART and serial communication
 
Distributed IP-PBX
Distributed IP-PBX Distributed IP-PBX
Distributed IP-PBX
 
8051 serial communication
8051 serial communication8051 serial communication
8051 serial communication
 
M3488 datasheet
M3488 datasheetM3488 datasheet
M3488 datasheet
 
Serial Communication in 8051
Serial Communication in 8051Serial Communication in 8051
Serial Communication in 8051
 
Digital switching system PDH-SDH-sonet.ppt
Digital switching system PDH-SDH-sonet.pptDigital switching system PDH-SDH-sonet.ppt
Digital switching system PDH-SDH-sonet.ppt
 
336760739-Pdh-Sdh-Sonet.ppt
336760739-Pdh-Sdh-Sonet.ppt336760739-Pdh-Sdh-Sonet.ppt
336760739-Pdh-Sdh-Sonet.ppt
 
FPGA implementation of synchronous and asynchronous counter and simulation of...
FPGA implementation of synchronous and asynchronous counter and simulation of...FPGA implementation of synchronous and asynchronous counter and simulation of...
FPGA implementation of synchronous and asynchronous counter and simulation of...
 
Microcontroller.pptx
Microcontroller.pptxMicrocontroller.pptx
Microcontroller.pptx
 
Pdhsdh
PdhsdhPdhsdh
Pdhsdh
 
CAN Bus and OBD-II
CAN Bus and OBD-II CAN Bus and OBD-II
CAN Bus and OBD-II
 
Microprocessor and Application (8085)
Microprocessor and Application (8085)Microprocessor and Application (8085)
Microprocessor and Application (8085)
 
Chapter 3 esy
Chapter 3 esy Chapter 3 esy
Chapter 3 esy
 

More from Gauravsinh Parmar

More from Gauravsinh Parmar (7)

Necessity for dryers
Necessity for dryersNecessity for dryers
Necessity for dryers
 
Floating mode controller
Floating mode controllerFloating mode controller
Floating mode controller
 
Class b amplifier
Class b amplifierClass b amplifier
Class b amplifier
 
Block Diagram Reduction
Block Diagram ReductionBlock Diagram Reduction
Block Diagram Reduction
 
3 phase x'mer windings
3 phase x'mer windings3 phase x'mer windings
3 phase x'mer windings
 
Sweep Frequency Generator
Sweep Frequency GeneratorSweep Frequency Generator
Sweep Frequency Generator
 
Cycloidal curves
Cycloidal curvesCycloidal curves
Cycloidal curves
 

Recently uploaded

Extrusion Processes and Their Limitations
Extrusion Processes and Their LimitationsExtrusion Processes and Their Limitations
Extrusion Processes and Their Limitations120cr0395
 
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
 
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escortsranjana rawat
 
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
 
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSMANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSSIVASHANKAR N
 
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
 
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
 
UNIT-III FMM. DIMENSIONAL ANALYSIS
UNIT-III FMM.        DIMENSIONAL ANALYSISUNIT-III FMM.        DIMENSIONAL ANALYSIS
UNIT-III FMM. DIMENSIONAL ANALYSISrknatarajan
 
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Serviceranjana rawat
 
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur High Profile
 
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
 
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...Dr.Costas Sachpazis
 
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service Nashik
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service NashikCall Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service Nashik
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service NashikCall Girls in Nagpur High Profile
 
Microscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptxMicroscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptxpurnimasatapathy1234
 
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...Christo Ananth
 
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
 
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
 

Recently uploaded (20)

Extrusion Processes and Their Limitations
Extrusion Processes and Their LimitationsExtrusion Processes and Their Limitations
Extrusion Processes and Their Limitations
 
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
 
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
 
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
 
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSMANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
 
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
 
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
 
UNIT-III FMM. DIMENSIONAL ANALYSIS
UNIT-III FMM.        DIMENSIONAL ANALYSISUNIT-III FMM.        DIMENSIONAL ANALYSIS
UNIT-III FMM. DIMENSIONAL ANALYSIS
 
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
 
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
 
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...
 
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
 
Roadmap to Membership of RICS - Pathways and Routes
Roadmap to Membership of RICS - Pathways and RoutesRoadmap to Membership of RICS - Pathways and Routes
Roadmap to Membership of RICS - Pathways and Routes
 
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service Nashik
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service NashikCall Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service Nashik
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service Nashik
 
★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR
★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR
★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR
 
Microscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptxMicroscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptx
 
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
 
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 )
 
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINEDJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
 
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
 

Data serializing

  • 1. DATA SERIALIZING, BCD & ASCII GAURAVSINH PARMAR (170410117023) AADARSH PATEL (170410117025)
  • 2. SERIALIZING DATA • SERIALIZING DATA IS A WAY OF SENDING A BYTE OF DATA ONE BIT AT A TIME THROUGH A SINGLE PIN OF MICROCONTROLLER. • DATA SERIALIZING FOR BYTE TRANSFER CAN BE DONE BY TWO WAYS
  • 3. DATA SERIALIZING 1. BY USING THE SERIAL PORT. HERE, THE PROGRAMMERS HAVE VERY LIMITED CONTROL OVER THE SEQUENCE OF DATA TRANSFER. 2. BY TRANSFER 1 BIT DATA AT A TIME AND CONTROL THE SEQUENCE OF DATA AND SPACES IN BETWEEN THEM. NEW GENERATION DEVICES SUCH AS LCD, ADC & ROM, THE SERIAL VERSIONS OF THESE DEVICES ARE BECOMING POPULAR SINCE THEY TAKE LESS SPACE ON A PRINTED CIRCUIT BOARD.
  • 4. SERIALIZING A BYTE OF DATA • SERIALIZING DATA IS ONE THE MOST WIDELY USED APPLICATION. • HERE THE CY FLAG STATUS CAN BE MOVED TO ANY PIN OF PORTS P0-P3. • USING THIS CONCEPT, TRANSFER A BYTE OF A DATA SERIALLY (1 BIT AT A TIME) REPEATING THE FOLLOWING SEQUENCE 8 TIMES AN ENTIRE BYTE TRANSFER
  • 5. MOV A,#41H SETB P2.1 SETB P2.1 MOV R5,#8 RRC A MOV P2.1,C DJNZ R5, HERE SET P2.1 SETB P2.1 HERE: Q:- write a prog. To transfer value 41H serially ( 1 bit at time)via pin P2.1. put 2 high at the start and end of the data.
  • 6. SWAP A • SWAP INSTRUCTION IS ONLY WORKS ON ACCUMULATOR(A). • IT SWAPS THE LOWER NIBBLE & THE HIGHER NIBBLE. • THE 4 BITS ARE PUT INTO THE HIGHER 4 BITS, & THE HIGHER 4 BITS ARE PUT INTO THE LOWER 4 BITS.
  • 7. Q:- PORT LINES P0.0-P0.3 ARE USED TO TAKE 4 BIT DATA FROM I/P DEVICE. THIS DATA IS TO BE DISPLAYED ON 4 LEDS CONNECTED TO PORT LINES P1.4-P1.7. • SOL:- MOV P0,#0FFH MOV A,P0 ANL A, #0FH SWAP A MOV P1,A
  • 8. ASCII NUMBERS • AMERICAN STANDARD CODE FOR INFORMATION INTERCHANGE, IS A CHARACTER ENCODING STANDARD FOR ELECTRONIC COMMUNICATIONS. • MOST MODERN CHARACTER-ENCODING SCHEMES ARE BASED ON ASCII, ALTHOUGH THEY SUPPORT MANY ADDITIONAL CHARACTERS. • THE KEY “0” IS ACTIVATED, 011 0000(30H) IS PROVIDED TO THE COMPUTER. • BCD NUMBERS ARE UNIVERSAL, ALTHOUGH ASCII IS STANDARD IN US. • MOST I/O DEVICES USE ASCII.
  • 9. ASCII TO PACKED BCD CONVERSION • TO CONVERT ASCII TO PACKED BCD, IT IS 1ST CONVERTED TO UNPACKED BCD ( TO GET RID OF THE 3) & THEN COMBINED TO MAKE PACKED BCD. • FOR EX:- 4 & 7 THE KEYBOARD GIVES 34 & 37 RESPECTIVELY. THE GOAL IS TO PRODUCE 47H OR “0100 0111” WHICH IS PACKED BCD.
  • 10. CONVERT ASCII TO PACKED BCD MOV A, #4 MOV R1,#7 ANL A,#0FH ANL R1,#OFH SWAP A ORL A,R1
  • 11. PACKED BCD TO ASCII • MANY SYSTEMS HAVE WHAT IS CALLED A REAL-TIME CLOCK (RTC). THE RTC PROVIDES THE TIME OF DAY (HOUR, MINUTE, SECOND) AND THE DATE (YEAR, MONTH, DAY) CONTINUOUSLY, REGARDLESS OF WHETHER THE POWER IS ON OR OFF . HOWEVER, THIS DATA IS PROVIDED IN PACKED BCD. FOR THIS DATA TO BE DISPLAYED ON A DEVICE SUCH AS AN LCD, OR TO BE PRINTED BY THE PRINTER, IT MUST BE IN ASCII FORMAT. • TO CONVERT PACKED BCD TO ASCII, IT MUST FIRST BE CONVERTED TO UNPACKED BCD. THEN UNPACKED BCD IS TAGGED WITH 011 0000(30H)
  • 12. ASSUME THAT REGISTER A HAS PACKED BCD, WRITE A PROGRAM TO CONVERT PACKED BCD TO TWO ASCII NUMBERS AND PLACE THEM IN R2 AND R6. MOV A,#29H MOV R2,A ANL A,#0FH ORL A,#30H MOV R6,A MOV A,R2 DATA ANL A,#0F0H RR A RR A RR A RR A ORL A,#30H MOV R2,A
  • 13. PACKED BCD TO ASCII CONVERSION IN C Q:- CONVERT PACKED BCD NO. 37 H TO ASCII AND DISPLAY THE BYTES ON PORT 0 & 1. #include<reg51.h> void main() { unsigned char dat = 0x37; P0= (dat & 0xf0) + 0x30; P1 = (( dat & 0xf0) >>4) + 0X30; While(1) }
  • 14. ASCII TO PACKED BCD CONVERSION IN C • CONVERT ASCII DIGIT 3 & 8 TO PACKED BCD & DISPLAY IT ON PORT0. #include<reg51.h> void main() { unsigned char dat1= 0x33; unsigned char dat2= 0x38; PO = (dat2 & 0x0F) + (( dat1 & 0x0F) <<4); while(1) }