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.
upand_at_them said:This tutorial should answer all of your questions:
**broken link removed**
Mike
OPTION_REG EQU H'0081'
TRISA EQU H'0085'
TRISB EQU H'0086'
PIE1 EQU H'008C'
PCON EQU H'008E'
PR2 EQU H'0092'
TXSTA EQU H'0098'
SPBRG EQU H'0099'
EEDATA EQU H'009A'
ANSEL EQU H'009B'
CMCON EQU H'009C'
EECON2 EQU H'009D'
ADRESL EQU H'009E'
ADCON1 EQU H'009F'
williB said:Equates are used to relate the hardware to software ..
In the example below every reference to the option register , which in this example is Equated to Hex 81 ,which is actually the location of the option register in the F88 ..
you could use the Hex Address of the option register ,when refering to the option register ,instead of the name , but it is much clearer when reading the program , to use an equate
as inCode:OPTION_REG EQU H'0081' TRISA EQU H'0085' TRISB EQU H'0086' PIE1 EQU H'008C' PCON EQU H'008E' PR2 EQU H'0092' TXSTA EQU H'0098' SPBRG EQU H'0099' EEDATA EQU H'009A' ANSEL EQU H'009B' CMCON EQU H'009C' EECON2 EQU H'009D' ADRESL EQU H'009E' ADCON1 EQU H'009F'
upand_at_them said:I don't think I've ever used "CONSTANT," just "EQU." They seem to do the same thing.
TRISA EQU H'0085'
Often in PIC assembler there are multiple ways to do the same thing, for example the hex value above can be written 0x0085.