please dont rip this site

PIC JAL IO Routine

'877 AD display in JAL with ASM

by Vasile Surducan

...the jpic library must be updated with user definited bites and registers and the LCD pin's library set in acordingly with the  hardware:

var volatile bit adcon0_go at f877_adcon0 : 2
var volatile byte f877_adcon1  at 0x9F
var volatile byte f877_adcon0  at 0x1F
var volatile byte f877_adresl  at 0x9E
var volatile byte f877_adresh  at 0x1E

include f877_4
include jpic
include jprint
include jdelay
include hd447804

var byte data
var byte ch0_hi = 0
var byte ch0_lo = 0

procedure aqui is
assembler
local wait

        bsf     status_rp0      -- bank 1
        bcf     status_rp1
        movlw   0b_1000_1110       
        movwf   f877_adcon1     -- right justified, an0
        bcf     status_rp0      -- bank 0
        movlw   0b_0100_0001    -- Fosc/8 [7-6], A/D ch0 [5-3], a/d on [0]
        movwf   f877_adcon0
                              
        bsf     adcon0_go      -- Start A/D conversion
 Wait:
        btfsc   adcon0_go      -- Wait for conversion to complete
        goto    Wait

        movf    f877_adresh,w  -- Write A/D result to ch0_lo, ch0_hi
        movwf   ch0_hi
        bsf     status_rp0     -- bank 1 
        bcf     status_rp1 
        movf    f877_adresl,w
        bcf     status_rp0     -- bank 0
        movwf   ch0_lo         
        bcf     status_rp0          

end assembler
end procedure


 hd44780_clear

forever loop
aqui
hd44780_line1
print_decimal_1 ( hd44780, ch0_hi, "0" )
hd44780_position ( 2 )
print_decimal_3 ( hd44780, ch0_lo, "0" )
delay_100mS ( 3 )
end loop

Questions:

Comments:


file: /Techref/piclist/jal/adjalasm-vs.htm, 2KB, , updated: 2006/5/15 16:33, local time: 2024/11/25 06:17,
TOP NEW HELP FIND: 
18.191.200.114:LOG IN

 ©2024 These pages are served without commercial sponsorship. (No popup ads, etc...).Bandwidth abuse increases hosting cost forcing sponsorship or shutdown. This server aggressively defends against automated copying for any reason including offline viewing, duplication, etc... Please respect this requirement and DO NOT RIP THIS SITE. Questions?
Please DO link to this page! Digg it! / MAKE!

<A HREF="http://massmind.org/techref/piclist/jal/adjalasm-vs.htm"> PIC JAL IO Routine '877 AD display in JAL with ASM by Vasile Surducan</A>

After you find an appropriate page, you are invited to your to this massmind site! (posts will be visible only to you before review) Just type a nice message (short messages are blocked as spam) in the box and press the Post button. (HTML welcomed, but not the <A tag: Instead, use the link box to link to another page. A tutorial is available Members can login to post directly, become page editors, and be credited for their posts.


Link? Put it here: 
if you want a response, please enter your email address: 
Attn spammers: All posts are reviewed before being made visible to anyone other than the poster.
Did you find what you needed?

 

Welcome to massmind.org!

 

Welcome to massmind.org!

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

  .