I'm confused


Closed Thread
Results 1 to 8 of 8

Thread: I'm confused

  1. #1
    Join Date
    Jul 2007
    Posts
    18

    Unhappy I'm confused

    I had to start a new thread as for some reason I cannot reply to the last one. When I try I get the message:
    "You are not logged in or you do not have permission to access this page. This could be due to one of several reasons:
    You are not logged in. Fill in the form at the bottom of this page and try again.
    You may not have sufficient privileges to access this page. Are you trying to edit someone else's post, access administrative features or some other privileged system?
    If you are trying to post, the administrator may have disabled your account, or it may be awaiting activation.
    Log inUser Name:

    Password:

    Forgotten Your Password? Remember Me?


    The administrator may have required you to register before you can view this page. "

    I don't know what it's all about but here's that schematic...oh no it isn't..I can't do attachments...I get told that I am currently viewing as a guest etc (even though I am logged in...but can't reply to my own posts?!?!?) So I'll try my previous trick of posting this and then editing it to attach a schematic...fingers crossed
    Attached Images Attached Images  
    Last edited by Robotica1; - 14th July 2007 at 16:24. Reason: Crazy computer won't let me do attachments or replies

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


    Did you find this post helpful? Yes | No

    Default

    Maybe I am missing something but... code does not match schematic.
    Code:
    symbol l9= porta.1
    
    symbol l10= porta.2
    
    symbol l11= porta.3
    
    symbol l12= porta.4
    Drawing has:
    A1 going to l10
    A2 going to l11
    and so on...Maybe I am the one confused

    As far as you posting goes contact Darrel for help.
    Dave
    Always wear safety glasses while programming.

  3. #3
    Join Date
    Jul 2007
    Posts
    18


    Did you find this post helpful? Yes | No

    Default Rehashed port settings

    Yeah sorry about that....originally the port settings were as schematic: l9=a0, l10=a1, l11=a2, l12=a3. I changed them later to check that it wasn't just something with a0 but as a few of you pointed out I can't use a4 for I/O so I shifted 'em back. Maybe the code I sent was the middle test 'era' as it stands the last 4 port settings are a0-->a3 respectively. I've tested this setup on 3 PICs and 3 bargraphs (2 green and 1 red) with the same result. So I tried a6....same result. Out of pure frustration I wired the a0 output to a totally independant standalone LED...which flashes perfectly at the right time. This would make me think that the problem is with the Bargraph. But if I just pulse l9 then it is fine and if you look at the original code there are two subroutines (standard and pulse) which work absolutely fine. I cannot for the life of me see any reason whatsoever why one LED would work perfectly with a signal whereas another would flash ever so briefly with the same signal yet work fine when another signal comes from the same line....totally inexplicable and maximum admiration to anyone who can work this out!!!

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


    Did you find this post helpful? Yes | No

    Default

    Ok, Looking at the data sheet in section 11 VOLTAGE REFERENCE MODULE on page 68.
    11.5 Connection Considerations
    The Voltage Reference module operates independently
    of the Comparator module. The output of the reference
    generator may be connected to the RA2 pin if the
    TRISA<2> bit is set and the VROE bit, VRCON<6>, is
    set. Enabling the Voltage Reference module output onto
    the RA2 pin with an input signal present will increase
    current consumption. Connecting RA2 as a digital output
    with VREF enabled will also increase current consumption.
    The RA2 pin can be used as a simple D/A output with
    limited drive capability. Due to the limited drive
    capability, a buffer must be used in conjunction with the
    Voltage Reference module output for external connections
    to VREF. Figure 11-2 shows an example buffering
    I am sure Mister-E can clear this up if it is the problem, now I am in new ground
    Dave
    Always wear safety glasses while programming.

  5. #5
    Join Date
    Jul 2007
    Posts
    18


    Did you find this post helpful? Yes | No

    Smile Thanks Dave

    Thanks Dave, (and mister_e and all who've contributed),
    I have to go to bed now as it's 3am and my boy's B'day tomorrow (today)....looks like I won't get the full coding down for his 'wrist scanner'...I'll work it out later and 'upgrade' him. Thanks again for all your help and if anyone actually puzzles this out I'll be all ears as to what's happening.

    Good night all

  6. #6
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    The voltage reference is disabled by default, but yeah, not bad to make sure of everything
    CVRCON = 0 if my memory serves me well

    with CMCON = 7 it usually enough.

    Anyways, on this one, IF we want to have always the same brightness on ALL LED, we will need to do some TRIS and PORT tricks. Obviously our friend omit to add the resistor in his schematic, but no problem, i'm working on something right now.

    For once, i'll try it on a SIM

    Schematic is attached
    Attached Images Attached Images
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  7. #7
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    OK, here's the overcomplicated solution first...
    Code:
        @ __CONFIG  _INTRC_OSC_NOCLKOUT & _MCLRE_ON  &  _LVP_OFF & _WDT_OFF & _PWRTE_ON  & _BODEN_ON  
        PORTA = 0
        PORTB = 0
        TRISA = 0
        TRISB = 0
        CMCON = 7
        
        CounterA    var byte
        GOTO START
    @   IFNDEF KAPOUET
            PAUSE 0     ' include PAUSE?C macro
    @   ENDIF
    ASM
    
            
    ON=1
    OFF=0
    BLINK=2
    
    CLEARALL    MACRO
       VARIABLE CLEARCOUNTER
    CLEARCOUNTER=1
        WHILE (CLEARCOUNTER<13)    
            LED#v(CLEARCOUNTER) OFF
    CLEARCOUNTER++=1
        ENDW
        ENDM
                
    LED     MACRO  LEDOUT,ACTION,DELAY
        IF (ACTION == BLINK)
            LED#V(LEDOUT) ON
            PAUSE?C DELAY
            LED#V(LEDOUT) OFF
            ELSE
                LED#V(LEDOUT) ACTION
                PAUSE?C DELAY
            ENDIF
        ENDM
        
    LED1    MACRO ACTION
        MOVE?CT 0,TRISB,0
        MOVE?CT ACTION,PORTB,0
        ENDM
    
       
    LED2    MACRO ACTION
        MOVE?CT 0, TRISB,1
        MOVE?CT 0, TRISB,2
        MOVE?CT ACTION,PORTB,1
        MOVE?CT 0,PORTB,2
        ENDM
        
    LED3    MACRO   ACTION
        MOVE?CT 1, TRISB,1
        MOVE?CT 0, TRISB,2
        MOVE?CT ACTION, PORTB,2   
        ENDM
    
    LED4    MACRO ACTION
        MOVE?CT 0,TRISB,3
        MOVE?CT ACTION,PORTB,3
        ENDM
    
    LED5    MACRO ACTION
        MOVE?CT 0, TRISB,4
        MOVE?CT 0, TRISB,5
        MOVE?CT ACTION,PORTB,4
        MOVE?CT 0,PORTB,5
        ENDM
        
    LED6    MACRO   ACTION
        MOVE?CT 1, TRISB,4
        MOVE?CT 0, TRISB,5
        MOVE?CT ACTION, PORTB,5
        ENDM
    
    LED7    MACRO ACTION
        MOVE?CT 0, TRISB,6
        MOVE?CT 0, TRISB,7
        MOVE?CT ACTION,PORTB,6
        MOVE?CT 0,PORTB,7
        ENDM
        
    LED8    MACRO   ACTION
        MOVE?CT 1, TRISB,6
        MOVE?CT 0, TRISB,7
        MOVE?CT ACTION, PORTB,7
        ENDM
        
    LED9    MACRO ACTION
        MOVE?CT 0,TRISA,0
        MOVE?CT ACTION,PORTA,0
        ENDM
    
    LED10    MACRO ACTION
        MOVE?CT 0, TRISA,1
        MOVE?CT 0, TRISA,2
        MOVE?CT ACTION,PORTA,1
        MOVE?CT 0,PORTA,2
        ENDM
        
    LED11    MACRO   ACTION
        MOVE?CT 1, TRISA,1
        MOVE?CT 0, TRISA,2
        MOVE?CT ACTION, PORTA,2
        ENDM    
    
    LED12    MACRO ACTION
        MOVE?CT 0,TRISA,3
        MOVE?CT ACTION,PORTA,3
        ENDM        
    ENDASM    
        
    
                   
    START:
        for countera =1 to 10
            ASM
                LED 1,ON,0
                LED 4,ON,0
                LED 7,ON,0
                LED 10,ON,250
                CLEARALL
                
                LED 2,ON,0
                LED 5,ON,0
                LED 8,ON,0
                LED 11,ON,250
                CLEARALL
                
                LED 3,ON,0
                LED 6,ON,0
                LED 9,ON,0
                LED 12,ON,250
                CLEARALL
            ENDASM        
            next
    
        FOR COUNTERA= 1 TO 10
        asm
        variable CLED
    CLED=1
    
        while (CLED<13)
           LED CLED,BLINK,250
    CLED++=1
        ENDW
    CLED=11    
        while (CLED>1)
           LED CLED,BLINK,250
    CLED--=1
        ENDW    
        ENDASM            
        NEXT
        GOTO START
    now, i'll try to do something more 'user friendly
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  8. #8
    Join Date
    Jul 2007
    Posts
    18


    Did you find this post helpful? Yes | No

    Smile Thanks mister_e

    Thanks for all your help there and with my other posting re no attachments.

Similar Threads

  1. confused
    By fowardbias in forum Serial
    Replies: 3
    Last Post: - 24th February 2010, 03:51
  2. Confused over A/D settings
    By malc-c in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 22nd February 2010, 10:44
  3. 12C671 & Osccal register - I am confused
    By Megahertz in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 26th December 2009, 06:03
  4. 1.5 v to 3v and 5v? Really confused.
    By kevj in forum Schematics
    Replies: 6
    Last Post: - 17th October 2007, 14:16
  5. Hlp - newcomer getting confused
    By chunk in forum General
    Replies: 1
    Last Post: - 23rd January 2006, 18:47

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