MIBAM and 12F1822...


Closed Thread
Results 1 to 28 of 28

Hybrid View

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


    Did you find this post helpful? Yes | No

    Default Re: MIBAM and 12F1822...

    try the one in the attachement.

    Attachment removed.
    The program was completely destroyed by the modifications.
    Last edited by Darrel Taylor; - 29th August 2011 at 02:45.
    Steve

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

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


    Did you find this post helpful? Yes | No

    Default Re: MIBAM and 12F1822...

    Another thing... RA4 = AN3, so you need to modify your ANSELA line
    Steve

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

  3. #3
    Join Date
    Aug 2011
    Posts
    12


    Did you find this post helpful? Yes | No

    Default Re: MIBAM and 12F1822...

    Thanks for the help!

    so just tried the modMIBAM code, unfortunatly still getting strange results. different results but still not correct..

    so now the led's do the initial test light up and fade, r/g/b and then when I
    trigger the adc threshold it does work but only the first 1-3 times then the
    led stops working. hmmm must be something else that needs to be modified..

    I was wondering about this section of MIBAM code as well.
    Code:
      ifdef BSR                      ; 18F
        variable ReloadCount   = 5
        variable Latency       = 6
        variable ExitLatency   = 4
      else
        variable ReloadCount   = 7               ; ---- FIX THESE ----
        variable Latency       = 10  ; 16F
        variable ExitLatency   = 10
      endif
    I tried to change the values swapping between the 16f / 18f values as a test, but didn't seem to do anything.

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


    Did you find this post helpful? Yes | No

    Default Re: MIBAM and 12F1822...

    Again... your ANSELA line do not seems good...
    change it to
    ANSELA = %00001000


    and get rid of the DEFINE ADC_BITS 10 line

    Stil not for... replace the ADC reading by a ADC_VAL loop, see what happen.

    IMHO It has to work... or I still miss a crispy detail.
    Last edited by mister_e; - 29th August 2011 at 00:44.
    Steve

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

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


    Did you find this post helpful? Yes | No

    Default Re: MIBAM and 12F1822...

    What happen if you Enable/Disable MIBAM within the IF/Then loop?
    Code:
    main:
        gosub do_adc 'get ADC reading
        pause 20
        
        ;T1CON.0 = 0 'disable mibam
        debug "ADC: ",dec4 adc_val,13,10
        pause 2
       ; T1CON.0 = 1 'enable mibam
        
        if adc_val > adc_thresh then 
            T1CON.0 = 1 'enable mibam
            FOR red = 255 to 1 STEP -1
                    PAUSE Speed
            NEXT red
            red = 0
            
            FOR grn = 255 to 1 STEP -1
                    PAUSE Speed
            NEXT grn
            grn = 0
            
            FOR BLU = 255 to 1 STEP -1
                    PAUSE Speed
            NEXT BLu
            blu = 0
            T1CON.0 = 0 'disable mibam
        endif  
    goto main
    Steve

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

  6. #6
    Join Date
    Aug 2011
    Posts
    12


    Did you find this post helpful? Yes | No

    Default Re: MIBAM and 12F1822...

    I changed out the ANSELA line... not quite sure what is wrong with it.
    (and removed the DEFINE ADC_BITS 10 line as well)

    seemed correct looking at the datasheet.

    I am using AN3 as my analog input which is RA4, the readings I am getting
    with the debug output are correct (phototransistor reading light levels)

    also tried to enable/disable MIBAM within the loop, now the led doesn't trigger at all, with the enable/disable just around the debug statment, it did work once or twice before stopping... very strange.

    wondering if there is some other peripheral that needs to be disabled perhaps?
    these new pics have pretty much everything multiplexed except the kitchen sink it seems.

    Last edited by alesniak; - 29th August 2011 at 02:15.

  7. #7
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959


    Did you find this post helpful? Yes | No

    Default Re: MIBAM and 12F1822...

    alesniak,

    I am modifying MIBAM to work with the 16F1's.
    They did not exist when I wrote it.

    mister-E's modifications will not work, and I've deleted the attachment above.
    I don't need non-working copies of MIBAM floating around the internet, since I'm the one that people will complain to.

    I should have it by tomorrow.
    DT

Members who have read this thread : 1

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