Inferno #03
22 ноября 2002

Diploma - Diploma Alone Coder-a. Development of software for special logic analyzer. Comments on the text of the diploma.

<b>Diploma</b> - Diploma Alone Coder-a. Development of software for special logic analyzer. Comments on the text of the diploma.
      Commentary to the text of the diploma.

  Alone Coder


  I decided that it makes sense to publish
material of my thesis that it
not lost in vain. Suddenly, someone help?
However, the text of the diploma in its pure form little
useful, these can be in an Internet paddling with spades, so I 
- will be commented inside and out:)



            Let's start over again.


   In Institute (Ryazan State
Radio Engineering Academy) I went to
1997. My specialty was the "software computing
and Automated Systems (2204.00)

   Slowly elapsed time and ended heels course. We passed the 
state exam, and celebrated the last call. The second half of 
the fifth year left to write a diploma. 


               Practice.


   Diploma allowed to write by choice -
either on the issuing department (ILM) or
arbitrary enterprise. Some businesses are hung advertising, 
which invites you to graduate. I refused spelling variants in 
the department and went on to write a diploma RKB "Globe". It 
RCH is located very close to my house, and in the personnel 
department is working, my aunt, so the choice I should be clear 
to you:) The only caveat is that the company public, with the 
secrets, then there are a lot of He will not write. Can guess 
that no contract:) And spies, I hope not guess;)


   So I filled out the papers, got a pass and got a job and 
rukovoditelya.Mne given three topics to choose from, I chose 
the one which is closer to me - programming of single-chip 
microcomputer. Reference for this Computer gave me 
srazu.Nichego difficult to perceive it was not. 



  But I'm a little back from the topic and try to acquaint you 
with the people whose names are to meet in the text: 

  - Dunin Vladimir E. - Head of the diploma design.

  - Minaev Anton - works there
also strongly helped:)

  - Parfilova Nadezhda - Consultant of the Department.

  - Bystrov Tatiana - my sister.



   Was determined by the exact due date the cover sheet. On the 
sheet should have been collected signatures of three 
consultants. In essence, it was easy. Economist and ecologist 
painted by checking only that the diploma provides a chapter on 
their subject. Consultant diploma was enough to

easy to catch.

   The institute issued form the task and
cover sheet of the diploma, which was necessary
fill. After consulting with the VE, we completed the draft 
version, which I then showed NI and after a couple of comments 
transcribed without corrections. The difficulty was that the 
sheet job includes maintenance of the future of the diploma and 
a complete list of graphical material. Predict them, even when 
the degree not begun, it is extremely difficult. I had to 
improvise on the basis of ready-made, which certainly implied. 


       Degree designing.


   The text of the diploma was written in parts.

   The first part - the introduction and feasibility study (I 
do not even know how it stands for) was written before

Started during the externship. So decided to VE, and I think he 
was prav.Nado it was to start somewhere.


   Timing measurements also wrote
until the completion of the program, at least
chastichno.Eto had to do because he
summed theoretical basis for it, though
would be conditional. With a piece of software that meets
for the transmission / contraction, and I began to write the 
program, and it is over - not so too it was simple:) By the way,

eyed reader will notice in the program many turnovers inherent 
in purely Spectrum programming;) 

   Economic part, and BC must be
was consistent with the relevant faculty, and therefore they 
were written separately. And who wrote the earlier benefit in 
the sense that he had less than stand in line to the teacher:) 
Especially when you consider that both teachers it was 
necessary to look at the eyes of at least several times:)


   Of course, these two intricate part in the
NN percent were repeat corresponding to parts of the theses of 
past years. For instance, my part of BC moved from diploma 
Minaev, AS :) 

   Economic calculation - is quite complex.
The fact that calculated from the known
techniques (from library books) had to carefully adjust the 
values so that the blood from the nose, and the program pays 
for itself. That is, the cost as cheap as possible and would 
have positive economic returns. Moreover, to the settlement 
development time corresponded to the actual time of graduation 
design. 

   The remaining part of the note, I can not even
comment - do not remember anything of what events were 
associated with them! 8) One way or another, but received his 
secondary diploma size limit, not much hyped and not quite so 
pustoy.Printsipialnyh size limitations we did not set, but warn 
- Talmud write! For graphomania, however, been some loophole - 
know that in Word You can change how the font size and line 
spacing, and with them the width / height used by the page. No 
especially not cursed for failing to factory settings page, but 
Tanya somewhere got wind of a Standard, which should be guided. 
Page Setup my diploma, were these:



  Top margin: 1.5 cm;

  Bottom margin: 1,5 cm;

  Left margin: 2,5 cm;

  Right margin: 1.25 cm;

  Room - in the upper right corner (the distance from the top 
to the header - 0,75 cm, font Times 14). Contents - third

account page, unnumbered;

  Font for text: Times New Roman 14;

  Spacing: Bastard;

  Font for the programs: Courier New 10.

  Line spacing: Single;

  What is measured by the font size in Word,
I do not know:)


   The shell of the journal did not allow us to bring a diploma 
with all these parameters, therefore, all specific fonts, 
formatting, and t.p.pokazany color - it has even almost better 
than it was really! ;)



   After checking the consultant from the Department
(NI) revealed quite a few bugs and had to reprint and replace
50 pages. Diploma at the time was already
intertwined, and it undone again. Diploma
failed to pass in time, I was second
headman, who managed it:) True, then we
appointed a second term, but more rigid, to surrender the 
diploma with all signatures. After this date the diploma, we 
would see only the commission on the table during the defense. 


                Protection.


   We now consider my question. I
There were two examples of reports in electronic
form - a little more, a smaller one. I did not know what size 
should be my talk, so make sure you have written

what happened. An additional condition was also the fact that 
the report should be based on the posters, and must

provide links to all submitted posters (I have 7) in numerical 
order. What's worse, in the report should

demnstrirovatsya a clip of which was unknown to date. It was 
rumored that it could be anything - from animation to 
screenshots, switchable button. Y I had no animation, and even 
ideas about it (to represent the mouse poking through the 
options could not at least because my program is not an 
interface, by definition:)) but the screenshots I have not had 
too, for the same reasons, and I decided to collect pictures

from the text of a diploma and a few more illustrations (about 
ten in total). 

   So, the first version of speech does not refer
on the drawings or the posters:



     Report, Version 1 (8524 bytes)


                Introduction


  The subject of this graduation project is a software 
development for special logic analyzer.


  The logic analyzer is a device for reading the sequence of 
logic levels with several signal lines simultaneously. When 
This logic analyzer synchronizes beginning reading since the 
emergence of a given combination of signals. 

  Developed by the company RKB <Globe> specialized logic 
analyzer (abbreviated ALS) is designed to use in the process of 
setting up the equipment to be connected to the bus intermodule 
Interface (MMI), and is aimed at removing signals from the bus.



  With regard to this problem shortcomings mass-produced 
counterparts are:  - Cumbersome (eg, domestic

device  weighs 25 kgs)
 - Difficulty connecting to the bus (you need to put a lot of 
feelers)  - The inability to improve the device in the 
enterprise. 


  Feature of ALS is that in order to achieve portability, it is 
deprived of display unit, and the role of this device performs 
personal computer, connect to the SLA on the serial interface 
RS-232. 

  ALS is controlled by commands from
with PC, and returns the read data on
PC on the same serial port.

  ALS is based on a single-chip
microcomputer (abbreviated OEVM) AT89C52 firm
Atmel. This chip is part of the family
MCS-51, domestic counterparts - the family
MK51. In figure 2 shows the register
model, memory allocation and structural
scheme of the microcontroller.

  The microcontroller has 256 bytes of memory resident data 
(abbreviated to RAP) and 128 bytes of memory registers, special 
functions (abbreviated to RCF). Registers are available at a 
block of the RSF. The top half of the RAP is addressed only 
through indirect register adresatsii.Mikrokontroller has tools 
to work with single-bit data - some registers and addresses of 
the RAP allow addressing individual bits. There are four 8-bit 
bidirectional port. Line port P3 can be used to connect a 
serial interface and external interrupt sources. Through the 
lines of the ports P0, P2 to the microcontroller can be 
connected to external data memory (CPA) or an external memory 
commands. 


  Functional diagram of the device shown in figure 1.

[Ed: All figures are looking more]


  The signal taken from the bus, switched on
register. The control circuit provides strobes
write the contents of the register in the dual-port
OZU.Chastotu sets the timer / counter 1. Writing to RAM is 
terminated after the overflow Counter 3. Counter 3 runs after

the appearance of sync combinations, which detects the 
comparison circuit. Scheme is started after the overflow

Counter 2. The values ​​in the counters and in the scheme
comparison puts the microcontroller.


  The advantages of such a device ALS
is:

 - Fast and reliable connection -
ALS is connected to the bus through one of the slots.
 - User Interface - intuitive dialogue with the operator of 
logic analyzer through the PC.

 - Possibility of a database of signals that could allow, for 
example, to produce an automatic search for faults debugging of 
similar devices. 


           Problem Statement


  As part of the graduation project solved the problem of 
writing and debugging stand-alone programs for single-chip 
microcomputer controlling the operation of ALS. 

1. The program needs to communicate
with PC via serial interface
RS-232 with a speed of 19200 baud.
2. Format parcels between ALS and the PC should
comply with standards adopted by
enterprise.
3. The program must perform the following
main functions: starting and stopping measurement task 
measurement modes, transfer measurement data on PC, 
self-control and issuance of state of the logic analyzer.

4. All actions should be carried on
commands sent from a PC.


               Implementation


  After starting and initializing the program
should enter into an endless cycle of receiving and
message processing. This is shown in bloksheme general 
algorithm in figure 3. Messages are received by staff, so there 
an algorithm for receiving a frame with error handling, as well 
as the structure of the frame. 

  On command  supplied with the PC, the 
program enters the given initial values ​​of timers, counters 
and comparison circuit, and then runs

control circuit reading in memory.

  ALS has several modes of synchronization run: when syncing 
combination occurs at the beginning, the middle or at the end 
of measurement interval. Can also start with a delay after the 
sync combinations. Processing program for  
recounts the input data - the parameters of this command, filed 
with the PC, the parameters of the comparison circuit and the 
initial values ​​of timers, and then issues a control circuit 
pulse . This algorithm and the structure of the frame 
command  listed on the poster 4.



  Reading or stops automatically after receiving the required 
number of points, or suspended from the team of PC . 

  While waiting for the end of the reading
PC sends queries about the state of the logic analyzer.

  After the data from the bus to the RAM
accesses mikrokontroller.Po team
<Read channel> or <to read the RAM> measurement data are 
transmitted to the PC. 


  Calculation of the total measurement time (which
included, including waiting time start
and the time of the request and response
messages) showed that in the process of transferring
Measurement data is desirable to use
compression (ie compression). On the basis of methods RLE my 
method was developed specifically for the compression of such 
information, and the optimal implementation at this 
микроконтроллере.Результаты timing measurements are shown in 
the drawing 5.


  Graphs show the dependence of the measurement of the relative 
frequency of the measured signal. Signal with a higher average 
frequency of less packed by this method before sending occurs 
counting the number of edges in the signal at interval 
measurement, and if that number exceeds the limit, the transfer 
takes place without compression. And if the signal is constant, 
then it is encoded by a single byte. 

  Compression takes place in parallel with data transmission at 
PEVM.Algoritm shown in the drawing 6. 

  Initially, the analysis is correct
command parameters, there is statistical analysis of the signal 
if it has not been made. Based on this analysis, selected 
encoding method (compressed or uncompressed). Compression 
occurs in increments of 128 bytes. Encoded sequences of length

identical bit.Dlya improve the speed of the main loop (since 
counting of the length of the sequence must be placed in the 
time between sending bytes) cycles counting zeros and ones are 
implemented separately. 


      Conclusion (Economics, BiEP)


  In the economic part of the estimated costs to develop the 
device, and calculated the payback period of development. The 
results of the calculation of return are shown in figure 7. 

  Under safety and environmental
Project analysis of working conditions on
operator's workplace. Conclusions on
conditioning facilities and are
the necessary calculations.


                  ***


  Unfortunately, at present the system
adjustment based on the special logic analyzer is not fully 
developed. A prototype device has not yet assembled, that did 
not allow for verification in full obeme.Programma debugged on 
a model with a software interpreter, and a special program 
generator testing sequence, written

in Delphi. The results are shown in debug
note.


  Advantage of the development of devices for
single-chip microcomputer is:
 - Ease of hardware and therefore
ease of setup.
 - Paralleling the development. One developer can design the 
hardware part, the other - a program for the microcontroller, 
the third - a program for managing PC.

 - Flexibility - the ability to modify and
expanding the functions of software.


   Continuation of this work will be integrated debugging 
program in the device, as well as possible modifications and 
extension functions. 



   The institute found that button to switch the picture is not 
good (in the sense of no way), that is not going anywhere, and 
automate the process is necessary. The difficulty was found in 
the fact that the program-demonstrator was not mine, and Minaev 
(which is good disappear, poyuzat last year:). Then

Minaev gave me the source code, and with them a lot
non-standard components for Delphi, which still must be set, 
and without them the program does not compile! Put a timer 
Fixed ... 

   Time allotted for presentation is 7 minutes. I read a report 
from the screen and decided that 7 minutes is enough. 
Nevertheless, as soon as I try to tell it by heart (without 
notes, according to the requirements requirements), and I 
realized that the text is too much:)


   In the first place I started to cut the long strings of 
words in trudnozapominayuschihsya phrases, as well as deleted 
some paragraphs, for example, the conclusions in the end. 

   Struck out and began to teach ...

   I have a bad memory for text (I'm bad
bison;), so I have room (usually the beginning of paragraphs), 
which stumbles and does not Remember, what's next. (You have to 
wind on the conditions, then the very useful:)) I've marked 
these place a piece of paper with an exclamation mark and

taught separately. Then set up the links to
posters (number two posters had to swap) and the images in the 
demo clip, based on their assumption that they will vary 
uniformly (30 seconds for each of the 13 images). That is the 
defense from time to time I like to put the blame on the 
screen. Based on the same assumptions, I threw parts of the 
text is not suitable to the pictures (and not sorry:) 

   So, the point in the text, corresponding to the beginning 
demontratsii posters, I marked in figures. Roll out posters on 
the table and take turns taking turn, tried to tell it.


   Pictures allocated approximately as follows: first hanging 
header, then - when told about him - "Analyzer 825", then - 
Figure AT89C52 body of documentation, in time display of the 
functional schemes - the block diagram, then a long passage 
illustrates a screenshot of the assembler, then - a table of 
commands and requests, a paragraph about compression should was 
to illustrate the scheme of compression format, next - 
screenshots of the debugging process and end - the final title.


   This report is substantially less than the previous one:



     Report, Version 2 (5173 bytes)


  The logic analyzer is a device for reading the sequence of 
logic levels from multiple signal lines at a time, starting 
from the appearance of a given synchronizing signal 
combinations. Developed by the company RKB <Globe> a dedicated 
logic analyzer (Abbreviated ALS) is designed for use in the 
process of setting up equipment, connected to the bus 
intermodule interface (MMI), and focuses on the removal of 
signals from the bus. 

  With regard to this problem shortcomings mass-produced 
counterparts are:  - Cumbersome (eg, domestic

device  weighs 25 kgs)
 - Difficulty connecting to the bus (you need to put a lot of 
feelers)  - The inability to improve the device in the 
enterprise. 


  Feature of ALS is that in order to achieve portability 
display unit performs the role of personal computers. 

Pattern 1



  ALS is based on a single-chip
microcomputer AT89C52 from Atmel microcontroller has 256 bytes 
of resident memory data. There are four bidirectional 
8razryadnyh porta.Linii port P3 may be used to connect a serial 
interface and external interrupt sources. Through the lines of 
the ports P0, P2 to the microcontroller can be connected to 
external data memory or external memory commands. 


  Functional diagram of the device shown in the drawing

Figure 2



  The signal taken from the bus, switched on
register. The control circuit provides strobes
write the contents of the register in the dual-port
RAM. Frequency sets the timer / counter 1. Writing to RAM is 
terminated after the overflow Counter 3. Counter 3 runs after

the appearance of sync combinations, which detects the 
comparison circuit. Scheme is started after the overflow

Counter 2. The values ​​in the counters and in the scheme
comparison puts the microcontroller.


  ALS is an advantage:
 - Fast and reliable connection -
through the connector.
 - A vivid dialogue with the logic analyzer operator through 
the PC.  - The possibility of compiling databases signal - you 
can automate the set-up similar devices.



  As part of the graduation project solved the problem of 
writing and debugging stand-alone programs for single-chip 
microcomputer controlling the operation SLA.Programma needs to 
communicate with PC via serial interface RS-232 with a speed of 
19200 baud. Main functions: starting and stop measurement, job 
measurement mode, the transfer of measurement data on PC, 
self-control and issuance of state of a logical analyzer.


Figure 3



  After starting and initializing the program
should enter into an endless cycle of receiving and
message processing. This is shown in bloksheme general 
algorithm for drawing Messages taken shots, so there an 
algorithm for receiving a frame with error handling, as well as 
the structure of the frame. 

  ALS has several modes of synchronization run: when syncing 
combination occurs at the beginning, the middle or at the end 
of the interval izmereniya.Vozmozhen also start with a delay 
after the sync command processing kombinatsii.Programma  recounts the command parameters to the parameters of 
comparator and the initial values ​​of timers, and then

provides for the control circuit pulse .

Drawing 4



  After the data from the bus to the RAM
accesses mikrokontroller.Po team
<Read channel> or <to read the RAM> measurement data are 
transmitted to the PC. 

Drawing 5



   Calculation of the total measurement time showed that in the 
transmission of measurement data it is desirable to use 
compression. On RLE-based methods I have developed a method 
specifically designed for compression such information, and 
optimal implementation on this microcontroller.


  Graphs show the dependence of the measurement of the relative 
frequency of the measured signal. Signal with a higher average 
frequency of less packed by this method before sending occurs 
counting the number of edges in the signal at interval 
measurement, and if that number exceeds the limit, the transfer 
takes place without compression. And if the signal is constant, 
then it is encoded by a single byte. 

  Compression takes place in parallel with data transfer on the 
PC. The algorithm is shown in drawing


Drawing 6



  Compression occurs in increments of 128
bits. Encoded sequences of length
identical bit.Dlya increase the speed of the inner loop (since 
it must fit within the time interval between the transmission 
of bytes) cycle counting zeros and ones implemented separately.



  Standalone Debugging was done using software and a special 
interpreter program generator testing sequence, written in 
Delphi and including content analysis of response messages 
SLA.Rezultaty debugging are listed in work.



  In the economic part of the estimated costs to develop the 
device, and calculated the payback period of development. The 
results of the calculation of return shown in the drawing. 

Figure 7



  A prototype device has not yet sobran.Prodolzheniem this work 
will be integrated debugging program in the device, as well as 
possible modifications and extension functions. 

  In this report is finished!



  I caught my mother and began to express intelligibly
text. In the third attempt turned out:) Just last managed to do 
without interruptions and digressions. Then I caught and

Tanya - said the report, and to her. You are:)

  Remained not forget it until tomorrow;)

   I went to college with a new, synchronized by a report 
version of roller, and that Interestingly, it does not work! 
The reason was only in the fact that the mine and 
soriginalnichal supplied the process of switching pages by 
clicking on an available audio device, with absence - on the 
speaker. Through the port. And under wINDOWS nt did not hire, 
who knew! Had to run home, fix and carry

back!


              The next day ...


   The list on the protection of that day I was
recorded first. So I was deprived of
useful pleasure to listen to others ...

   We had to defend the four. A
precisely alike.

   There were two stands for the posters. At each stand fits 
six. (My seventh a poster with the economic calculation had

attach with overlap and, in addition, to lower to the floor.) 
Prior to protect all four stick their posters the stands, 
includes the commission, remains first speaker, explains the 
commission their work, answers questions and goes. Come two 
young men from the undergraduates, turn stand, leave the room, 
immediately enters the second Rapporteur defends leaves. The 
Commission also takes a rest, but can still admire

posters. Two at this time becoming the second
stand at the place first. Then - protected
third and fourth students, and, finally, the Commission takes 
the mark. When she returns, happy students are arranged in line 
and congratulate you on receiving the honorary title of an 
engineer:) Of course, diploma will be given later:)



   So, we have placed posters on the stands
(In this case, of course, did not have enough buttons)
and I was left to defend themselves.

   The room was a commission and an operator. Commission - all 
of our teachers, all its own, but I still was not

yourself;) The first words I choked and
have not spoken with his voice, but then was able to align and 
spoke uverennee.V Pictures demos I did not get - or rather, got 
only the first one, an oscilloscope, to say the same 
excitement, but in the allotted time to meet! And that is half 
successful defense:) One person from our group could not get 
the diploma, precisely because no able to read a good report! 
(But I have something graduated with honors and did not shine;))


   Commission questions were constructed as follows
manner.

   First it was read by the head tip
diploma projects (positive).

   Then was read a review (negative), and I was asked to 
comment on why the text is not formalized program documentation 
(hint: it should be made out, no one knows;), and

Why do not the results of debugging.

   Retsentsiyu I do read it, so we have argued that the program 
documentation will be issued after a comprehensive debugging

and in the attached explanatory note is available with the 
listing and a list of procedures, also noted that the results 
AUTONOMOUS debug text all the same shows, and complex can take 
place only after assembly model of the device, no more, no less.


   Nobody was arguing, and I still
drew attention to the shortcomings of
(One of the commissioners was obliged to read the diploma). 
Shortcomings were as follows: 

 1. A list of abbreviations is given at the end,
which is inconvenient. I agreed.
 2. Shown in one of the sheets blokshema algorithm has no 
access (that disorder, as immediately noticed was present 
teacher structured programming). I objected because the program 
is a firmware ROM, from which no way out. And what relief, they 
asked me? 


   At the same time claim ended.



  I must say that in fact, the diploma was more disadvantages, 
many of which I discovered only now%) are mostly mistakes and 
carelessness in the design: 


  - The content of the sub-fourth chapter numbered as 1.1, 1.2, 
etc. (Note that this error - even at 4-th page of notes!)


  - Some tables remained unnumbered.

  - Some of the bit on the tires shown in the functional 
diagram of ALS, are wrong. 

  - The program is an oversight - perhaps in some cases, 
incorrectly determined the length of the block transfer. 

  - (Very funny:) no 71-72
page! Coredump found at the intersection of two areas of a 
document with independent pagination (so, apparently, wanted to 
Word;), and the numbering went at the first opportunity, has 
not helped even check in three pairs of eyes before you print!




   Next to start their own questions. The Commission could not 
talk with students long, and so were asked only superficial 
nature: 


  1. How was it this chip?

  2. Why chose this particular compression algorithm? Worse 
than Huffman? (Explanation from the text, I just sounded it.)


  3. Why not use high level languages?


   Everything was predictable, so the answer was not so hard:)

   And I put the top five:)


               Happy end!

        I wish you success in defending!


                        Alone Coder 7ix02





Other articles:

Softinka - New version 8 tricolor editor color editor v 0.04. Improvement, test results and a list of changes.

Inferno - On the shell.

Diploma - Diploma Alone Coder-a. Development of software for special logic analyzer. Comments on the text of the diploma.

Diploma - Diploma Alone Coder-a. Development of software for special logic analyzer. Part 1.

Diploma - Diploma Alone Coder-a. Development of software for special logic analyzer. Part 2.

Diploma - Diploma Alone Coder-a. Development of software for special logic analyzer. Part 3.

Diploma - Diploma Alone Coder-a. Development of software for special logic analyzer. Part 4.

Inferno - Introduction by the editors.

Inferno - The authors of the magazine.

Reflections - Visiting Cristobal junta. Methodology to evaluate fiction and inventing new ways of fantastic ideas.

Reflections - How to become a writer. Leadership.

Inferno - Letters to the Editor.

Poetry - Verse, "Who am I?"

Opportunities Spectrum - Pseudo-Color: Myth or Reality? Algorithm translation in black and white in color.

Gamedev - WORM-255F. Python game code size of 255 bytes with the comments.

Humor - Literary anecdotes.


Темы: Игры, Программное обеспечение, Пресса, Аппаратное обеспечение, Сеть, Демосцена, Люди, Программирование

Similar articles:
Entry - the contents of rooms.

В этот день...   30 April