<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>8-bit Microcontrollersのトピックnewbie [help] interfacing HC08 with CD4021BCN</title>
    <link>https://community.nxp.com/t5/8-bit-Microcontrollers/newbie-help-interfacing-HC08-with-CD4021BCN/m-p/123920#M68</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;&lt;SPAN style="color: #ff0000;"&gt;This message contains an entire topic ported from a separate forum. The original message and all replies are in this single message. We have seeded this new forum with selected information that we expect will be of value to you as you search for answers to your questions.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN class="postdetails"&gt;&lt;STRONG&gt;Posted: Sun Sep 25, 2005 1:56 am&lt;/STRONG&gt;&lt;SPAN class="gen"&gt;&amp;nbsp;&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN class="postdetails"&gt;&lt;/SPAN&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN class="postdetails"&gt;&lt;SPAN class="postbody"&gt;Hi, I'm using a HC08ab32 connected to a 8-Stage Static Shift Register&lt;BR /&gt; CD4021BCN serially. The Shift register is connected to a DIP switch. I&lt;BR /&gt; wanted to get the parallel-in data from the DIP switch. Do i need to&lt;BR /&gt; do it using the i2c method or other method? are there any example out&lt;BR /&gt; there for me to refer to? Thank you.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN class="postdetails"&gt;&lt;SPAN class="postbody"&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN class="postdetails"&gt;&lt;SPAN class="postbody"&gt;&lt;SPAN class="postdetails"&gt;&lt;SPAN class="postdetails"&gt;&lt;STRONG&gt;Posted: Sun Sep 25, 2005 1:30 pm&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN class="postdetails"&gt;&lt;SPAN class="postbody"&gt;&lt;SPAN class="postdetails"&gt;&lt;SPAN class="postdetails"&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN class="postdetails"&gt;&lt;SPAN class="postbody"&gt;&lt;SPAN class="postdetails"&gt;&lt;SPAN class="postdetails"&gt;To interface with the 4021 shift register device, you will need to use the Serial Peripheral Interface (SPI) facility within the 908. The 908 will be the master, and the shift register the slave.&lt;BR /&gt;&lt;BR /&gt; The Q8 output at pin 3 will connect to MISO, and the clock input at pin 10 will connect to SPSCK. You will also need to allocate an output from general purpose I/O to connect to pin 9 of the shift register, to provide a serial select signal. Connect the serial input at pin 11 to ground. You will need to decide whether the DIP switches should pull their inputs high or low when active, and provide either pull-down or pull-up resistors.&lt;BR /&gt;&lt;BR /&gt; Note that the MOSI pin on the 908 will not be used for this application, and the /SS pin would be configured for general I/O. For the 4021 device operating at 5 volts, the SPI clock rate may not exceed 2.5 MHz.&lt;BR /&gt;&lt;BR /&gt; During the initialisation routine for the 908 you will need to set the SPCR and SPSCR registers to suitable values. I assume that you would use a polling process (rather than interrupt) to access the DIP switch data, so I believe appropriate values would be:&lt;BR /&gt;&lt;BR /&gt; MOV #$32,SPCR&lt;BR /&gt; MOV #$01,SPSCR&lt;BR /&gt;&lt;BR /&gt; Look in the data sheet to see what each bit in these registers controls. To read the DIP switch data you will need to:&lt;BR /&gt;&lt;BR /&gt; 1. Set serial select output low using a BCLR instruction.&lt;BR /&gt; 2. Write a dummy value to the SPDR register.&lt;BR /&gt; 3. Wait for bit-7 of SPSCR to become set, to indicate new data in the receive buffer.&lt;BR /&gt; 4. Read the SPDR register for the current DIP switch data.&lt;BR /&gt; 5. Set serial select output high using BSET instruction.&lt;BR /&gt;&lt;BR /&gt; BCLR SSEL,PTx&lt;BR /&gt; STA SPDR&lt;BR /&gt; BRCLR 7,SPSCR,$ ; Wait while bit is low&lt;BR /&gt; LDA SPDR ; DIP switch data in ACC&lt;BR /&gt; BSET SSEL,PTx&lt;BR /&gt;&lt;BR /&gt; I hope this helps.&lt;BR /&gt;&lt;BR /&gt; Regards,&lt;BR /&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN class="postdetails"&gt;&lt;SPAN class="postbody"&gt;&lt;SPAN class="postdetails"&gt;&lt;SPAN class="postdetails"&gt;&lt;SPAN class="postdetails"&gt;&lt;STRONG&gt;Posted: Mon Sep 26, 2005 5:29 am&lt;SPAN class="gen"&gt;&amp;nbsp;&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN class="postdetails"&gt;&lt;SPAN class="postbody"&gt;&lt;SPAN class="postdetails"&gt;&lt;SPAN class="postdetails"&gt;&lt;SPAN class="postdetails"&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN class="postdetails"&gt;&lt;SPAN class="postbody"&gt;&lt;SPAN class="postdetails"&gt;&lt;SPAN class="postdetails"&gt;&lt;SPAN class="postdetails"&gt;Hi .. thanks for the reply, but I'm facing another problem that my SPI port is already used up. I only have i/o ports connected to the 4021. Can i still do it by using the i/o ports to manipulate it? thanks.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN class="postdetails"&gt;&lt;SPAN class="postbody"&gt;&lt;SPAN class="postdetails"&gt;&lt;SPAN class="postdetails"&gt;&lt;SPAN class="postdetails"&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN class="postdetails"&gt;&lt;SPAN class="postbody"&gt;&lt;SPAN class="postdetails"&gt;&lt;SPAN class="postdetails"&gt;&lt;SPAN class="postdetails"&gt;&lt;SPAN class="postdetails"&gt;&lt;STRONG&gt;Posted: Mon Sep 26, 2005 10:14 am&lt;/STRONG&gt;&lt;SPAN class="gen"&gt;&amp;nbsp;&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN class="postdetails"&gt;&lt;SPAN class="postbody"&gt;&lt;SPAN class="postdetails"&gt;&lt;SPAN class="postdetails"&gt;&lt;SPAN class="postdetails"&gt;&lt;SPAN class="postdetails"&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN class="postdetails"&gt;&lt;SPAN class="postbody"&gt;&lt;SPAN class="postdetails"&gt;&lt;SPAN class="postdetails"&gt;&lt;SPAN class="postdetails"&gt;&lt;SPAN class="postdetails"&gt;Hi.. I've come out with a solution. It seems to work. Efficiency I'm not very sure. Due to lack of SPI port.. I used i/o port for this. Here is my code.&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV class="j-rte-table"&gt;&lt;TABLE align="center" border="0" cellpadding="3" cellspacing="1" width="90%"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD style="border:0px solid black;"&gt;&lt;SPAN class="genmed"&gt;&lt;STRONG&gt;Code:&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="code" style="border:0px solid black;"&gt;&lt;BR /&gt;chkaddr&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; bclr&amp;nbsp; I2CSDA,DDRH&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;bset&amp;nbsp; PARSERSEL,PORTC&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;jsr&amp;nbsp; &amp;nbsp;i2del&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;mov&amp;nbsp; &amp;nbsp;#$08,BITCNT&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;BR /&gt;chkaddr1&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;bset&amp;nbsp; I2CSCL,PORTC&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;jsr&amp;nbsp; &amp;nbsp;i2del&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;lda&amp;nbsp; &amp;nbsp;PORTH&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;and&amp;nbsp; &amp;nbsp;#$01&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;ora&amp;nbsp; &amp;nbsp;CARDADDR&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;sta&amp;nbsp; &amp;nbsp;CARDADDR&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;lda&amp;nbsp; &amp;nbsp;BITCNT&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;cmp&amp;nbsp; &amp;nbsp;#$01&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;beq&amp;nbsp; &amp;nbsp;chkaddr2&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;asl&amp;nbsp; &amp;nbsp;CARDADDR&lt;BR /&gt;chkaddr2&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;bclr&amp;nbsp; I2CSCL,PORTC&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;jsr&amp;nbsp; &amp;nbsp;i2del&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;bclr&amp;nbsp; PARSERSEL,PORTC&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;dec&amp;nbsp; &amp;nbsp;BITCNT&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;bne&amp;nbsp; &amp;nbsp;chkaddr1&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;rts&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;SPAN class="postbody"&gt;&lt;/SPAN&gt;&lt;DIV&gt;&lt;BR /&gt;Are there any room to improve it? thanks.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN class="postdetails"&gt;&lt;STRONG&gt;Posted: Mon Sep 26, 2005 1:39 pm&lt;/STRONG&gt;&lt;SPAN class="gen"&gt;&amp;nbsp;&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN class="postdetails"&gt;&lt;/SPAN&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN class="postdetails"&gt;Be aware that the SPI port can usually be shared with multiple serial peripherals, so to say it is "used up" may not necessarily be true.&lt;BR /&gt;&lt;BR /&gt; There are two possible aproaches to expanding the use of the SPI. Of course there is also the "bit banging" approach that will also work, but will consume more of the spare I/O, and will occupy many more bus cycles.&lt;BR /&gt;&lt;BR /&gt; 1. You may daisy-chain the shift register with other serial output shift registers, to increase the length of the chain. This requires that the other device has a serial input for expansion purposes.&lt;BR /&gt;&lt;BR /&gt; 2. You may connect a parallel shift register chain. In this case, each slave chain would have a separate slave select (SS) input that would cause its output to MISO to be high impedance when inactive. In your case, a different device would be necessary, such as the 74HC589 shift register.&lt;BR /&gt;&lt;BR /&gt; To comment on your suggested "bit-banging" code - I will assume the following usage:&lt;BR /&gt; PARSERSEL,PORTC connects to pin 9 of the S/R,&lt;BR /&gt; I2CSDA is at 0,PORTH and is used as data input from the S/R,&lt;BR /&gt; I2CSCL,PORTC is your clock output,&lt;BR /&gt; Sub-routine 'i2del' provides a few cycles delay (and preserves the state of X and ACC).&lt;BR /&gt;&lt;BR /&gt; a) According to my data book, the 4021 is in serial mode when PARSERSEL is low - but you set it high prior to the serial transaction, and set it low afterwards. This would seem to prevent the S/R from shifting the data out.&lt;BR /&gt;&lt;BR /&gt; b) To test the state of a single bit within a register, be aware that the BRSET and BRCLR instructions set the carry flag in accordance with the current state of the bit. This can result in a significant simplification of the code.&lt;BR /&gt;&lt;BR /&gt; c) You will need to test the bit state prior to the first shift clock, otherwise you will lose the first (most significant) bit from the S/R.&lt;BR /&gt;&lt;BR /&gt; d) There are other minor variations that improve speed or code efficiency, e.g. use X register for your bit count, use ACC for your data byte, and utilise the DBNZ instruction for the loop.&lt;BR /&gt;&lt;BR /&gt; The modified routine might look like the following:&lt;BR /&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV class="j-rte-table"&gt;&lt;TABLE align="center" border="0" cellpadding="3" cellspacing="1" width="90%"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD style="border:0px solid black;"&gt;&lt;SPAN class="genmed"&gt;&lt;STRONG&gt;Code:&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="code" style="border:0px solid black;"&gt;&lt;BR /&gt;CHKADDR: BCLR&amp;nbsp; I2CSDA,DDRH&amp;nbsp; &amp;nbsp; &amp;nbsp;; This should really be part of POR initialisation&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;BCLR&amp;nbsp; I2CSCL,PORTC&amp;nbsp; &amp;nbsp; ; Initialise clock state&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;BCLR&amp;nbsp; PARSERSEL,PORTC ; Serial mode for S/R&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;LDX&amp;nbsp; &amp;nbsp;#8&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ; Bit count value&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;BR /&gt;CHK1:&amp;nbsp; &amp;nbsp; BRSET I2CSDA,PORTH,$+3 ; Set/clear carry&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;ROLA&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ; store bit state&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;BSET&amp;nbsp; I2CSCL,PORTC&amp;nbsp; &amp;nbsp; ; Generate clock pulse&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;JSR&amp;nbsp; &amp;nbsp;i2del&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;; small delay&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;BCLR&amp;nbsp; I2CSCL,PORTC&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;DBNZX CHK1&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ; Loop for next bit&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;STA&amp;nbsp; &amp;nbsp;CARDADDR&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;BSET&amp;nbsp; PARSERSEL,PORTC ; Return S/R to parallel mode&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;RTS&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;SPAN class="postbody"&gt;&lt;/SPAN&gt;&lt;DIV&gt;&lt;BR /&gt;&lt;BR /&gt;I hope this is of assistance to you.&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN class="postdetails"&gt;&lt;STRONG&gt;Posted: Tue Sep 27, 2005 2:37 am&lt;/STRONG&gt;&lt;SPAN class="gen"&gt;&amp;nbsp;&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN class="postdetails"&gt;&lt;/SPAN&gt;&amp;nbsp;&lt;/DIV&gt;&lt;SPAN class="postdetails"&gt;&lt;/SPAN&gt;&lt;DIV&gt;&lt;DIV class="j-rte-table"&gt;&lt;TABLE align="center" border="0" cellpadding="3" cellspacing="1" width="90%"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD style="border:0px solid black;"&gt;&lt;SPAN class="genmed"&gt;&lt;STRONG&gt;Quote:&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="quote" style="border:0px solid black;"&gt;a) According to my data book, the 4021 is in serial mode when PARSERSEL is low - but you set it high prior to the serial transaction, and set it low afterwards. This would seem to prevent the S/R from shifting the data out.&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;SPAN class="postbody"&gt;&lt;/SPAN&gt;&lt;DIV&gt;&lt;BR /&gt;&lt;BR /&gt;Ininitally I set it to get the parallel data from the DIP switch. The wierd this is if is do it as below&lt;BR /&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV class="j-rte-table"&gt;&lt;TABLE align="center" border="0" cellpadding="3" cellspacing="1" width="90%"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD style="border:0px solid black;"&gt;&lt;SPAN class="genmed"&gt;&lt;STRONG&gt;Code:&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="code" style="border:0px solid black;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;bset&amp;nbsp; PARSERSEL,PORTC&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; jsr&amp;nbsp; &amp;nbsp;i2del&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; bclr&amp;nbsp; &amp;nbsp;PARSERSEL,PORTC&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;SPAN class="postbody"&gt;&lt;/SPAN&gt;&lt;DIV&gt;&lt;BR /&gt;I will miss the 1st data. I've to remain the PARSERSEL set till the entire process completed then clr it. In this case then I will only be able to get the entire set of data from the DIP switch.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;another thing i don't understand is&lt;BR /&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV class="j-rte-table"&gt;&lt;TABLE align="center" border="0" cellpadding="3" cellspacing="1" width="90%"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD style="border:0px solid black;"&gt;&lt;SPAN class="genmed"&gt;&lt;STRONG&gt;Code:&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="code" style="border:0px solid black;"&gt;&lt;BR /&gt;BRSET I2CSDA,PORTH,$+3 ; Set/clear carry&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;SPAN class="postbody"&gt;&lt;/SPAN&gt;&lt;DIV&gt;&lt;BR /&gt;&lt;BR /&gt;As i'm using codewarrior compiler It couldn't recognise the $+3. I'm not sure about its operation. Could you please explain to me?&lt;BR /&gt;&lt;BR /&gt;basically I found that the example code you gave me is far more efficient than mine. lol... thanks for the help man!&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN class="postdetails"&gt;&lt;STRONG&gt;Posted: Tue Sep 27, 2005 3:16 pm&lt;SPAN class="gen"&gt;&amp;nbsp;&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN class="postdetails"&gt;&lt;/SPAN&gt;&amp;nbsp;&lt;/DIV&gt;&lt;SPAN class="postdetails"&gt;&lt;/SPAN&gt;&lt;DIV&gt;&lt;DIV class="j-rte-table"&gt;&lt;TABLE align="center" border="0" cellpadding="3" cellspacing="1" width="90%"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD style="border:0px solid black;"&gt;&lt;SPAN class="genmed"&gt;&lt;STRONG&gt;Quote:&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="quote" style="border:0px solid black;"&gt;&lt;BR /&gt;Ininitally I set it to get the parallel data from the DIP switch. The wierd this is if is do it as below&lt;BR /&gt;&lt;TABLE align="center" border="0" cellpadding="3" cellspacing="1" width="90%"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD style="border:0px solid black;"&gt;&lt;SPAN class="genmed"&gt;&lt;STRONG&gt;Code:&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="code" style="border:0px solid black;"&gt;&amp;nbsp;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;bset&amp;nbsp; PARSERSEL,PORTC&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;jsr&amp;nbsp; &amp;nbsp;i2del&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;bclr&amp;nbsp; PARSERSEL,PORTC&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;SPAN class="postbody"&gt;&lt;BR /&gt;I will miss the 1st data. I've to remain the PARSERSEL set till the entire process completed then clr it. In this case then I will only be able to get the entire set of data from the DIP switch.&lt;BR /&gt;&lt;/SPAN&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;SPAN class="postbody"&gt;&lt;/SPAN&gt;&lt;DIV&gt;&lt;BR /&gt;In the code example I gave previously, I was assuming that PARSERSEL would be set high during initialisation, and set low only during the serial data transfer. However, pulsing PARSERSEL high just prior to the serial operation should be equally valid, provided it remains low during during the serial transfer.&lt;BR /&gt;&lt;BR /&gt;Are you saying that this did not work? When you refer to "miss the 1st data", do you mean the first data &lt;SPAN style="TEXT-DECORATION: underline;"&gt;bit&lt;/SPAN&gt;? If so, it is probably because your initial subroutine sent a clock pulse prior to reading the state of Q8. My sample routine reads the bit state before generating the first clock pulse.&lt;BR /&gt;&lt;BR /&gt;Keep in mind that, if the ON state of each switch grounds its input (you are using pull-up resistors), the data byte will be negated. Maybe this is causing some confusion.&lt;BR /&gt;&lt;BR /&gt;Holding PARSERSEL high during the serial transfer would cause the state of the switch at the P8 position to fill the whole byte.&lt;BR /&gt;&lt;BR /&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV class="j-rte-table"&gt;&lt;TABLE align="center" border="0" cellpadding="3" cellspacing="1" width="90%"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD style="border:0px solid black;"&gt;&lt;SPAN class="genmed"&gt;&lt;STRONG&gt;Quote:&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="quote" style="border:0px solid black;"&gt;&lt;BR /&gt;another thing i don't understand is&lt;BR /&gt;&lt;TABLE align="center" border="0" cellpadding="3" cellspacing="1" width="90%"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD style="border:0px solid black;"&gt;&lt;SPAN class="genmed"&gt;&lt;STRONG&gt;Code:&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="code" style="border:0px solid black;"&gt;&amp;nbsp;&lt;BR /&gt;BRSET I2CSDA,PORTH,$+3 ; Set/clear carry&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;SPAN class="postbody"&gt;&lt;BR /&gt;As i'm using codewarrior compiler It couldn't recognise the $+3. I'm not sure about its operation. Could you please explain to me?&lt;BR /&gt;&lt;/SPAN&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;SPAN class="postbody"&gt;&lt;/SPAN&gt;&lt;DIV&gt;&lt;BR /&gt;Sorry about that. I am using the P&amp;amp;E assembler, and it interprets the dollar sign here as "the current program counter value" (at the start of the instruction). Since the BRSET instruction is three bytes long, "$+3" represents the start of the next (ROLA) instruction.&lt;BR /&gt;&lt;BR /&gt;You will need to place a label preceeding the next instruction, and branch to that label. Since the BRSET instruction is only being used to set or clear the carry flag, we need to end up at the next instruction whether or not the branch is taken.&lt;BR /&gt;&lt;BR /&gt;I hope this clarifies the situation.&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN class="postdetails"&gt;&lt;STRONG&gt;Posted: Wed Sep 28, 2005 3:18 pm&lt;/STRONG&gt;&lt;SPAN class="gen"&gt;&amp;nbsp;&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN class="postdetails"&gt;&lt;/SPAN&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN class="postdetails"&gt;&lt;SPAN class="postbody"&gt;Now i understand the whole picture. Thanks a lot man... appreciate you help along the way... &lt;A href="http://www.freegeeks.net/modules/Forums/images/smiles/icon_biggrin.gif"&gt;&lt;IMG alt="Very Happy" border="0" src="http://www.freegeeks.net/modules/Forums/images/smiles/icon_biggrin.gif" /&gt;&lt;/A&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 25 Jan 2006 00:27:38 GMT</pubDate>
    <dc:creator>RChapman</dc:creator>
    <dc:date>2006-01-25T00:27:38Z</dc:date>
    <item>
      <title>newbie [help] interfacing HC08 with CD4021BCN</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/newbie-help-interfacing-HC08-with-CD4021BCN/m-p/123920#M68</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;&lt;SPAN style="color: #ff0000;"&gt;This message contains an entire topic ported from a separate forum. The original message and all replies are in this single message. We have seeded this new forum with selected information that we expect will be of value to you as you search for answers to your questions.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN class="postdetails"&gt;&lt;STRONG&gt;Posted: Sun Sep 25, 2005 1:56 am&lt;/STRONG&gt;&lt;SPAN class="gen"&gt;&amp;nbsp;&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN class="postdetails"&gt;&lt;/SPAN&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN class="postdetails"&gt;&lt;SPAN class="postbody"&gt;Hi, I'm using a HC08ab32 connected to a 8-Stage Static Shift Register&lt;BR /&gt; CD4021BCN serially. The Shift register is connected to a DIP switch. I&lt;BR /&gt; wanted to get the parallel-in data from the DIP switch. Do i need to&lt;BR /&gt; do it using the i2c method or other method? are there any example out&lt;BR /&gt; there for me to refer to? Thank you.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN class="postdetails"&gt;&lt;SPAN class="postbody"&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN class="postdetails"&gt;&lt;SPAN class="postbody"&gt;&lt;SPAN class="postdetails"&gt;&lt;SPAN class="postdetails"&gt;&lt;STRONG&gt;Posted: Sun Sep 25, 2005 1:30 pm&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN class="postdetails"&gt;&lt;SPAN class="postbody"&gt;&lt;SPAN class="postdetails"&gt;&lt;SPAN class="postdetails"&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN class="postdetails"&gt;&lt;SPAN class="postbody"&gt;&lt;SPAN class="postdetails"&gt;&lt;SPAN class="postdetails"&gt;To interface with the 4021 shift register device, you will need to use the Serial Peripheral Interface (SPI) facility within the 908. The 908 will be the master, and the shift register the slave.&lt;BR /&gt;&lt;BR /&gt; The Q8 output at pin 3 will connect to MISO, and the clock input at pin 10 will connect to SPSCK. You will also need to allocate an output from general purpose I/O to connect to pin 9 of the shift register, to provide a serial select signal. Connect the serial input at pin 11 to ground. You will need to decide whether the DIP switches should pull their inputs high or low when active, and provide either pull-down or pull-up resistors.&lt;BR /&gt;&lt;BR /&gt; Note that the MOSI pin on the 908 will not be used for this application, and the /SS pin would be configured for general I/O. For the 4021 device operating at 5 volts, the SPI clock rate may not exceed 2.5 MHz.&lt;BR /&gt;&lt;BR /&gt; During the initialisation routine for the 908 you will need to set the SPCR and SPSCR registers to suitable values. I assume that you would use a polling process (rather than interrupt) to access the DIP switch data, so I believe appropriate values would be:&lt;BR /&gt;&lt;BR /&gt; MOV #$32,SPCR&lt;BR /&gt; MOV #$01,SPSCR&lt;BR /&gt;&lt;BR /&gt; Look in the data sheet to see what each bit in these registers controls. To read the DIP switch data you will need to:&lt;BR /&gt;&lt;BR /&gt; 1. Set serial select output low using a BCLR instruction.&lt;BR /&gt; 2. Write a dummy value to the SPDR register.&lt;BR /&gt; 3. Wait for bit-7 of SPSCR to become set, to indicate new data in the receive buffer.&lt;BR /&gt; 4. Read the SPDR register for the current DIP switch data.&lt;BR /&gt; 5. Set serial select output high using BSET instruction.&lt;BR /&gt;&lt;BR /&gt; BCLR SSEL,PTx&lt;BR /&gt; STA SPDR&lt;BR /&gt; BRCLR 7,SPSCR,$ ; Wait while bit is low&lt;BR /&gt; LDA SPDR ; DIP switch data in ACC&lt;BR /&gt; BSET SSEL,PTx&lt;BR /&gt;&lt;BR /&gt; I hope this helps.&lt;BR /&gt;&lt;BR /&gt; Regards,&lt;BR /&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN class="postdetails"&gt;&lt;SPAN class="postbody"&gt;&lt;SPAN class="postdetails"&gt;&lt;SPAN class="postdetails"&gt;&lt;SPAN class="postdetails"&gt;&lt;STRONG&gt;Posted: Mon Sep 26, 2005 5:29 am&lt;SPAN class="gen"&gt;&amp;nbsp;&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN class="postdetails"&gt;&lt;SPAN class="postbody"&gt;&lt;SPAN class="postdetails"&gt;&lt;SPAN class="postdetails"&gt;&lt;SPAN class="postdetails"&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN class="postdetails"&gt;&lt;SPAN class="postbody"&gt;&lt;SPAN class="postdetails"&gt;&lt;SPAN class="postdetails"&gt;&lt;SPAN class="postdetails"&gt;Hi .. thanks for the reply, but I'm facing another problem that my SPI port is already used up. I only have i/o ports connected to the 4021. Can i still do it by using the i/o ports to manipulate it? thanks.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN class="postdetails"&gt;&lt;SPAN class="postbody"&gt;&lt;SPAN class="postdetails"&gt;&lt;SPAN class="postdetails"&gt;&lt;SPAN class="postdetails"&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN class="postdetails"&gt;&lt;SPAN class="postbody"&gt;&lt;SPAN class="postdetails"&gt;&lt;SPAN class="postdetails"&gt;&lt;SPAN class="postdetails"&gt;&lt;SPAN class="postdetails"&gt;&lt;STRONG&gt;Posted: Mon Sep 26, 2005 10:14 am&lt;/STRONG&gt;&lt;SPAN class="gen"&gt;&amp;nbsp;&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN class="postdetails"&gt;&lt;SPAN class="postbody"&gt;&lt;SPAN class="postdetails"&gt;&lt;SPAN class="postdetails"&gt;&lt;SPAN class="postdetails"&gt;&lt;SPAN class="postdetails"&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN class="postdetails"&gt;&lt;SPAN class="postbody"&gt;&lt;SPAN class="postdetails"&gt;&lt;SPAN class="postdetails"&gt;&lt;SPAN class="postdetails"&gt;&lt;SPAN class="postdetails"&gt;Hi.. I've come out with a solution. It seems to work. Efficiency I'm not very sure. Due to lack of SPI port.. I used i/o port for this. Here is my code.&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV class="j-rte-table"&gt;&lt;TABLE align="center" border="0" cellpadding="3" cellspacing="1" width="90%"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD style="border:0px solid black;"&gt;&lt;SPAN class="genmed"&gt;&lt;STRONG&gt;Code:&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="code" style="border:0px solid black;"&gt;&lt;BR /&gt;chkaddr&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; bclr&amp;nbsp; I2CSDA,DDRH&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;bset&amp;nbsp; PARSERSEL,PORTC&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;jsr&amp;nbsp; &amp;nbsp;i2del&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;mov&amp;nbsp; &amp;nbsp;#$08,BITCNT&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;BR /&gt;chkaddr1&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;bset&amp;nbsp; I2CSCL,PORTC&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;jsr&amp;nbsp; &amp;nbsp;i2del&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;lda&amp;nbsp; &amp;nbsp;PORTH&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;and&amp;nbsp; &amp;nbsp;#$01&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;ora&amp;nbsp; &amp;nbsp;CARDADDR&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;sta&amp;nbsp; &amp;nbsp;CARDADDR&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;lda&amp;nbsp; &amp;nbsp;BITCNT&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;cmp&amp;nbsp; &amp;nbsp;#$01&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;beq&amp;nbsp; &amp;nbsp;chkaddr2&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;asl&amp;nbsp; &amp;nbsp;CARDADDR&lt;BR /&gt;chkaddr2&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;bclr&amp;nbsp; I2CSCL,PORTC&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;jsr&amp;nbsp; &amp;nbsp;i2del&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;bclr&amp;nbsp; PARSERSEL,PORTC&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;dec&amp;nbsp; &amp;nbsp;BITCNT&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;bne&amp;nbsp; &amp;nbsp;chkaddr1&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;rts&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;SPAN class="postbody"&gt;&lt;/SPAN&gt;&lt;DIV&gt;&lt;BR /&gt;Are there any room to improve it? thanks.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN class="postdetails"&gt;&lt;STRONG&gt;Posted: Mon Sep 26, 2005 1:39 pm&lt;/STRONG&gt;&lt;SPAN class="gen"&gt;&amp;nbsp;&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN class="postdetails"&gt;&lt;/SPAN&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN class="postdetails"&gt;Be aware that the SPI port can usually be shared with multiple serial peripherals, so to say it is "used up" may not necessarily be true.&lt;BR /&gt;&lt;BR /&gt; There are two possible aproaches to expanding the use of the SPI. Of course there is also the "bit banging" approach that will also work, but will consume more of the spare I/O, and will occupy many more bus cycles.&lt;BR /&gt;&lt;BR /&gt; 1. You may daisy-chain the shift register with other serial output shift registers, to increase the length of the chain. This requires that the other device has a serial input for expansion purposes.&lt;BR /&gt;&lt;BR /&gt; 2. You may connect a parallel shift register chain. In this case, each slave chain would have a separate slave select (SS) input that would cause its output to MISO to be high impedance when inactive. In your case, a different device would be necessary, such as the 74HC589 shift register.&lt;BR /&gt;&lt;BR /&gt; To comment on your suggested "bit-banging" code - I will assume the following usage:&lt;BR /&gt; PARSERSEL,PORTC connects to pin 9 of the S/R,&lt;BR /&gt; I2CSDA is at 0,PORTH and is used as data input from the S/R,&lt;BR /&gt; I2CSCL,PORTC is your clock output,&lt;BR /&gt; Sub-routine 'i2del' provides a few cycles delay (and preserves the state of X and ACC).&lt;BR /&gt;&lt;BR /&gt; a) According to my data book, the 4021 is in serial mode when PARSERSEL is low - but you set it high prior to the serial transaction, and set it low afterwards. This would seem to prevent the S/R from shifting the data out.&lt;BR /&gt;&lt;BR /&gt; b) To test the state of a single bit within a register, be aware that the BRSET and BRCLR instructions set the carry flag in accordance with the current state of the bit. This can result in a significant simplification of the code.&lt;BR /&gt;&lt;BR /&gt; c) You will need to test the bit state prior to the first shift clock, otherwise you will lose the first (most significant) bit from the S/R.&lt;BR /&gt;&lt;BR /&gt; d) There are other minor variations that improve speed or code efficiency, e.g. use X register for your bit count, use ACC for your data byte, and utilise the DBNZ instruction for the loop.&lt;BR /&gt;&lt;BR /&gt; The modified routine might look like the following:&lt;BR /&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV class="j-rte-table"&gt;&lt;TABLE align="center" border="0" cellpadding="3" cellspacing="1" width="90%"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD style="border:0px solid black;"&gt;&lt;SPAN class="genmed"&gt;&lt;STRONG&gt;Code:&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="code" style="border:0px solid black;"&gt;&lt;BR /&gt;CHKADDR: BCLR&amp;nbsp; I2CSDA,DDRH&amp;nbsp; &amp;nbsp; &amp;nbsp;; This should really be part of POR initialisation&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;BCLR&amp;nbsp; I2CSCL,PORTC&amp;nbsp; &amp;nbsp; ; Initialise clock state&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;BCLR&amp;nbsp; PARSERSEL,PORTC ; Serial mode for S/R&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;LDX&amp;nbsp; &amp;nbsp;#8&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ; Bit count value&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;BR /&gt;CHK1:&amp;nbsp; &amp;nbsp; BRSET I2CSDA,PORTH,$+3 ; Set/clear carry&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;ROLA&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ; store bit state&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;BSET&amp;nbsp; I2CSCL,PORTC&amp;nbsp; &amp;nbsp; ; Generate clock pulse&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;JSR&amp;nbsp; &amp;nbsp;i2del&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;; small delay&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;BCLR&amp;nbsp; I2CSCL,PORTC&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;DBNZX CHK1&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ; Loop for next bit&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;STA&amp;nbsp; &amp;nbsp;CARDADDR&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;BSET&amp;nbsp; PARSERSEL,PORTC ; Return S/R to parallel mode&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;RTS&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;SPAN class="postbody"&gt;&lt;/SPAN&gt;&lt;DIV&gt;&lt;BR /&gt;&lt;BR /&gt;I hope this is of assistance to you.&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN class="postdetails"&gt;&lt;STRONG&gt;Posted: Tue Sep 27, 2005 2:37 am&lt;/STRONG&gt;&lt;SPAN class="gen"&gt;&amp;nbsp;&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN class="postdetails"&gt;&lt;/SPAN&gt;&amp;nbsp;&lt;/DIV&gt;&lt;SPAN class="postdetails"&gt;&lt;/SPAN&gt;&lt;DIV&gt;&lt;DIV class="j-rte-table"&gt;&lt;TABLE align="center" border="0" cellpadding="3" cellspacing="1" width="90%"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD style="border:0px solid black;"&gt;&lt;SPAN class="genmed"&gt;&lt;STRONG&gt;Quote:&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="quote" style="border:0px solid black;"&gt;a) According to my data book, the 4021 is in serial mode when PARSERSEL is low - but you set it high prior to the serial transaction, and set it low afterwards. This would seem to prevent the S/R from shifting the data out.&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;SPAN class="postbody"&gt;&lt;/SPAN&gt;&lt;DIV&gt;&lt;BR /&gt;&lt;BR /&gt;Ininitally I set it to get the parallel data from the DIP switch. The wierd this is if is do it as below&lt;BR /&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV class="j-rte-table"&gt;&lt;TABLE align="center" border="0" cellpadding="3" cellspacing="1" width="90%"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD style="border:0px solid black;"&gt;&lt;SPAN class="genmed"&gt;&lt;STRONG&gt;Code:&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="code" style="border:0px solid black;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;bset&amp;nbsp; PARSERSEL,PORTC&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; jsr&amp;nbsp; &amp;nbsp;i2del&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; bclr&amp;nbsp; &amp;nbsp;PARSERSEL,PORTC&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;SPAN class="postbody"&gt;&lt;/SPAN&gt;&lt;DIV&gt;&lt;BR /&gt;I will miss the 1st data. I've to remain the PARSERSEL set till the entire process completed then clr it. In this case then I will only be able to get the entire set of data from the DIP switch.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;another thing i don't understand is&lt;BR /&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV class="j-rte-table"&gt;&lt;TABLE align="center" border="0" cellpadding="3" cellspacing="1" width="90%"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD style="border:0px solid black;"&gt;&lt;SPAN class="genmed"&gt;&lt;STRONG&gt;Code:&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="code" style="border:0px solid black;"&gt;&lt;BR /&gt;BRSET I2CSDA,PORTH,$+3 ; Set/clear carry&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;SPAN class="postbody"&gt;&lt;/SPAN&gt;&lt;DIV&gt;&lt;BR /&gt;&lt;BR /&gt;As i'm using codewarrior compiler It couldn't recognise the $+3. I'm not sure about its operation. Could you please explain to me?&lt;BR /&gt;&lt;BR /&gt;basically I found that the example code you gave me is far more efficient than mine. lol... thanks for the help man!&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN class="postdetails"&gt;&lt;STRONG&gt;Posted: Tue Sep 27, 2005 3:16 pm&lt;SPAN class="gen"&gt;&amp;nbsp;&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN class="postdetails"&gt;&lt;/SPAN&gt;&amp;nbsp;&lt;/DIV&gt;&lt;SPAN class="postdetails"&gt;&lt;/SPAN&gt;&lt;DIV&gt;&lt;DIV class="j-rte-table"&gt;&lt;TABLE align="center" border="0" cellpadding="3" cellspacing="1" width="90%"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD style="border:0px solid black;"&gt;&lt;SPAN class="genmed"&gt;&lt;STRONG&gt;Quote:&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="quote" style="border:0px solid black;"&gt;&lt;BR /&gt;Ininitally I set it to get the parallel data from the DIP switch. The wierd this is if is do it as below&lt;BR /&gt;&lt;TABLE align="center" border="0" cellpadding="3" cellspacing="1" width="90%"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD style="border:0px solid black;"&gt;&lt;SPAN class="genmed"&gt;&lt;STRONG&gt;Code:&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="code" style="border:0px solid black;"&gt;&amp;nbsp;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;bset&amp;nbsp; PARSERSEL,PORTC&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;jsr&amp;nbsp; &amp;nbsp;i2del&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;bclr&amp;nbsp; PARSERSEL,PORTC&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;SPAN class="postbody"&gt;&lt;BR /&gt;I will miss the 1st data. I've to remain the PARSERSEL set till the entire process completed then clr it. In this case then I will only be able to get the entire set of data from the DIP switch.&lt;BR /&gt;&lt;/SPAN&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;SPAN class="postbody"&gt;&lt;/SPAN&gt;&lt;DIV&gt;&lt;BR /&gt;In the code example I gave previously, I was assuming that PARSERSEL would be set high during initialisation, and set low only during the serial data transfer. However, pulsing PARSERSEL high just prior to the serial operation should be equally valid, provided it remains low during during the serial transfer.&lt;BR /&gt;&lt;BR /&gt;Are you saying that this did not work? When you refer to "miss the 1st data", do you mean the first data &lt;SPAN style="TEXT-DECORATION: underline;"&gt;bit&lt;/SPAN&gt;? If so, it is probably because your initial subroutine sent a clock pulse prior to reading the state of Q8. My sample routine reads the bit state before generating the first clock pulse.&lt;BR /&gt;&lt;BR /&gt;Keep in mind that, if the ON state of each switch grounds its input (you are using pull-up resistors), the data byte will be negated. Maybe this is causing some confusion.&lt;BR /&gt;&lt;BR /&gt;Holding PARSERSEL high during the serial transfer would cause the state of the switch at the P8 position to fill the whole byte.&lt;BR /&gt;&lt;BR /&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV class="j-rte-table"&gt;&lt;TABLE align="center" border="0" cellpadding="3" cellspacing="1" width="90%"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD style="border:0px solid black;"&gt;&lt;SPAN class="genmed"&gt;&lt;STRONG&gt;Quote:&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="quote" style="border:0px solid black;"&gt;&lt;BR /&gt;another thing i don't understand is&lt;BR /&gt;&lt;TABLE align="center" border="0" cellpadding="3" cellspacing="1" width="90%"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD style="border:0px solid black;"&gt;&lt;SPAN class="genmed"&gt;&lt;STRONG&gt;Code:&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="code" style="border:0px solid black;"&gt;&amp;nbsp;&lt;BR /&gt;BRSET I2CSDA,PORTH,$+3 ; Set/clear carry&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;SPAN class="postbody"&gt;&lt;BR /&gt;As i'm using codewarrior compiler It couldn't recognise the $+3. I'm not sure about its operation. Could you please explain to me?&lt;BR /&gt;&lt;/SPAN&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;SPAN class="postbody"&gt;&lt;/SPAN&gt;&lt;DIV&gt;&lt;BR /&gt;Sorry about that. I am using the P&amp;amp;E assembler, and it interprets the dollar sign here as "the current program counter value" (at the start of the instruction). Since the BRSET instruction is three bytes long, "$+3" represents the start of the next (ROLA) instruction.&lt;BR /&gt;&lt;BR /&gt;You will need to place a label preceeding the next instruction, and branch to that label. Since the BRSET instruction is only being used to set or clear the carry flag, we need to end up at the next instruction whether or not the branch is taken.&lt;BR /&gt;&lt;BR /&gt;I hope this clarifies the situation.&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN class="postdetails"&gt;&lt;STRONG&gt;Posted: Wed Sep 28, 2005 3:18 pm&lt;/STRONG&gt;&lt;SPAN class="gen"&gt;&amp;nbsp;&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN class="postdetails"&gt;&lt;/SPAN&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN class="postdetails"&gt;&lt;SPAN class="postbody"&gt;Now i understand the whole picture. Thanks a lot man... appreciate you help along the way... &lt;A href="http://www.freegeeks.net/modules/Forums/images/smiles/icon_biggrin.gif"&gt;&lt;IMG alt="Very Happy" border="0" src="http://www.freegeeks.net/modules/Forums/images/smiles/icon_biggrin.gif" /&gt;&lt;/A&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Jan 2006 00:27:38 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/newbie-help-interfacing-HC08-with-CD4021BCN/m-p/123920#M68</guid>
      <dc:creator>RChapman</dc:creator>
      <dc:date>2006-01-25T00:27:38Z</dc:date>
    </item>
  </channel>
</rss>

