My project is starting - Page 3


Closed Thread
Page 3 of 3 FirstFirst 123
Results 81 to 92 of 92
  1. #81
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default

    Code:
     BSR = 0  'IN BANK 0
     LATF = LATF ^ 32    'NOW IN BANK 7
     CNT =CNT+1   'NOW WHAT???
    If I am just being thick headed let me know...
    Dave
    Always wear safety glasses while programming.

  2. #82
    Join Date
    Aug 2010
    Location
    Maryland, USA
    Posts
    869


    Did you find this post helpful? Yes | No

    Default

    when PBP sees the LATF line, it switches to bank 7. when its done it automaticlly switches back to BANK 0. This way PBP can know it is always in BANK 0. So when it sees PIR1.1=0, this is a BANK 0 thing, it assumes it is in BANK 0 so it doesn't reset BSR. Now sometimes when my ISR is called, I was already in BANK 5. If the LATF line is in, PBP switches to 7, then back to 0 when done with LATF. When I rem LATF and enter the ISR in BANK 5, PBP doesn't know. So then everything that is supposed to happen in BANK 0 can't.

    Adding BSR=0 as the first line in my ISR will ensure PBP won't be confused. Because the chip I am using does auto context save and restore, I don't need to worry about destroying the BSR in my ISR.
    -Bert

    The glass is not half full or half empty, Its twice as big as needed for the job!

    http://foamcasualty.com/ - Warbird R/C scratch building with foam!

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


    Did you find this post helpful? Yes | No

    Default

    I get it now..
    LAT was/is doing the same thing as BSR , as far as the BANKs are concerned.
    Thanks!!!!
    now it is time for a nap..
    Dave
    Always wear safety glasses while programming.

  4. #84
    Join Date
    Aug 2010
    Location
    Maryland, USA
    Posts
    869


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by mackrackit View Post
    now it is time for a nap..
    I thought sleep was for sissies?
    -Bert

    The glass is not half full or half empty, Its twice as big as needed for the job!

    http://foamcasualty.com/ - Warbird R/C scratch building with foam!

  5. #85
    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 cncmachineguy View Post
    I thought sleep was for sissies?
    Did I say that?

    but it will be a short nap
    Dave
    Always wear safety glasses while programming.

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


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by cncmachineguy View Post
    How did Protus make this work???
    Because I was concentrating on the interrupts, and not simulating your entire program.
    So it never ended up in other banks like your program.

    Oh well.
    Sorry for the confusion.
    DT

  7. #87
    Join Date
    Aug 2010
    Location
    Maryland, USA
    Posts
    869


    Did you find this post helpful? Yes | No

    Default

    Whew, thanks again Darrel. I was really having second thoughts for a min. Now my brain is all re-aligned for whatever tomorrow brings
    -Bert

    The glass is not half full or half empty, Its twice as big as needed for the job!

    http://foamcasualty.com/ - Warbird R/C scratch building with foam!

  8. #88
    Join Date
    Aug 2010
    Location
    Maryland, USA
    Posts
    869


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by mackrackit View Post
    I get it now..
    LAT was/is doing the same thing as BSR , as far as the BANKs are concerned.
    For the sake of clarity, LAT was not really doing the same thing as BSR. What it was doing was causing PBP to change banks to BANK7, therefore PBP also changed banks back to BANK0 when the LAT was done. With it remed, PBP assumed it was still in BANK0. SO when I entered the ISR with a different bank set, PBP didn't know. I gather from Darrels help in my "bug" thread, He tends to the BSR=0 in his DT_INT routine to avoid just such issues.

    BTW, the only reason I can change BSR inside my ISR is because 16F1xxx automatically saves BSR upon entering an interupt. So BSR will change back when I return. Otherwise I would have needed to save the BSR to a temp, then restore it before leaving ISR.

    Next up on the list of games is multiple interupts and checking who fired.
    This is great fun!!!
    Last edited by cncmachineguy; - 21st December 2010 at 15:48. Reason: lost quote
    -Bert

    The glass is not half full or half empty, Its twice as big as needed for the job!

    http://foamcasualty.com/ - Warbird R/C scratch building with foam!

  9. #89
    Join Date
    Aug 2010
    Location
    Maryland, USA
    Posts
    869


    Did you find this post helpful? Yes | No

    Default having a brain fart

    Been a while since I posted anything here. I am still working on this but things slowed through the holidays then I had some mechanical issues to resolve with the machine. But I am back on this now. Anyhow, here is my problem:

    I have limit switches on each axis of travel. 1 switch also doubles as a home switch for each axis. Because I have too much I/O to report everything to EMC, I am using my card to watch the switches. This way I can report the "home" switches and throw an E-stop if any other limits are hit.

    Now for the question: when the machine homes, it is set up to do 1 axis at a time, leaving the axis on the home switch. I need to be able to ignore the switch until homing is complete (i have that working) but also need to ignore them until the first time the axis moves off the switch. Does this make sense? I am sure this will need some flags, but I am at a loss as to how to do the checking without having a zillion IF's and so forth.

    Any suggestions/questions?
    -Bert

    The glass is not half full or half empty, Its twice as big as needed for the job!

    http://foamcasualty.com/ - Warbird R/C scratch building with foam!

  10. #90
    Join Date
    Aug 2010
    Location
    Maryland, USA
    Posts
    869


    Did you find this post helpful? Yes | No

    Default Re: having a brain fart

    Finally got past my logic issues, Just thought I would post a pic of the card with stepper drives attached.
    Name:  cards-w drives.jpg
Views: 282
Size:  128.8 KB

    Thanks to all who have helped me get this far. This is a fully functional "phase 1" card. Now the fun really begins

    BTW, for any who are intrested, pics of the machine will be up soon over at Foam Casualty
    Last edited by cncmachineguy; - 14th February 2011 at 15:16.
    -Bert

    The glass is not half full or half empty, Its twice as big as needed for the job!

    http://foamcasualty.com/ - Warbird R/C scratch building with foam!

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


    Did you find this post helpful? Yes | No

    Default Re: My project is starting

    Nice!!!
    Looking forward to seeing vids of it running.
    Dave
    Always wear safety glasses while programming.

  12. #92
    Join Date
    Aug 2010
    Location
    Maryland, USA
    Posts
    869


    Did you find this post helpful? Yes | No

    Default Re: My project is starting

    Thank you,
    They are coming Dave
    Last edited by cncmachineguy; - 15th February 2011 at 01:56. Reason: typo
    -Bert

    The glass is not half full or half empty, Its twice as big as needed for the job!

    http://foamcasualty.com/ - Warbird R/C scratch building with foam!

Members who have read this thread : 1

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