![]() |
![]() |
![]() |
|
|
|||||||
| Micro Controllers Discuss all aspects of micro controllers - building them, coding them, etc. All controllers are welcome - PIC, BASIC, Z8 Encore!, etc. |
|
|
Thread Tools | Display Modes |
|
|
(permalink) |
|
This looks like a great forum. I've spent the last few months getting started programming PICs and while they have alot of features there are some issues I've run into.
Hopefully this will help some people. ; Fixed RESET_VECTOR RESET_VECTOR CODE 0x000 ; processor reset vector pagesel start ; Select proper page for "start" marker goto start ; go to beginning of program ; Fixed digital selection of PORTB IO lines- lines come up as analog banksel ANSELH ; Select memory bank that contains ANSELH movlw h'00' ; Move literal 00000000 to W register movwf ANSELH ; Move W register to ANSELH ; use pagesel for all call and goto commands ; use banksel for all variable related commands ;USE THIS FOR A INTERRUPT VECTOR. SOMETIMES THE PCLATH REGISTER GETS TRASHED ON THE "GOTO INTERRUPT" and you want to ;save it first INT_VECTOR CODE 0x0004 ; interrupt vector location movwf w_temp ; save off current W register contents movf STATUS,w ; move status register into W register movwf status_temp ; save off contents of STATUS register movf PCLATH,w ; move pclath register into w register movwf pclath_temp ; save off contents of PCLATH register pagesel INTERRUPT goto INTERRUPT |
|
|
|
|
|
|
(permalink) |
|
What's the question?
|
|
|
|
|
|
|
(permalink) |
|
No question, I just thought I'd put the info out there for those working with that PIC. I've had my share of banging my head against a wall trying to figure out what the issue was.
Hopefully it helps a few people. |
|
|
|
|
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|
|
|
||||
| Thread | Thread Starter | Forum | Replies | Latest |
| Designing stopwatch with 16f887 | matlark | Micro Controllers | 13 | 6th June 2008 11:19 PM |
| 16F887 Serial Setup | Mike, K8LH | Micro Controllers | 2 | 5th May 2008 12:15 PM |
| Can someone explain the adc? 16f887 | matlark | Micro Controllers | 1 | 25th April 2008 01:29 PM |
| 16F887 Debugging problem | asp1987 | Micro Controllers | 0 | 25th March 2008 06:41 PM |
| I can't find the PGD and PGC pins on the 16F887... | Krumlink | Datasheet/Parts Requests | 9 | 30th September 2007 06:43 PM |