Old and beyond help ?


Closed Thread
Results 1 to 40 of 47

Hybrid View

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


    Did you find this post helpful? Yes | No

    Default

    Hi
    Before I post the code I seem to remember that there is a particular etiquette for including code in a post but I can't find any reference to it. Just thought I'd ask as I dont want to upset folk . Thanks

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


    Did you find this post helpful? Yes | No

    Default

    Code tags work well.
    http://www.picbasic.co.uk/forum/misc.php?do=bbcode#code

    Makes thing a little more readable.
    Dave
    Always wear safety glasses while programming.

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


    Did you find this post helpful? Yes | No

    Default

    Thanks for that.

    My original circuit had three octal darlingtons (ULN 2803) with inputs directly coupled to Ports A, C and D I have also connected leds with 680ohms to each pin so that I can see what the ports outputs are. A test program switched on and off each led in turn thru ports D C and A in that order and worked OK. Problem arose when tryin to switch on all of the A port bits and leave them on. I have now disconnected ther darlington from port a and written the following simple test program:
    Code:
    @ DEVICE pic16f887,intrc_osc_noclkout
    
    
    PORTD = 0
    PORTA = 0
    PORTC = 0
    TRISD = 0
    TRISA = 0
    TRISC = 0
     portA.0 = 1
     pause 500
     porta.1 = 1
     pause 500
     porta.2 =1
     pause 500
     porta.3 = 1
     pause 500
     porta.4 = 1
     pause 500
     porta.5 = 1
     pause 500
     porta.6 = 1
     pause 500
     porta.7 = 1
    end
    I have just run this program and
    1. When Microcode studio fired up the Pickit2 the voltage Vdd had been set down to 3.3
    2. I turned up Vdd to 5 volts and programmed the chip.
    LEDs 0,1,2,3 tuswitched on and then off after the delay. LED 4 switched on and stayed on, LED 5 switched on and then off again after the delay and then LEDs 6 and seven switched on and remainedon. I can see no logic inthis although I have that horrible feeling that it is staring me in the face !

  4. #4
    Join Date
    Aug 2006
    Location
    Look, behind you.
    Posts
    2,818


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by DavidFMarks View Post
    Thanks for that.

    My original circuit had three octal darlingtons (ULN 2803) with inputs directly coupled to Ports A, C and D I have also connected leds with 680ohms to each pin so that I can see what the ports outputs are. A test program switched on and off each led in turn thru ports D C and A in that order and worked OK. Problem arose when tryin to switch on all of the A port bits and leave them on. I have now disconnected ther darlington from port a and written the following simple test program:
    Code:
    @ DEVICE pic16f887,intrc_osc_noclkout
    
    
    PORTD = 0
    PORTA = 0
    PORTC = 0
    TRISD = 0
    TRISA = 0
    TRISC = 0
     portA.0 = 1
     pause 500
     porta.1 = 1
     pause 500
     porta.2 =1
     pause 500
     porta.3 = 1
     pause 500
     porta.4 = 1
     pause 500
     porta.5 = 1
     pause 500
     porta.6 = 1
     pause 500
     porta.7 = 1
    end
    I have just run this program and
    1. When Microcode studio fired up the Pickit2 the voltage Vdd had been set down to 3.3
    2. I turned up Vdd to 5 volts and programmed the chip.
    LEDs 0,1,2,3 tuswitched on and then off after the delay. LED 4 switched on and stayed on, LED 5 switched on and then off again after the delay and then LEDs 6 and seven switched on and remainedon. I can see no logic inthis although I have that horrible feeling that it is staring me in the face !
    If this is all of the code, then You have to turn off all the analog stuff to get it to work, ADCON, ANSEL, and Comparators
    http://www.picbasic.co.uk/forum/showthread.php?t=561
    Last edited by Archangel; - 9th December 2008 at 01:09.
    If you do not believe in MAGIC, Consider how currency has value simply by printing it, and is then traded for real assets.
    .
    Gold is the money of kings, silver is the money of gentlemen, barter is the money of peasants - but debt is the money of slaves
    .
    There simply is no "Happy Spam" If you do it you will disappear from this forum.

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


    Did you find this post helpful? Yes | No

    Default

    Very many thanks. I now have the system fully operational and can start programming the Star of David which should now be appearing in the village tomorrow evening. It might not seem much but by this time tomorrow I confidently expect the village will be swarming with wise men and shepherds. Thanks again folks !

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


    Did you find this post helpful? Yes | No

    Default

    Lets see some pictures
    Dave
    Always wear safety glasses while programming.

  7. #7
    Join Date
    Aug 2006
    Location
    Look, behind you.
    Posts
    2,818


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by DavidFMarks View Post
    . . .It might not seem much but by this time tomorrow I confidently expect the village will be swarming with wise men and shepherds. . . !
    You obviously do not live in Washington DC.
    If you do not believe in MAGIC, Consider how currency has value simply by printing it, and is then traded for real assets.
    .
    Gold is the money of kings, silver is the money of gentlemen, barter is the money of peasants - but debt is the money of slaves
    .
    There simply is no "Happy Spam" If you do it you will disappear from this forum.

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


    Did you find this post helpful? Yes | No

    Default

    Spoke too soon !... Not about the shepherds and wise men but about the program working. I have been programming a whole load of different sequences one after another. They have all worked ok until the last few, the program simply ignores them and returns to the beginning. If i bung in a goto directly to the last few sequences the behave erratically (cutting short loops etc. I wonder if I have broken some rule about memory size or borders or some such as I am far from clear on this subject .... To hell with the shepherds I just need the wise men.....

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