![]() | ![]() | ![]() |
| |||||||
| Micro Controllers Discuss all aspects of micro controllers - building them, coding them, etc. All controllers are welcome - PIC, BASIC, Z8 Encore!, etc. |
![]() |
| | Tools |
| | #1 |
|
hi every one this modefied flasher program you can select four paterns and four speed with only two inputs can any one check it and tell me if itis ok or not | |
| |
| | #2 |
|
I noticed you used computed goto ("addwf pc,f") to obtain data from a look-up table. Unfortunately, "tabl2" crosses a page boundary and so the program will jump to the wrong "retlw k" position. That is, tabl2 begins at 0DAh and ends at 10Ch. You can't allow the look-up table to cross the 0FFh-100h boundary, because instead of jumping to 100h, the program will end up at 000h (reset vector).
__________________ "Having to do with Motion Control" | |
| |
| | #3 |
|
so what can i do to solve this problem and how i can know startting of table
| |
| |
| | #4 | |
| Quote:
| ||
| |
| | #5 | |
| Quote:
Since the table is no longer at page 0, you have to initialize the PCLATH register to the right page. The value of the label "tabl2" will give its start position. Code: movlw high tabl2
movwf pclath
movf count,0
call tabl2
ORG 100h
tabl2:
addwf pcl,1
__________________ "Having to do with Motion Control" | ||
| |
|
| Tags |
| flasher, led |
| Thread Tools | |
| Display Modes | |
| |