Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
LIST p=16F877a
include "P16f877A.inc"
bsf STATUS, 5
movlw b'00000000'
movwf TRISB
bcf STATUS, 5
Start
movlw b'11111111'
movwf PORTB
end
ombrastein said:I looked at some old code:
For a previus robot that i built, using an 877a chip i had to add this code:
*****************************************
#opt 3
#include "16F877.H"
//makes sure the uc doesnt go bananas due to bug in chip design
#build(reset=0x002)
***********************************
im using CCS c compiler. Probably is somthing similar to this for other compilers and obviusly for asm
the #build(reset=0x002) tells the compiler to put the code at location 2, and then go to that location whenever the chip is reset. This prevents any important code from beeing put in the unstable 0 location.