Xreferat.com » Рефераты по информатике и программированию » Віртуальний вимірювальний комплекс на базі учбового лабораторного стенду EV 8031

Віртуальний вимірювальний комплекс на базі учбового лабораторного стенду EV 8031

s1 + s[i];


buf[index] := StrToHex(MaskEdit1.Text);

s2 := s2 + s1;

ListBox1.Items.Strings[index] := s2;

end;


procedure TForm2.MaskEdit2KeyPress(Sender: TObject; var Key: Char);

var

i,j:integer;

s,s1:string;

begin

if not((Key >= '0') and (Key <= '9') or

(Key = #13)) then

Key := ' ';

if Key = #13 then

begin

ListBox1.Clear;

for i := 0 to count-1 do

begin

s := Format('%x',[i]);

for j := 1 to 3-length(s) do

s1 := s1 + '0';

for j := 1 to length(s) do

s1 := s1 + s[j];

ListBox1.Items.Add(s1+':00');

s1 := '';

end;

end;

end;


procedure TForm2.MaskEdit2Change(Sender: TObject);

var

i:integer;

s,s1:string;

begin

s1 := '';

s := MaskEdit2.Text;

if s <> '' then

for i := 1 to length(s) do

if s[i] <> ' ' then s1 := s1 + s[i];

if s1 <> '' then

begin

if (StrToInt(s1) > 1024) then

begin

MaskEdit2.Text := '1024';

count := 1024;

end;

count := StrToInt(s1);

end;

end;


function TForm2.StrToHex(str:string):integer;

var

i,num:integer;

begin

num := 0;

if (length(str) > 0) and (length(str) < 5) then

for i := length(str) downto 1 do

begin

if ((str[i] >= '0')and(str[i] <= '9')) then

num := num + (byte(str[i])-byte('0'))shl(4*(length(str)-i));

if ((str[i] >= 'A')and(str[i] <= 'F')) then

num := num + (byte(str[i])-byte('A')+10)shl(4*(length(str)-i));

if ((str[i] >= 'a')and(str[i] <= 'f')) then

num := num + (byte(str[i])-byte('a')+10)shl(4*(length(str)-i));

end;

StrToHex := num;

end;


procedure TForm2.MaskEdit3KeyPress(Sender: TObject; var Key: Char);

begin

if not(((Key >= '0') and (Key <= '9')) or

((Key >= 'A') and (Key <= 'F')) or

((Key >= 'a') and (Key <= 'f'))) then

Key := ' ';

if (Key >= 'a') and (Key <= 'f') then

Key := UpCase(Key);

end;


procedure TForm2.MaskEdit4KeyPress(Sender: TObject; var Key: Char);

begin

if not(((Key >= '0') and (Key <= '9')) or

((Key >= 'A') and (Key <= 'F')) or

((Key >= 'a') and (Key <= 'f'))) then

Key := ' ';

if (Key >= 'a') and (Key <= 'f') then

Key := UpCase(Key);

end;


procedure TForm2.MaskEdit4Change(Sender: TObject);

begin

if MaskEdit4.Text <> '' then

begin

if StrToHex(MaskEdit4.Text) > count-1 then

MaskEdit4.Text := Format('%3x', [count-1]);

if StrToHex(MaskEdit4.Text) < StrToHex(MaskEdit3.Text) then

MaskEdit4.Text := MaskEdit3.Text;

end;

end;


procedure TForm2.MaskEdit3Change(Sender: TObject);

begin

if MaskEdit3.Text <> '' then

begin

if StrToHex(MaskEdit3.Text) > count-1 then

MaskEdit3.Text := Format('%3x', [count-1]);

if StrToHex(MaskEdit4.Text) < StrToHex(MaskEdit3.Text) then

MaskEdit3.Text := MaskEdit4.Text;

end;

end;


procedure TForm2.BitBtn1Click(Sender: TObject);

var

i:integer;

//a:array[1..]

begin

BitBtn1.Enabled := False;

BitBtn2.Enabled := True;

//Form1.SerialPortNG1.SendData();

Form1.SerialPortNG1.SendData(@buf[StrToHex(MaskEdit3.Text)],StrToHex(MaskEdit4.Text)-StrToHex(MaskEdit3.Text));

end;


procedure TForm2.BitBtn2Click(Sender: TObject);

begin

BitBtn1.Enabled := True;

BitBtn2.Enabled := False;

end;


end.

3 Текст програмного модуля головного вікна ВВК, , Unit3.pas


Ім’я данного файлу : Unit3.pas

Функціональне призначення : програмне забеспечення ПК, модуль головного вікна ВВК

Файл створений для дипломного проекта захисту кваліфікації фахівця

За фахом : Системне програмування;

Тема проекту : Віртуальний вимірювальний комплекс на базі учбового лабораторного стенду;

Керівник : М.В. Скородєлов, викладач кафедри ОТП;

Розробник : О.О. Ісмаілов, студент групи КІТ-23а;

Рік розробки : 2009.


unit Unit3;


interface


uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls, Buttons;


type TForm3 = class(TForm)

BitBtn1: TBitBtn;

BitBtn2: TBitBtn;

BitBtn3: TBitBtn;

BitBtn4: TBitBtn;

Label1: TLabel;

procedure BitBtn1Click(Sender: TObject);

procedure BitBtn2Click(Sender: TObject);

private

{ Private declarations }

public

{ Public declarations }

end;


var Form3: TForm3;


implementation


uses Unit1, Unit2;


{$R *.dfm}


procedure TForm3.BitBtn1Click(Sender: TObject);

begin

Form1.Visible := True;

end;


procedure TForm3.BitBtn2Click(Sender: TObject);

begin

Form2.Visible := true;

end;


end.

2 ТЕКСТ ПРОГРАМНОГО ЗАБЕСПЕЧЕННЯ МК


2.1 Текст програмного забеспечення ВВК мікроконтроллера, main.asm


Ім’я данного файлу : main.asm

Функціональне призначення : програмне забеспечення ПК, модуль логічного аналізатора

Файл створений для дипломного проекта захисту кваліфікації фахівця

За фахом : Системне програмування;

Тема проекту : Віртуальний вимірювальний комплекс на базі учбового лабораторного стенду;

Керівник : М.В. Скородєлов, викладач кафедри ОТП;

Розробник : О.О. Ісмаілов, студент групи КІТ-23а;

Рік розробки : 2009.


#include <m8515def.inc>


.def tmp = r16

.def tmp1 = r17

.def RX_flag = r18

.def RX_Counter = r19

.def RX_Complete = r20

.def command = r21

.def tmp2 = r22

.def tmp3 = r23


.equ UC_REG = 0xC000

.equ RX_Buffer = 0x7C00


.macro USART_TRANSMITT_M

utm_l0:

wdr

sbis UCSRA, UDRE

rjmp utm_l0

out UDR, tmp

.endm


.macro WAIT_PUSK

mov tmp, command

andi tmp, 0b00010000

brne wp_l5

mov tmp, command

andi tmp, 0b00001110

lsr tmp

ldi tmp1, 1

wp_l0:

cpi tmp, 0

breq wp_l1

lsl tmp1

dec tmp

brne wp_l0

wp_l1:

mov tmp, command

andi tmp, 0b00000001

brne wp_l2

wp_l3:

wdr

in tmp2, PINB

and tmp2, tmp1

brne wp_l3

wp_l4:

wdr

in tmp2, PINB

and tmp2, tmp1

breq wp_l4

rjmp wp_l5

wp_l2:

wdr

in tmp2, PINB

and tmp2, tmp1

breq wp_l2

wp_l6:

wdr

in tmp2, PINB

and tmp2, tmp1

brne wp_l6

wp_l5:

.endm


.macro ANALYZE_CLK_6

ac6_l0:

in tmp, PINB // 1 cycle

st Y+, tmp // 2 cycle

dec tmp3 // 1 cycle

brne ac6_l0 // 2 cycles or

// 1 cycle

dec tmp3 // 1 cycle

ac6_l1:

in tmp, PINB // 1 cycle

st Y+, tmp // 2 cycle

dec tmp3 // 1 cycle

brne ac6_l1 // 2 cycles

dec tmp3

in tmp, PINB // 1 cycle

st Y+, tmp // 2 cycle

.endm


.macro ANALYZE_CLK_8

ac8_l0:

in tmp, PINB // 1 cycle

st Y+, tmp // 2 cycle

nop // +2 cyle

nop

dec tmp3 // 1 cycle

brne ac8_l0 // 2 cycles or

// 1 cycle

dec tmp3 // 1 cycle

ac8_l1:

in tmp, PINB // 1 cycle

st Y+, tmp // 2 cycle

nop // +2 cyle

nop

dec tmp3 // 1 cycle

brne ac8_l1 // 2 cycles

dec tmp3

in tmp, PINB // 1 cycle

st Y+, tmp // 2 cycle

.endm


.macro ANALYZE_CLK_16

ac16_l0:

in tmp, PINB // 1 cycle

st Y+, tmp // 2 cycle


ldi tmp1, 3 // +10 cyle

ac16_l2:

dec tmp1

brne ac16_l2

nop


dec tmp3 // 1 cycle

brne ac16_l0 // 2 cycles or

// 1 cycle

dec tmp3 // 1 cycle

ac16_l1:

in tmp, PINB // 1 cycle

st Y+, tmp // 2 cycle


ldi tmp1, 3 // +10 cyle

ac16_l3:

dec tmp1

brne ac16_l3

nop


dec tmp3 // 1 cycle

brne ac16_l1 // 2 cycles


dec tmp3

in tmp, PINB // 1 cycle

st Y+, tmp // 2 cycle

.endm


.macro ANALYZE_CLK_32

ac32_l0:

in tmp, PINB // 1 cycle

st Y+, tmp // 2 cycle


ldi tmp1, 8 // +26 cyle

ac32_l2:

dec tmp1

brne ac32_l2

nop

nop

dec tmp3 // 1 cycle

brne ac32_l0 // 2 cycles or

// 1 cycle

dec tmp3 // 1 cycle

ac32_l1:

in tmp, PINB // 1 cycle

st Y+, tmp // 2 cycle


ldi tmp1, 8 // +26 cyle

ac32_l3:

dec tmp1

brne ac32_l3

nop

nop


dec tmp3 // 1 cycle

brne ac32_l3 // 2 cycles


dec tmp3

in tmp, PINB // 1 cycle

st Y+, tmp // 2 cycle

.endm


.macro ANALYZE_CLK_64

ac64_l0:

in tmp, PINB // 1 cycle

st Y+, tmp // 2 cycle


ldi tmp1, 19 // +58 cyle

ac64_l2:

dec tmp1

brne ac64_l2

nop


dec tmp3 // 1 cycle

brne ac64_l0 // 2 cycles or

// 1 cycle

dec tmp3 // 1 cycle

ac64_l1:

in tmp, PINB // 1 cycle

st Y+, tmp // 2 cycle


ldi tmp1, 19 // +58 cyle

ac64_l3:

dec tmp1

brne ac64_l3

nop


dec tmp3 // 1 cycle

brne ac64_l1 // 2 cycles


dec tmp3

in tmp, PINB // 1 cycle

st Y+, tmp // 2 cycle

.endm


.macro ANALYZE_CLK_128

ac128_l0:

in tmp, PINB // 1 cycle

st Y+, tmp // 2 cycle


ldi tmp1, 40 // +122 cyle

ac128_l2:

dec tmp1

brne ac128_l2

nop

nop


dec tmp3 // 1 cycle

brne ac128_l0 // 2 cycles or

// 1 cycle

dec tmp3 // 1 cycle

ac128_l1:

in tmp, PINB // 1 cycle

st Y+, tmp // 2 cycle

ldi tmp1, 40 // +122 cyle

ac128_l3:

dec tmp1

brne ac128_l3

nop

nop


dec tmp3 // 1 cycle

brne ac128_l1 // 2 cycles


dec tmp3

in tmp, PINB // 1 cycle

st Y+, tmp // 2 cycle

.endm


.macro ANALYZE_CLK_256

ac256_l0:

in tmp, PINB // 1 cycle

st Y+, tmp // 2 cycle


Если Вам нужна помощь с академической работой (курсовая, контрольная, диплом, реферат и т.д.), обратитесь к нашим специалистам. Более 90000 специалистов готовы Вам помочь.
Бесплатные корректировки и доработки. Бесплатная оценка стоимости работы.

Поможем написать работу на аналогичную тему

Получить выполненную работу или консультацию специалиста по вашему учебному проекту
Нужна помощь в написании работы?
Мы - биржа профессиональных авторов (преподавателей и доцентов вузов). Пишем статьи РИНЦ, ВАК, Scopus. Помогаем в публикации. Правки вносим бесплатно.

Похожие рефераты: