16F628a to 16F873a


Closed Thread
Results 1 to 5 of 5

Hybrid View

  1. #1
    Join Date
    Jul 2003
    Posts
    2,405


    Did you find this post helpful? Yes | No

    Default

    Have you disabled the A/D module to use PORTA pins as digital?

    ADCON1 = 7
    Regards,

    -Bruce
    tech at rentron.com
    http://www.rentron.com

  2. #2
    Join Date
    Sep 2006
    Location
    Venezuela - Caracas
    Posts
    48


    Did you find this post helpful? Yes | No

    Default

    yes, ADCON1 = 7

    if i test simple code serin, serout work 100%,
    with my code i receive wrong caracters,
    in 16f628 work perfect

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


    Did you find this post helpful? Yes | No

    Default

    mmm, what happen if you do a simple test and use DEBUG instead of SEROUT. As you're using a 4MHZ clock, SEROUT may work or not.

    to me the built-in USART is always a better choice so far. and @4mhz, you'll end up with a nice error % -> 0.16%

    Code:
    DEFINE HSER_RCSTA 90h ' Enable serial port & continuous receive
    DEFINE HSER_TXSTA 24h ' Enable transmit, BRGH = 1
    DEFINE HSER_SPBRG 25  ' 9600 Baud @ 4MHz, 0.16%
    DEFINE HSER_CLROERR 1 ' Clear overflow automatically
    The main problem is that you'll have to change a little bit your actual setup... but...

    EDIT:
    Code:
    Data_Entrada      var   PORTC.1     '1
    Data_Saida        var   PORTC.1     '1
    Should they be on a different pin?
    Steve

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

  4. #4
    Join Date
    Sep 2006
    Location
    Venezuela - Caracas
    Posts
    48


    Did you find this post helpful? Yes | No

    Default

    my code is for TRW-24G
    Data_Entrada and Data_Saida is the same pin because TRW-24G use data and clock to send data


    shiftout Data_Entrada, Clock, MSBFIRST, [Dados_Enviados[i]\8]
    shiftout Data_Saida, Clock, MSBFIRST, [Dados_Enviados[i]\8]

Similar Threads

  1. boot loader for 16f628a ?
    By tdavis80 in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 5th January 2008, 02:07
  2. Are 16f628 and 16f628A difference each other?
    By elektrodam in forum mel PIC BASIC Pro
    Replies: 8
    Last Post: - 15th July 2006, 06:20
  3. MPLAB ICD ver 1 & 16F628A
    By Tissy in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 26th February 2005, 00:44
  4. new user with problem using PGP Pro, Lab-X3 with 16F628A
    By equipoise in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 28th July 2004, 07:42
  5. HSEROUT and 16F628A
    By fredblah in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 6th May 2004, 00:07

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