Trouble with 16F628's PORTA


Closed Thread
Results 1 to 5 of 5

Hybrid View

  1. #1
    SebastianO's Avatar
    SebastianO Guest


    Did you find this post helpful? Yes | No

    Default

    I already mentioned in my topic that I have disabled the comparators from the PORTA pins. CMCON = oxo7 isalready set by me.
    Any other sugestions?

  2. #2
    Join Date
    Oct 2003
    Location
    Australia
    Posts
    257


    Did you find this post helpful? Yes | No

    Question

    I don't quite follow your code, but anyways, have you set the TRISA register to all 1's?

    ie TRISA = 255

    J

  3. #3
    Join Date
    Nov 2005
    Posts
    14


    Did you find this post helpful? Yes | No

    Default PORTA prob as well... surprising solution

    I developed a pulse reader application on a 16F84A.. worked well.
    Needed the Timer1 function and compiled the code to a 16F628.
    Setup the ports as follows:-
    'Setup the hardware, define i/p and o/p
    define osc 4
    CMCON = 7 'turn comparators off
    VRCON = 0
    TRISB = 0 'set all PortB pins to outputs
    TRISA = %00000111 'set RA0, RA1 & RA2 to input, all other outputs
    I was using PortA1 for i/p and PortB4 for o/p on the 'F84A and after adding the CMCON and VRCON plugged in a 'F628 in lieu of the 'F84A.

    Didn't work !!

    Eventually, I found that if I reversed the i/p and o/p ports i.e PortA1 for o/p and PortB4 for i/p it worked.
    TRISB = 1
    TRISA = 0

    My theory is that it is the Schmitt trigger on A0-A5 is causing the issue. Don't see how, as yet, as the i/p is a clean squarewave from a signal generator (am testing on the bench at the moment).

    May give you a clue... and maybe someone has more info on this ?

Similar Threads

  1. error worring pbp247
    By chai98a in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 17th January 2010, 04:51
  2. PortA digita input?
    By MOUNTAIN747 in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 27th January 2009, 21:55
  3. PIC's ports individual bits manipulation - how to?
    By flotulopex in forum mel PIC BASIC Pro
    Replies: 38
    Last Post: - 27th February 2007, 22:34
  4. 16f876 PortA set-up trouble?
    By ronjodu in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 18th February 2006, 19:31
  5. Can anyone help a beginner in a struggle?
    By douglasjam in forum mel PIC BASIC
    Replies: 1
    Last Post: - 5th May 2005, 23:29

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