Help with pic16f690 -max232cpe


Closed Thread
Results 1 to 37 of 37

Hybrid View

  1. #1
    Join Date
    Feb 2006
    Location
    Gilroy, CA
    Posts
    1,530


    Did you find this post helpful? Yes | No

    Default

    Can you post your entire code with the trisb and all ... plus whatever code you are using to determine it is not receiving.

    Thanks,

    Walter

  2. #2
    Join Date
    Apr 2010
    Posts
    21


    Did you find this post helpful? Yes | No

    Default

    Code:
    DEFINE OSC 4
    
    ANSEL = %00000000 ' Pins to be Digital
    ANSELH = %00000000 ' Pins to be Digital
    TrisA = %00000000
    PortA = 0
    TrisB = %00100000 ' if the only input is pin 10 Rx
    PortB = 0
    TrisC = %00000000 ' if none of the portC pins are used
    PortC = 1
    
    CM1CON0 =0
    CM2CON0 =0
    CM2CON1 =0
    
    adcon1=0
    
    Include "modedefs.bas"
    
    DEFINE HSER_RCSTA	90h
    DEFINE HSER_TXSTA	24h 'sets bergh = 1 or 20h sets = 0
    'define HSER_BAUDCON 1h ' 0h
    DEFINE HSER_BAUD	2400 '16468
    DEFINE HSER_SPBRG	103
    DEFINE HSER_CLROERR 1
    rxVal Var word
    
    start:
    Hserout ["Hello World", 13, 10] ' Send text followed by carriage return and linef
    main:
    Hserin 10000,start,[rxVal] ' Get a char from serial port
    Hserout ["Got value:", rxVal] ' Send char out serial port
    pause 30
    goto main
    That's the code.

  3. #3
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default

    DEFINE HSER_RCSTA 90h ' Enable serial port & continuous receive
    DEFINE HSER_TXSTA 20h ' Enable transmit, BRGH = 0
    DEFINE HSER_SPBRG 25 ' 2400 Baud @ 0.17%
    DEFINE HSER_CLROERR 1 ' Clear overflow automatically

    The above should be for 4MHz.
    Can you also post your configs and what are you using for an OSC?
    Dave
    Always wear safety glasses while programming.

  4. #4
    Join Date
    Apr 2010
    Posts
    21


    Did you find this post helpful? Yes | No

    Default

    I have already tried that, so it's still a no go.

    But no one has commented on the voltage levels of the max. it should say 10 but i dont get it higher than 7. when i rebuild the whole shematics on the breadboard the voltage got i little better but still no higher than 7

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


    Did you find this post helpful? Yes | No

    Default

    But no one has commented on the voltage levels of the max. it should say 10 but i dont get it higher than 7. when i rebuild the whole shematics on the breadboard the voltage got i little better but still no higher than 7
    Check the capacitors used. See snap attached for value.

    Al.
    Attached Images Attached Images  
    All progress began with an idea

  6. #6
    Join Date
    Mar 2003
    Location
    Commerce Michigan USA
    Posts
    1,166


    Did you find this post helpful? Yes | No

    Default

    krise86, Depending on the capacitator values used with a MAX-232 the charge pump voltages should be around +-6 volts to +- 9 volts. The TRUE RS-232 spec calls out for mark,space voltages of +- 3 volts minimum... Some laptop computers now days do not meet the TRUE RS-232 spec limits as some only put 0 to +5 volts... That is why some laptop computers don't have a solid serial communications...

    Dave Purola,
    N8NTA

  7. #7
    Join Date
    Apr 2010
    Posts
    21


    Did you find this post helpful? Yes | No

    Default

    Yeah i am using 1uf caps, so it's not that. and i am reciving at this moment v- = -1.86 and v+ = 6.96.

    I found out that i can use the pickit 2 as logic analyzer. and i see the bytes roll inn when the pic send out to pc but not ther other way around.

    Im stumped... this sould work!
    I have followd all the guidelines and shematics and caps. i have also oredered some new max and pic's. also alot of caps and resistors. I really want this to work.

    Thx for all the help so far. i will get this to work! i hope

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