Page 1 of 1

read byte/byte on flowcode

Posted: Wed May 23, 2012 11:15 am
by jeannoor
Hello everyone,

I have very big problems to write the code to read a byte that arrives on port A (B3, for example) and display it on an LCD

I have a code they do but the assembler problemme is that there are n has not adapted Flowcode

Code: Select all

bits0
    clrf codlue                 
    movlw .8                   
    movwf cmpt                 
;read 1 octet
lec_bit0
    call clk                   
    btfss PORTA,3              
    goto non                    
    bsf STATUS,0                
    rlf codlue,f                
    decfsz cmpt,f               
    goto lec_bit0               
    goto wite_onEeprom
non
    bcf STATUS,0               
    rlf codlue,f                
    decfsz cmpt,f               
    goto lec_bit0               

clk
    bsf PORTA,0                     
    nop                         
    bcf PORTA,0                       
    nop
    return                     

wite_onEeprom
		   movfw lencode               
		   movwf EEADR                  
		   movfw codlue
		   movwf EEDATA
		   BANK1
		   bcf EECON1,EEIF
		   bsf EECON1,WREN
		   movlw 0x55
		   movwf EECON2
		   movlw 0XAA
		   movwf EECON2
		   bsf EECON1, WR
		   incf lencode
		   decfsz compt,f
		   goto bits0
ps : codlue mean the readen data

please helpe to convert this code to flowcode because it a probleme on compilation to .hex

Re: read byte/byte on flowcode

Posted: Tue Jul 10, 2012 3:05 pm
by Enamul
Hi,
Can you please tell the details of the code what you want to do?

It's tough to recover bcz of language..it seems the code will be easy in Flowcode..
Enamul

Re: read byte/byte on flowcode

Posted: Tue Jul 10, 2012 8:42 pm
by Spanish_dude
Hi,

You want to (serial) read 8 bits on PORTA.3, store them into a variable, write that variable in the EEPROM and increase 'lencode', right ?

Nicolas

Re: read byte/byte on flowcode

Posted: Wed Jul 11, 2012 12:18 pm
by Enamul
Hi,
Thanks Nicolas..

I have had a better look at the code and re-programmed that in FC...

Hope this will help :)
Enamul