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

    You can put them in your program, or you can edit them in PBP files. Either way, you will have to go to your PBP files, and find the one specific to your chip. Look for the 16f690.inc file, and either edit, or comment out the line

    Code:
    ;        __config _INTRC_OSC_NOCLKOUT & _WDT_ON & _MCLRE_ON & _CP_OFF
            __config _HS_OSC & _WDT_ON & _MCLRE_OFF & _CP_OFF
    It is easiest to just to comment it out, then copy and paste it back into the same file with your changes. That way you will be able to go back to the default. Many people prefer to comment it out in this file, then put it into their PBP code. To to this, you would add a line at the top of your program, like this:

    Code:
    @        __CONFIG _INTRC_OSC_NOCLKOUT & _WDT_ON & _MCLRE_OFF & _CP_OFF
    See http://www.picbasic.co.uk/forum/showthread.php?t=543 for a more in depth look

  2. #2
    Join Date
    Apr 2010
    Posts
    21


    Did you find this post helpful? Yes | No

    Default

    Okey so still working on this. i have registred that the rb5 is reciving something, what i dont know.

    So i looked at the max232 sheet and it says there should be a +10v on port 2 and -10v on port 6 but im reading -2.3 and +6.5 could that be the reson?

  3. #3
    malc-c's Avatar
    malc-c Guest


    Did you find this post helpful? Yes | No

    Default

    Can you provide details of the computer you are hooking this up to. Some laptops don't have enough "umph" to provide the voltages required when using PIC programmers, so it might be the same with the project your are working on.

  4. #4
    Join Date
    Apr 2010
    Posts
    21


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by malc-c View Post
    Can you provide details of the computer you are hooking this up to. Some laptops don't have enough "umph" to provide the voltages required when using PIC programmers, so it might be the same with the project your are working on.
    it's an self built desktop. with asus p6d motherboard and it should do the trick. but i have an pci serial with power options for setting up to 4 pins to 5 or 12 v.

    but i see that the voltage from the pickit is 4.8 maybe i should connect an ext pw sup?

    it's irritating because this should be such a small case and iv been stuck at this since like friday.

    And to all Thx for all the help so far!

  5. #5
    Join Date
    Apr 2010
    Posts
    21


    Did you find this post helpful? Yes | No

    Default

    Now i have tried external pw and still no go. the pics sends fine, but wont recive. I have no other ideas left.

    other than if the voltage on pin 2 and 6 on the max is +6 and -2 but should be +10 nad -10. what am i doing wrong?

  6. #6
    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

  7. #7
    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.

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