Electronic Projects, forums and more.

Go Back   Electronic Circuits Projects Diagrams Free > Electronics Categories > Micro Controllers


Micro Controllers Discuss all aspects of micro controllers - building them, coding them, etc. All controllers are welcome - PIC, BASIC, Z8 Encore!, etc.

Reply
 
Thread Tools Display Modes
Old 2nd December 2004, 07:51 AM   (permalink)
Default

OK, if you can't be bothered to answer my questions, then I wash my hands of the whole thing. You're on your own as far as I'm concerned.
JohnBrown is offline  
Reply With Quote
Old 2nd December 2004, 12:01 PM   (permalink)
Default

Quote:
Originally Posted by JohnBrown
What form does the keypad take? Judging from your "code" it has a strobe connected to RB0, and two databits connected to RA0 and RA1. Am I right?
If so, what are the other RA pins connected to? You will probably need to ANDLW 0x03 at some point to isolate bits 0 and 1, otherwise, when you attempt to ADD the keycode into the stored code, it won't work as you expect.
I dont know the answer to this question, my professor has mentioned nothing of this. All I know is that RB0 indicates the value on the INT pin on the PIC – when a rising edge (transition from 0 to 1) occurs on this pin, an interrupt is signaled to the PIC. The input values for pins RA2,
RA1, and RA0. RA2 is high when the Enter key is pressed. RA1 and RA0 encode the four number keys into 2-bits. It is assumed that only a single key is pressed at a time. I dont know if that's the answer you're looking for but that's all I know about that.

Quote:
Originally Posted by JohnBrown
Do you actually have the hardware to test this on, or are you just programming into a black hole?
I'm using MPLAB and I don't have the actual PIC (PIC16F84) but a simulator of it.

Quote:
Originally Posted by JohnBrown
You've still not fixed your interrupt routine, which trashes the STATUS register. Also, you seem to have copied the faulty context saving into your grant_deny or whatever it's called.
Again, I cannot edit the interrupt routine nor the grant_deny. Those were all given by my professor. The only thing I'm allowed to touch are subroutines starting at "update_pass_code" which is what I have added to his code.
asmpic is offline  
Reply With Quote
Old 2nd December 2004, 04:28 PM   (permalink)
Default

Sorry, double posted by mistake
asmpic is offline  
Reply With Quote
Old 2nd December 2004, 04:29 PM   (permalink)
Default

I know exactly what needs to be done but I just can't program it in assembly. I'll show you guys the pseudo code for the compare_pass_code subroutine. I think my main problem is using FSR and INDF, I just don't seem to understand how to use those.

Code:
compare_pass_code

if supervisor_mode==1
     store passcode in list
     clear supervisor mode

else
      if entered_pass_code==0x1B (supervisors passcode)
            set supervisor_mode=1
       
       else
            compare entered_pass_code to list of authorized passcodes
            if match found
                add to list
                set success=1
                call grant_deny
            
           else
             no match found is found, set success=0
             call grand_deny
asmpic is offline  
Reply With Quote
Old 3rd December 2004, 06:50 PM   (permalink)
Default

Can someone please give me some advice or help me out with converting the pseudo code I have to assembly language so I can finally get this program finished?
asmpic is offline  
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes




All times are GMT. The time now is 11:15 PM.


Electronic Circuits  |  Electronics Wiki
Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.