• Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Flow Charting Software

Inquisitive

Super Moderator
#21
I have no affiliation with yEd.

yEd can easily add/append extra flow chart items as needed. With a minimum amount of fuss and tinkering. Groups of symbols can be moved at will with flow lines being maintained.
 

jpanhalt

Well-Known Member
Most Helpful Member
Thread starter #22
Hi,

It was not just about writing software though if someone knew of something already out there.
See Ian's post right after yours.
Well, I am still skeptical about any flowchart software converting a chart to Assembly code -- assuming one uses English and does not simply enter the Assembly instructions in sequence. Attached is a pdf of a flowchart I did awhile ago for some code from a well known member here for a GLCD.

I would like to see the Assembly results from only a small part of that chart that involves branches. Device = Mid-range PIC

John
 

Attachments

jpanhalt

Well-Known Member
Most Helpful Member
Thread starter #23
Had some time this morning so I tried yEd. Instruction manual is pretty meager, but the program is intuitive with a few "personalities" of its own. Bottom line, here is my first effort after about 1 hour (maybe I am a slow learner): Read Switch.pdf

Would love to see the Assembly code made by Great Cow Basic for a part of that or the LCD initialization.

As for yEd, I am still using the online version.

John

Edit:
MCU = PIC16F1829
Switches are on PortB , SW1=RB5, SW2=RB7, both are positive edge IOC, "flag" =IOCBF, interrupts not enabled
Print = common 2x16 serial LCD ("Put232")
 

Attachments

Last edited:

Ian Rogers

User Extraordinaire
Forum Supporter
Most Helpful Member
#24
Here is the graphical interface.
Capture.jpg

Here is the code generated.

Code:
;Program compiled by Great Cow BASIC (0.98.01 2017-10-27)
;Need help? See the GCBASIC forums at http://sourceforge.net/projects/gcbasic/forums,
;check the documentation or email w_cholmondeley at users dot sourceforge dot net.
;********************************************************************************
;Set up the assembler options (Chip type, clock source, other bits and pieces)
 LIST p=16F628A, r=DEC
#include <P16F628A.inc>
 __CONFIG _LVP_OFF & _BOREN_OFF & _MCLRE_OFF & _PWRTE_OFF & _WDTE_OFF & _FOSC_INTOSCIO
;********************************************************************************
;Vectors
 ORG 0
 pagesel BASPROGRAMSTART
 goto BASPROGRAMSTART
 ORG 4
 retfie
;********************************************************************************
;Start of program memory page 0
 ORG 5
BASPROGRAMSTART
;Call initialisation routines
 call INITSYS
;Automatic pin direction setting
 banksel TRISB
 bcf TRISB,0
;Start of the main program
 bsf TRISA,1
SysDoLoop_S1
 banksel PORTA
 btfss PORTA,1
 goto ELSE1_1
 bsf PORTB,0
 goto ENDIF1
ELSE1_1
 bcf PORTB,0
ENDIF1
 goto SysDoLoop_S1
SysDoLoop_E1
BASPROGRAMEND
 sleep
 goto BASPROGRAMEND
;********************************************************************************
INITSYS
 movlw 7
 movwf CMCON
 clrf PORTA
 clrf PORTB
 return
;********************************************************************************

 END
 

jpanhalt

Well-Known Member
Most Helpful Member
Thread starter #25
:D:D
That might be the first time I have used sequential emoticons. Or, to paraphrase a recent American President, if you like it, you can keep it.;)

upload_2018-2-2_10-45-4.png

It looks to me like ordinary Assembly in Disney Technicolor .

Seriously, thanks for doing it. I suspected it would be something like that.

John
 

jpanhalt

Well-Known Member
Most Helpful Member
Thread starter #26
Just FYI here's my rough code for the flow chart in post #23. John
Code:
GetCode
     movlw     0xF0                ;avoids use of "count" register
     movwf     temp                ;put counter in temp
     movlb     0                   ;not necessary -- already |B0
     movlw     0x0C                ;form feed
     call      Put232              ;clear screen cursor at 0,0
     DelayCy   (5*msecs)
     StrPrint  "Enter Code: "      ;12 char +4 code, advances to line 1,0
_Code                            
     lslf      temp,f    
     movlb     7                   ;check IOC flags                      
     clrf      IOCBF
     btfss     INTCON,IOCIF        ;wait for button push
     bra       $-1
     call      Debounce            ;short delay (optional)
     movlw     0x01
     btfss     IOCBF,SW1           ;not messed up if >1 switch set
     bcf       WREG,0  
     addwf     temp,f
     addlw     0x30
     call      Put232              ;print 0 or 1 , returns in |B0
NextBit                      
     movf      PORTB,w
     andlw     0xA0                ;mask all but SW1(5) and SW2(7)
     btfss     STATUS,2            ;test for release of both switches
     bra       $-3                 ;wait for release
     movlb     7
     clrf      IOCBF               ;clears INTCON,IOCIF too
     btfsc     temp,7
     bra       _Code
     call      Confirm?            ;prints & returns with flag0,0 set(yes) or clear(no)
     btfss     flag0,0
     goto      Main                ;exit to Main
     bra       PutMode
PutMode
     movf      temp,w
     brw
     goto      Default             ;return all registers to default, Status: untested
;and so forth
 

MrAl

Well-Known Member
Most Helpful Member
#27
Hello again,

Maybe they didnt do the greatest job with that software, but this kind of thing is definitely something that can be done.
With software for something like this you go from one abstraction layer to the next, each time getting closer to the target platform.
With pseudo code, the next layer would be the target itself. The pseudo code is just another layer that goes from whatever form you need to a form that can be translated into any language.

What bothered me about ASM was too much attention to detail was required, but with C there was not enough detail. So i set out to create a language that had benefits of C while maintaining enough detail to be able to read sort of like C. Here is an example of some code...
byte A,B
int16 C

A=PortA
B=A+2
C=ReadAnalog(12)
B>C?
Goto Next

The main point though is that it can translate this into ASM, and so the only thing a flow chart program has to do is either:
1. Read the graph and generate the code as it finds the objects and connections,
or:
2. Keep track of objects and connections as they are created.

It's not super easy to create a program like this, but it is definitely possible. A circuit simulator program does just this and on top of that has to solve the resulting equations. The circuit simulator program i wrote myself does just this. It 'reads' the schematic and that tells it what objects are in there as well as how they are connected. The first thing it does then is create a net list, and that is the "pseudo code" for that kind of application. So a flow graph would actually be easier to do than that.

The hard part is the graphical user interface, everything else is cake. The GUI is hardest because you want to give the user a lot of options as to how they can draw their objects and manipulate them without taking too much time.
 

eTech

Active Member
#28
Hi

Interesting posts...but what about going the other way?
Suppose you have code and want to create a flowchart. Is there any software that will read the code and produce a flowchart?

eT
 

MrAl

Well-Known Member
Most Helpful Member
#29
Hi

Interesting posts...but what about going the other way?
Suppose you have code and want to create a flowchart. Is there any software that will read the code and produce a flowchart?

eT
Hi,

Yes interesting idea. Dont know of any myself yet though.
 

Latest threads

EE World Online Articles

Loading

 
Top