I need help understanding on how to apply this into the loop section. I need hel
ID: 3889557 • Letter: I
Question
I need help understanding on how to apply this into the loop section.
I need help understanding on how to apply this into the loop section. #include "p16F1829.inc": CONFIG1: ___ config 0xC9E4 _CONFIG _ CONFIG1, _FOSC_INTOSC ___ WDTE _PWRTE_OFF __ MCLRE_ON _CP_OFF _CPD _OFF _ BOREN_ OFF _CLKOUTEN_OFF _IKSO __ _ OFF: CONFIG2: confiG 0xDEFF _CONFIG _CCMFIG2, _WRT_OFF __PLLEN _OFF _SRVREN_ON _SORV_LO _LVP_OFF: First include header file: load processor and set radix to decimal list p = 16F1829, R = D C CBLOCK 0x30: Define GPR variable register locations DIAY LOOFCOUNT;DECLARE EXTRA HERE: NEW VARS Go Here ENDC;start setup ORG 0 goto Start ORG 4 RETFIR start;Clock Setup BANKS EL OSCCON movl 0x6A movwf OSCCON;Port Setup BANKSEL TRISA Clrf TRTSA SANXSEL LATA olrf LATA;challange Loop Loop: Challenge code Goes Here goto Loop;Delay Routine Delay BANKSEL VarA movlw 0xFF movwf VarA Outside decfsz VarA goto Goon return Goon movlw 0xFF movwf Varn Inside decfsz VarB goto Inside goto Outside END Use the following Code Bank (similar to a word bank), to write a loop that does the following: Selects Bank LATA Sets RA5 (High) Calls Delay Selects Bank LATA Clears RA5 (Low) Calls Delay Each line above corresponds to one line of code. Your loop goes in between 'Loop' and 'Go to Loop'. I left a comment in an exact spot where you should place your loop. Good Luck.! Remember that you will have to declare VarA and VarB for yourself.Explanation / Answer
Before we start a loop you should call everything on a line to make the LED to blink.While applying things in to a loop section you should consider whether the signal is recieved.There are 2 conditions to be written inside the loop.
1) whether the LED IS ON.
2) whether the LED IS OFF.
After every succesfull on or off condition you should call the delay.
If suppose BSF LATA , LED; ---> off condition
call delay.
again repeat the same for for LED off condition.
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.