Same code in different Pins


Results 1 to 32 of 32

Threaded View

  1. #15
    Join Date
    Feb 2003
    Posts
    432


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Darrel Taylor View Post
    Then you would change the PORTL and or PORTH assignments in the .bas file for the chip you are using.

    PORTL and PORTH determine which ports are used for "Pin Numbers".
    PORTL is 0-7
    PORTH is 8-15
    <br>
    Hi Darrel,

    I have looked in the .bas file for the 18F452 and located the following code
    Code:
    PORTL   VAR     PORTB
    PORTH   VAR     PORTC
    TRISL   VAR     TRISB
    TRISH   VAR     TRISC
    Would I be correct in assuming that you also have to "adjust" the TRISL and TRISH aliases as well?

    I take it that the ports dont have to be consecutive so that I could put

    Code:
    PORTL   VAR     PORTB
    PORTH   VAR     PORTD
    TRISL   VAR     TRISB
    TRISH   VAR     TRISD
    Which would give me 0-7 = PortB.0-PortB.7 and 8-15 = PortD.0-PortD.7

    If so that greatly simplifies something I am trying to impliment. The reason I want to change PORTH from C to D is that I need to use the USART which is on C6 and C7 so that would only give me 14 useable pins.


    DOH !!!!

    Thatll teach me not to make sure I have a newly refreshed view of a thread before I post a reply !!!!
    Last edited by keithdoxey; - 27th March 2007 at 20:37. Reason: Explaining why I look like a Dumba$$
    Keith

    www.diyha.co.uk
    www.kat5.tv

Similar Threads

  1. My code for TV remote and MIBAM for RGB control
    By idtat in forum Code Examples
    Replies: 4
    Last Post: - 12th January 2013, 20:52
  2. Nokia COLOR LCD PicBasicPro 2.50a example code
    By skimask in forum Code Examples
    Replies: 49
    Last Post: - 28th September 2011, 01:43
  3. Reading in Manchester code
    By brid0030 in forum Code Examples
    Replies: 0
    Last Post: - 10th March 2009, 21:55
  4. Another RTC, DS1287
    By DavidK in forum Code Examples
    Replies: 0
    Last Post: - 12th December 2006, 17:07
  5. Re-Writing IF-THEN-AND-ENDIF code?
    By jessey in forum mel PIC BASIC Pro
    Replies: 6
    Last Post: - 18th August 2006, 17:23

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