read byte/byte on flowcode

For questions and comments on programming in general. And for any items that don't fit into the forums below.

Moderators: Benj, Mods

Post Reply
jeannoor
Posts: 5
Joined: Wed May 23, 2012 10:36 am
Contact:

read byte/byte on flowcode

Post 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

User avatar
Enamul
Posts: 1772
Joined: Mon Mar 05, 2012 11:34 pm
Location: Nottingham, UK
Has thanked: 271 times
Been thanked: 814 times
Contact:

Re: read byte/byte on flowcode

Post 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
Enamul
University of Nottingham
enamul4mm@gmail.com

Spanish_dude
Posts: 594
Joined: Thu Sep 17, 2009 7:52 am
Location: Belgium
Has thanked: 63 times
Been thanked: 102 times
Contact:

Re: read byte/byte on flowcode

Post 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

User avatar
Enamul
Posts: 1772
Joined: Mon Mar 05, 2012 11:34 pm
Location: Nottingham, UK
Has thanked: 271 times
Been thanked: 814 times
Contact:

Re: read byte/byte on flowcode

Post 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
Attachments
serial_data_EEPROM.fcf
(16 KiB) Downloaded 238 times
Enamul
University of Nottingham
enamul4mm@gmail.com

Post Reply