Help with pic16f690 -max232cpe


Closed Thread
Results 1 to 37 of 37

Hybrid View

  1. #1
    Join Date
    May 2008
    Location
    Italy
    Posts
    825


    Did you find this post helpful? Yes | No

    Default

    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

    Tray to replace your USART setting with the one given above.

    Al.
    All progress began with an idea

  2. #2
    Join Date
    Apr 2010
    Posts
    21


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by aratti View Post
    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

    Tray to replace your USART setting with the one given above.

    Al.
    Thx for replying, but i have tried that to. and still no go. when i change the usart settings to use 2400 bauds it wont work at all, then i just get alphas and numbers.

    can there be something wrong with my connections. iv tried with 2 max232 and same result. have i connected something wrong would this result in such an error.

    and one thing more, when i send a alpha, let's say "t" if i repeat that like 10 timer with 50ms pause i revice the correct letter back maybe once <- if i look a hserin and hserout

  3. #3
    Join Date
    May 2008
    Location
    Italy
    Posts
    825


    Did you find this post helpful? Yes | No

    Default

    What kind of terminal are you using?

    Can you post your wiring ?

    Al.
    All progress began with an idea

  4. #4
    Join Date
    Apr 2010
    Posts
    21


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by aratti View Post
    What kind of terminal are you using?

    Can you post your wiring ?

    Al.
    Well it looks like i found the probleme, i looked over the max232 data sheet and i frogot to connect vcc and gnd

    Now i recive the expected output but it wont read the input.

    Code:
    DEFINE OSC 4
    
    'intcon=0 ' Interrupts disabled
    cm1con0=0 ' Comparator 1 disabled
    cm2con0=0 ' Comparator 2 disabled
    'cm2con1=0 ' Comparator 2 disabled
    
    ANSEL=0 ' Pins to be Digital
    ANSELH=0 ' Pins to be Digital
    
    Include "modedefs.bas"
    
    DEFINE HSER_RCSTA	90h
    DEFINE HSER_TXSTA	24h 'sets bergh = 1 or 20h sets = 0
    'define HSER_BAUDCON 0h ' 0h
    'DEFINE HSER_BAUD	9600 '16468
    DEFINE HSER_SPBRG	25
    DEFINE HSER_CLROERR 1
    
    rxVal Var Byte
    HSEROUT ["Waitin signal"]
    main:
        hserin [rxVal]
        hserout [rxVal]
        'HSEROUT ["Test should work"]
        pause 20
    goto main
    Any ideas?

    And Thx for the help so far, sorry for not checking the schematics better
    and im using 232analyzer terminal software
    Last edited by krise86; - 18th April 2010 at 22:16.

  5. #5
    Join Date
    May 2008
    Location
    Italy
    Posts
    825


    Did you find this post helpful? Yes | No

    Default

    Can you post the schematic?

    Al.
    All progress began with an idea

  6. #6
    Join Date
    Apr 2010
    Posts
    21


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by aratti View Post
    Can you post the schematic?

    Al.

  7. #7
    Join Date
    May 2008
    Location
    Italy
    Posts
    825


    Did you find this post helpful? Yes | No

    Default

    Something doesn't work with your wiring:

    Max232 pin 10 should be connected to pic 16F690 pin 10 (RB7 Tx)

    Max232 pin 9 should be connected to pic 16F690 pin 12 (RB5 Rx)

    Connect a decoupling capacitor 10nF from Vdd to Vss on pic power pins.

    Al.
    All progress began with an idea

Members who have read this thread : 0

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

Tags for this Thread

Posting Permissions

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