ON 20100512@11:36:58 AM at page: On a web page you were interested in at: http://www.piclist.com/microchip/16f877/snipp.htm#40309.8334722222 James Newton[JMN-EFP-786] published post 40309.8334722222 airyu@comcast.net
To safely initialize the PIC (any processor, really) and get the interrupts to be stable on powerup, do the following in this order: A) Set up all of the TRIS and ADCON registers. B) Initialize all the static port outputs. C) Set up all memory variables and pointers. D) initialize all the interrupts in any order you like except the GIE bit. E) Set the GIE bit. F) Jump to the running code loop.

When generating code and using multiple prefab code sets, merge the approriate sections: Defines and memory locations, ISR code (you only have 1 interrupt vector for the 16F8xx series, for instance - use polling inside the master ISR routine for each interrupt bit) Hint: Don't simply excape the ISR is one of the bits is not set. Check each bit and branch to the next bit test if not set. Call the appropriate interrupt code after each test.
|Delete 'P-' before: '' but after: '