Old and beyond help ?


Closed Thread
Results 1 to 40 of 47

Hybrid View

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


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by DavidFMarks View Post
    1. Can I use RA6 and RA7 as outputs if there is a xtal connected across them ( do not know what the DC characteristics of a xtal are)
    No , you will have to use the internal OSC.
    2. How the devil do I program the 16F887 so that those two pins are available as outputs. I understand that I have to set up the configuration word (register 1) so that bits 2 -0 are 100 which should set the two pins as available for I/O (subject to item 1 ((above)) But what is the syntax for doing this ? I see no rference in the Picbasic manual (or anywhere else) to this. I have looked at examples but cannot figure it out from that. Any advice on this would be appreciated
    Cheers
    Code:
    @__config _CONFIG1, _INTRC_OSC_NOCLKOUT & _WDT_ON & _MCLRE_OFF & _LVP_OFF & _CP_OFF
    So you did not like the shift registers?
    Dave
    Always wear safety glasses while programming.

  2. #2
    Join Date
    Dec 2007
    Location
    Northants England
    Posts
    38


    Did you find this post helpful? Yes | No

    Default

    Hi,
    I have set the oscillator to internat but since the crystal is already mounted on the 44 pin board I did not really want to remove it ! .. and yes I dis like the shift register idea but need more time to get my ancient brain around it and to obtain the chips ( Meanwhile Christmas lights are going up all round me !)

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


    Did you find this post helpful? Yes | No

    Default

    My board did not come with an external OSC mounted, I assumed yours did not also.

    I thought you were asking if the chip was running off the XT could the pins be used as an output.

    Is it Monday or something?
    Dave
    Always wear safety glasses while programming.

  4. #4
    Join Date
    Dec 2007
    Location
    Northants England
    Posts
    38


    Did you find this post helpful? Yes | No

    Default

    Sorry you are right, there is no crystal (it's my age) I still haven't figured out where the terms in your config expression come from. They are clearly assembler terms of some kind

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


    Did you find this post helpful? Yes | No

    Default

    Are you using PM or MPASAM for the assembler?
    If you are using MPASAM, ( my choice) goto program files,microchip,mpasamsuite and find the *.inc file for your chip. At or near the end of the file all of the different fuse settings are listed.

    http://www.picbasic.co.uk/forum/showthread.php?t=543
    Goes into more detail. Pay close attention to Melanie and Mister_E.

    If you are still unclear let us know.
    Dave
    Always wear safety glasses while programming.

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


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by DavidFMarks View Post
    (it's my age)
    How old are you???

    Look at my avatar. That is really me
    Dave
    Always wear safety glasses while programming.

  7. #7
    Join Date
    Dec 2007
    Location
    Northants England
    Posts
    38


    Did you find this post helpful? Yes | No

    Default

    Many thanks for that, Had a quick look at the link ..looks just the thing I wanted, Bit late to study now, bedtime & just got in from g daughters school musical. Age ? put it this way, Faraday hadn't satrted shaving when I got into this game and I aint going to seeing the good old three score years and ten again so its good to be helped by all you patient youngsters ! Thanks again !

  8. #8
    Join Date
    Dec 2007
    Location
    Northants England
    Posts
    38


    Did you find this post helpful? Yes | No

    Default

    Hi again,
    Got the porta I/O proble sorted insofar as i can now switch on any of the a port bits and light an led. Or so I thought, I wrote a program which switched on each bit of the port in turn held it with a pause 500 command and then switched it off and so on. When writing te Christmas star program I wrote simple code tp switch on all of the bits of PortA (they are each connected through Darlingtons to the - line of one of 16 arms (the other 8 are driven from portc by identical code (other than the port id). Now what happens is that only pins 4 6 and 8 remain high (leds lit). I have now written a separate little piece of code to test it. If I switch each pin on in turn pausing between each one (but not switching them off ) then led 0 switches on and after the specified delay it switches off and the next one comes on. only when I get to pins 4 6 and 8 do they stay switched on. Another curiousity which may be a clue is that when I compile and program the pickit2 comes on with a lower Vdd(about 3.8 and I have to turn it up again. I have also removed the darlingtons so there are only leds an port A but it has made no difference. If anyone can spot whatever my latest stupid mistake is I would be very grateful. BTW the reason I could'nt originally use pins 6 an7 was that [I] had my knickers in a twist thinking I was programming with MPASm when in fact I was using the default !!

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