how do I get a byte out of two 6 bit wide ports.


Closed Thread
Results 1 to 2 of 2
  1. #1
    kitcat's Avatar
    kitcat Guest

    Default how do I get a byte out of two 6 bit wide ports.

    Hi.
    I am about to use a PIC16F688 which is a 14 pin package. Porta and Portc are only 6 bits wide. I want to count pulses on a pin (such as porta.0) and send the result to portc. Unfortunately the number is goign to end up at about 100 so I need a 7 bit wide port. I also want to use another pin to toggle to signify that a count has taken place (simply changing the state high or low on each count command).
    So how do I combine two ports to write out a byte?

    Thanks

  2. #2
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    MyByte = 255

    PORTC = Mybyte
    PORTA.0 = MyByte.6
    PORTA.1 = MyByte.7
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

Similar Threads

  1. Bits, Bytes Words and Arrays
    By Melanie in forum FAQ - Frequently Asked Questions
    Replies: 24
    Last Post: - 14th June 2016, 07:55
  2. LCD freeze
    By harryweb in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 5th October 2009, 08:01
  3. byte compression
    By Norbert in forum mel PIC BASIC Pro
    Replies: 6
    Last Post: - 16th June 2007, 18:04
  4. Microcontroller with 2 way paging application problem
    By oneohthree in forum mel PIC BASIC Pro
    Replies: 30
    Last Post: - 20th April 2007, 17:27
  5. 16F877 RAM Question
    By Art in forum mel PIC BASIC Pro
    Replies: 8
    Last Post: - 6th August 2005, 11:47

Members who have read this thread : 0

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