12.07.2015 Views

Interfacing the M68HC05 MCU to the MC145051 A/D Converter

Interfacing the M68HC05 MCU to the MC145051 A/D Converter

Interfacing the M68HC05 MCU to the MC145051 A/D Converter

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Freescale Semiconduc<strong>to</strong>r, Inc.Application Note*** Clock <strong>the</strong> serial clock pinL1_3 bset SER_CLK,PORTA ;ser_clk = 1bclr SER_CLK,PORTA ;ser_clk = 0decx;decrease counter loopbne LOOP1 ;is LOOP1 finished?ldx #6T ;init counter for LOOP2nc...Freescale Semiconduc<strong>to</strong>r, I*** Read <strong>the</strong> serial input pinLOOP2 brclr SER_IN,PORTA,L2 ;carry bit = serial inL2 rol RESULT+1 ;rotate left resultrol RESULT*** Clock <strong>the</strong> serial clock pinbset SER_CLK,PORTA ;ser_clk = 1bclr SER_CLK,PORTA ;ser_clk = 0decx;decrease counter loopbne LOOP2 ;is LOOP2 finished?*** CS* high <strong>to</strong> finish serial transferbset CS,PORTA ;CS* line is highFOR BRA FOR ;branch foreverorg $03FE ;reset vec<strong>to</strong>rdw STARTAN1228 — Rev. 2.030 MOTOROLAFor More Information On This Product,Go <strong>to</strong>: www.freescale.com

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!