Is anybody familiar with PICBlock MC28AD-16


Closed Thread
Results 1 to 6 of 6
  1. #1
    Join Date
    Jul 2009
    Posts
    33

    Default Is anybody familiar with PICBlock MC28AD-16

    I have just ordered one of these i/o boards since it seems to be just what I need but I have realized that I may have bitten off more than I can chew since I am a bit of a novice. I will need to set the 16 open collector outputs based on UCN5841 serial latched drivers. Has anybody used these boards and therefore able to give me a shove in the right direction?

    Thanks

  2. #2
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959


    Did you find this post helpful? Yes | No

    Default

    Hi,

    I've never used that chip (or MC28AD-16) before.
    But looking at the datasheets, it should be pretty easy to do with the SHIFTOUT statement.

    Maybe something like this un-tested code, which if I got it right, should turn each output on one at a time for 1/2 second each ...
    Code:
    <font color="#008000"><b>DEFINE </b></font><b>OSC </b><font color="#800000"><b>4
    
    </b></font><font color="#008000"><b>INCLUDE </b></font><font color="#FF0000">&quot;AllDigital.pbp&quot;
    
    </font><b>SClk       </b><font color="#008000"><b>VAR </b></font><b>PORTC</b>.<font color="#800000"><b>3           </b></font><font color="#0000FF"><b><i>; synchronous serial clock pin
    </i></b></font><b>SDout      </b><font color="#008000"><b>VAR </b></font><b>PORTC</b>.<font color="#800000"><b>4           </b></font><font color="#0000FF"><b><i>;      &quot;        &quot;    data   &quot;
    </i></b></font><b>Strobe     </b><font color="#008000"><b>VAR </b></font><b>PORTC</b>.<font color="#800000"><b>5           </b></font><font color="#0000FF"><b><i>;      &quot;        &quot;    strobe &quot;
    </i></b></font><b>OutEnable  </b><font color="#008000"><b>VAR </b></font><b>PORTA</b>.<font color="#800000"><b>4           </b></font><font color="#0000FF"><b><i>;      &quot;        &quot;    output enable
    
    </i></b></font><b>OutData    </b><font color="#008000"><b>VAR WORD              </b></font><font color="#0000FF"><b><i>; 16-bit output state variable
    </i></b></font><b>LoopCount  </b><font color="#008000"><b>VAR BYTE
    
    </b></font><font color="#0000FF"><b><i>;----[Initialize the shift register]----------------------------------------
    </i></b></font><b>ShiftInit</b>:
        <font color="#008000"><b>HIGH </b></font><b>OutEnable               </b><font color="#0000FF"><b><i>; shift register outputs disabled
        </i></b></font><font color="#008000"><b>LOW  </b></font><b>Strobe                  </b><font color="#0000FF"><b><i>; Strobe idles LOW (active HIGH)
        </i></b></font><b>OutData </b>= <font color="#800000"><b>0            
        </b></font><font color="#008000"><b>GOSUB </b></font><b>SyncSend               </b><font color="#0000FF"><b><i>; clear the shift registers
        </i></b></font><font color="#008000"><b>LOW  </b></font><b>OutEnable               </b><font color="#0000FF"><b><i>; enable shift registers outputs
    
    ;----[The Main Loop]--------------------------------------------------------
    </i></b></font><b>Main</b>:
        <font color="#008000"><b>FOR </b></font><b>LoopCount </b>= <font color="#800000"><b>0 </b></font><font color="#008000"><b>to </b></font><font color="#800000"><b>15      </b></font><font color="#0000FF"><b><i>; loop thru all output channels
            </i></b></font><b>OutData </b>= <font color="#008000"><b>DCD </b></font><b>LoopCount  </b><font color="#0000FF"><b><i>;   set a single bit according to LoopCount
            </i></b></font><font color="#008000"><b>GOSUB </b></font><b>SyncSend           </b><font color="#0000FF"><b><i>;   send the data
            </i></b></font><font color="#008000"><b>PAUSE </b></font><font color="#800000"><b>500                </b></font><font color="#0000FF"><b><i>;   wait half a second
        </i></b></font><font color="#008000"><b>NEXT </b></font><b>LoopCount               </b><font color="#0000FF"><b><i>; do next output channel
    </i></b></font><font color="#008000"><b>GOTO </b></font><b>Main
    
    </b><font color="#0000FF"><b><i>;----[Send synchronous data]------------------------------------------------
    </i></b></font><b>SyncSend</b>:
        <font color="#008000"><b>SHIFTOUT  </b></font><b>SDout</b>, <b>SClk</b>, <font color="#800000"><b>1</b></font>,[<b>OutData</b>\<font color="#800000"><b>16</b></font>]
        <font color="#008000"><b>HIGH </b></font><b>Strobe                  </b><font color="#0000FF"><b><i>; strobe the shift registers latches
        </i></b></font>@ <b>NOP                        </b><font color="#0000FF"><b><i>; hold Strobe for 1uS
        </i></b></font><font color="#008000"><b>LOW </b></font><b>Strobe                   </b><font color="#0000FF"><b><i>; Strobe idles LOW
    </i></b></font><font color="#008000"><b>RETURN
    </b></font>
    HTH,
    DT

  3. #3
    Join Date
    Jun 2009
    Location
    Sc*nthorpe, UK
    Posts
    333


    Did you find this post helpful? Yes | No

    Default

    I have used these. The inputs are read by portB and the outputs are open collectors driven by PortC. Read portB for the inputs and set PortC for your outputs.

    Seems very simple to me unless I am missing something.

    Steve

  4. #4
    Join Date
    Jun 2009
    Location
    Sc*nthorpe, UK
    Posts
    333


    Did you find this post helpful? Yes | No

    Default

    Yes I missed something. I used the old version the MC28D which had only 8 inputs and 8 outputs.

    Steve

  5. #5
    Join Date
    Jul 2009
    Posts
    33


    Did you find this post helpful? Yes | No

    Default

    Well I don't know what happend to my response. I posted a thankyou yesterday and it seems to have dissapeared. You must have thought I was so rude. Thanks. It seems not too daunting.

  6. #6
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959


    Did you find this post helpful? Yes | No

    Default

    Ah Ha! You found our "Twilight Zone" section.
    You never know where they go.

    No problem.
    I figured you were just waiting till you received the board you ordered.

    Hope it works out for you.
    DT

Similar Threads

  1. 16 bit PWM using CCP1
    By Normnet in forum mel PIC BASIC Pro
    Replies: 60
    Last Post: - 27th August 2014, 09:13
  2. Funny PULSIN values: what is going on???
    By xnihilo in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 30th April 2008, 09:02
  3. writting code for a 16 X 16 Table
    By CrazyCooter in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 1st December 2006, 04:16
  4. 16 X 16 Table
    By CrazyCooter in forum mel PIC BASIC Pro
    Replies: 0
    Last Post: - 30th November 2006, 09:23
  5. How to tell which PICs can handle 16 bit variables?
    By MikeTamu in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 31st August 2005, 09:44

Members who have read this thread : 1

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts