Page 1 of 1

LOOP COMMANDS AT FC7

Posted: Sun Jan 20, 2019 10:23 pm
by SILVESTROS9
I try to convert a code in PICBASICPRO to FC7 code. it is a demo code to write some characters to a GLCD 240X128 with T6963 controller. I have some problems in conversion ...in some part of code must set a port of PIC16F1939 ( PORTB) as inputs to read status of some bits of GLCD.. after that must set the port as outputs to write data to GLCD..how can I do that with FC7 ? also the code in PICBASICPRO has some loops ...FOR....NEXT , FOR....step(var)....NEXT. it use that loops at SET ADDRESS POINTER...How can I set that loops with FC7 ?...I send the code in PBP and the converted in FC7 , for any help to complete the conversion....

Re: LOOP COMMANDS AT FC7

Posted: Mon Jan 21, 2019 12:35 pm
by Benj
Hello,

I've had a quick look for you and I can't easily see where you're struggling.

Can you give us a line number in the C file and the corresponding Flowcode macro and I'll have another look for you.

Re: LOOP COMMANDS AT FC7

Posted: Mon Jan 21, 2019 2:52 pm
by SILVESTROS9
dear Ben,
thanks for your answer...

for gl_i = 1 to 240 ' Clear Graphic Screen
for gl_j = 1 to 64
glcd_msb = $00 'Clear byte
glcd_cmd = DATA_WR_INC 'Command
gosub send_1 'Send glcd_msb followed by glcd_cmd
next
next 'Do it 240x64 times

the above part of PBP is a loop ...the conversion to FC7 is at line 1929 of C code. at graghical code is at MAIN--->INITIALIZE--->CLEAR GRAPHIC SCREEN....my question is : is that conversion correct ?

1. for gl_y= $1000 to $14d8 step $28 'Left Vert Line
2. gl_ad1= gl_y.BYTE1
3. gl_ad2= gl_y.BYTE0
4. gl_k=%11100000
5. num_1 =1
6. num_2 =1
7. gosub ln
8. next

the above loop I have not converted for now ....how can I convert that to graphical code for FC7 ? can I do that with LOOP command ?

1. busy_chk:
2. glcd_ce = 1
3. glcd_tris= %11111111
4. glcd_cd = 1
5. glcd_wr = 1
6. glcd_ce = 0
7. glcd_rd = 0
8. pauseus GL_PAUSE
9. if (glcd_sta0 <> 1) AND (glcd_sta1 <> 1) then busy_chk
10. glcd_rd = 1
11. glcd_ce = 1
12. glcd_tris = %00000000
13. return

the above part of PBP code and some similar parts I have converted except the lines 3 and 12. I would like to know how can I set a port as input or output (tris=11111111, tris=00000000), at graphical FC7 . Must be use a C code or not ? ...mainly I use FC7 because my knowledge in C is limited...