0% found this document useful (0 votes)
200 views30 pages

Se FCNTR

The document describes a universal counter board that can count frequencies from 100 MHz to 2.4 GHz. It uses an 8051 microcontroller running at 100 MHz along with 74F161 and 74HC393 chips to count the input signal and display the reading on 7-segment displays. The 8051 timer is used to measure signals down to 1 microsecond resolution at its maximum clock frequency of 24 MHz from the crystal oscillator. For higher frequencies up to 100 MHz, it uses prescaling. For frequencies up to 2.4 GHz, it employs a 64 prescaler.

Uploaded by

cdtk5
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
200 views30 pages

Se FCNTR

The document describes a universal counter board that can count frequencies from 100 MHz to 2.4 GHz. It uses an 8051 microcontroller running at 100 MHz along with 74F161 and 74HC393 chips to count the input signal and display the reading on 7-segment displays. The 8051 timer is used to measure signals down to 1 microsecond resolution at its maximum clock frequency of 24 MHz from the crystal oscillator. For higher frequencies up to 100 MHz, it uses prescaling. For frequencies up to 2.4 GHz, it employs a 64 prescaler.

Uploaded by

cdtk5
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 30

SE-FCNTR http://www.sample.co.kr/sefcntr/index.

htm

100 MHz /
8051 8 100MHz .
Crossware 8051 ANSI C .

24MHz 8051 XTAL1


24000000 .1
16 10 12 ~ 48 .
8 FND .

8051 16 12 (74F161 4 , 74HC393 8 ) 28 8


100MHz .

1 trong 30 03/01/2011 9:31 CH


SE-FCNTR http://www.sample.co.kr/sefcntr/index.htm

1 99.999999 8 .

2 trong 30 03/01/2011 9:31 CH


SE-FCNTR http://www.sample.co.kr/sefcntr/index.htm

100MHz 2.4G 64

3 trong 30 03/01/2011 9:31 CH


SE-FCNTR http://www.sample.co.kr/sefcntr/index.htm

TI 120MHz 4 SN74F161 .

4 trong 30 03/01/2011 9:31 CH


SE-FCNTR http://www.sample.co.kr/sefcntr/index.htm

Hold , MHz/GHz

FND .

5 trong 30 03/01/2011 9:31 CH


SE-FCNTR http://www.sample.co.kr/sefcntr/index.htm

PCB .

6 trong 30 03/01/2011 9:31 CH


SE-FCNTR http://www.sample.co.kr/sefcntr/index.htm

7 trong 30 03/01/2011 9:31 CH


SE-FCNTR http://www.sample.co.kr/sefcntr/index.htm

SE-FCNTR 8051 . 100MHz ,


100MHz , 2.4G 64 3 . ATMEL
AT89C51 . AT89C51 Intel 8051 4K Bytes Flash
. 8051 2 16
. Timer0 Timer1 1 .
FND . 2mS 1 FND .
8051 16 / . 8051
Timer Xtal1 1/4 . XTAL1 24MHz
6MHz . 5~6
8 .8 27 . Timer0 16
8 (74HC393) 4 (74161) 28 . 2 28
268435456 99999999 (8 ) . 100MHz IC 74
74F161 . 74F161 . 100MHz
TI SN74F161N 120MHz . SN74F161 4
16 100MHz 16 6.25MHz . .
IC .1 74HC393
8 . 74HC393 8 25KHz AT89C51 Timer0
. 8051 1 Sec
8051 . 8051 1980 .
. sjmp $ 1 uS 1/2
1/4 . 8051 12 XTAL1 . 1 NOP
INC R0 12 SJMP $ 24 . 24MHz 24
1 uS . 8051 1 S . 500
1S . 1uS . 24
8051 24MHz . 8051 12 ( ) . 12
500 nS .

C . Crossware 8051 ANSI C 32


IEEE695 . 0 4K Bytes
Free .( 8051
ROM ).
1 Sec . 1 Sec
1 Sec .1Sec
8051 Timer1 . Xtal1 500
. 8051 CISC .
1Sec . 28 10 FND
. 2 ms 16 10
. 8051 printf 2mS 8
. 1 8 . Hold FND

8051 XTAL1 24MHz . 74F161 XTAL1 24MHz .


( ) FND 24000000 . 2400000
. (1 Sec )

100MHz / 1M Ohm :

8 trong 30 03/01/2011 9:31 CH


SE-FCNTR http://www.sample.co.kr/sefcntr/index.htm

. TTL .
100MHz . Sine .
. 74 74LS14 . 100MHz
. 74F14 74AS14 65MHz
.( ) TI SN74AHCT14 120MHz
. . 50MHz ~ 100MHz 1.5V 50MHz
0.5V .

2.4GHz / 50 Ohm / 64 :

. 30MHz 10
300MHz . TTL IC 10 IC
64/128/256 . FUJITSU
MB506 . 10MHz 2.4GHz 64 . Mini
Circuits MAR-6 2 . 0.1V . 50 Ohm .

SE-FCNTR , / ,

9 trong 30 03/01/2011 9:31 CH


SE-FCNTR http://www.sample.co.kr/sefcntr/index.htm

//
// 100MHz / 2.4GHz Universal Counter
//
// SAMPLE Electronics co. 25. Nov. 2003
//
// Crossware Embedded Development Studio V 3.3.1.2
//
//
//
// 74F161 4 Bit, 74HC393 8 Bit 8051 T0 16 Bit
// 28 .
// 1 Sec 8 100 MHz .
// 64 0.64 S
// .
//
//
// 8051 Initial C Source File
//
#include <sfr.h>
#include <os.h>
#include <stdlib.h>
#include <stdio.h>

_sfrbit P36_o_74f161_clr_n = _p3^6; // F161


_sfrbit P35_o_74f161_enp = _p3^5; // F161
_sfrbit P30_io_74hc393_clr_hold = _p3^0; // HC393 / HOLD
_sfrbit P37_i_prescaler = _p3^7; // 64 Pre Scaler
//
// 7 Segment LED
// hgfedcba
#define DIG0 0xC0 // 11000000b ; 0 P2.0
#define DIG1 0xF9 // 11111001b ; 1 +-----a-----+
#define DIG2 0xA4 // 10100100b ; 2 | |
#define DIG3 0xB0 // 10110000b ; 3 P2.5 f b P2.1
#define DIG4 0x99 // 10011001b ; 4 | |
#define DIG5 0x92 // 10010010b ; 5 | P2.6 |
#define DIG6 0x82 // 10000010b ; 6 +-----g-----+
#define DIG7 0xD8 // 11011000b ; 7 | |
#define DIG8 0x80 // 10000000b ; 8 P2.4 e c P2.2
#define DIG9 0x98 // 10011000b ; 9 | |
// ; | P2.3 |
#define DIGM 0xBF // 10111111b ; - +-----d-----+ * h P2.7
#define DIGP 0x7F // 01111111b ; .
#define DIGB 0xFF // 11111111b ; "Blank"
//
const char segment_pattern[] = { DIG0, DIG1, DIG2,\
DIG3, DIG4, DIG5, DIG6, DIG7, DIG8, DIG9 };
//
const char segment_select[] = { 0xFE, 0xFD, 0xFB, \
0xF7, 0xEF, 0xDF, 0xBF, 0x7F };
//
unsigned long trailer;

10 trong 30 03/01/2011 9:31 CH


SE-FCNTR http://www.sample.co.kr/sefcntr/index.htm

unsigned long task;


unsigned int trimer;
unsigned char fnd[8];
unsigned char mfnd[8];
unsigned int int_state;
unsigned char fnd_state;
unsigned char boat;
bit hold;
//
//
void _interrupt IVN_TIMER1 time_base() {
//////////////////////////////////////////////
_tl1 = 0x60; _th1 = 0xF0; // 4000 2 M Sec 500 Times
//////////////////////////////////////////////
_p0 = 0xff;
_p2 = segment_select[fnd_state];
_p0 = fnd[fnd_state++];
fnd_state &= 0x07;
//////////////////////////////////////////////
if(int_state == 0) { //

P35_o_74f161_enp = 0; // F161
//
P30_io_74hc393_clr_hold = 1; // HC393
P36_o_74f161_clr_n = 0; // F161
_tl0 = 0x00; _th0 = 0x00; //
//
hold = P30_io_74hc393_clr_hold; // Hold Key

P36_o_74f161_clr_n = 1; // F161
P30_io_74hc393_clr_hold = 0; // HC393
//

P35_o_74f161_enp = 1; // F161
}
//////////////////////////////////////////////
if(int_state == 316) { // 10 GHz Mode(64 Divide Prescaler)
if (!P37_i_prescaler) { // 0.64 Sec Gate Time

for (trimer = 0; trimer<202; trimer++) ; // 15 Machine Cycle


// 24 MHz
boat++; // 15360000 .
boat++; // 1 Machine Cycle (12 Clock) Delay
boat++; // 15359988
boat++; // 15360000
// boat++; // 15360012

P35_o_74f161_enp = 0; // .

trailer = _th0;
trailer = (trailer << 20) & 0x0ff00000;
task = _tl0;

11 trong 30 03/01/2011 9:31 CH


SE-FCNTR http://www.sample.co.kr/sefcntr/index.htm

task = (task << 12) & 0x000ff000;


trailer |= task;
task = _p3;
task = (task << 7) & 0x00000f00;
trailer |= task;
task = _p1 & 0x000000ff;
trailer |= task;

P35_o_74f161_enp = 1; //
// .
}

}
//////////////////////////////////////////////
if(int_state == 494) { // 100 MHz Mode 1 Sec Gate Time
if (P37_i_prescaler) { // 1 Sec Gate Time

for (trimer = 0; trimer<248; trimer++) ; // 15 Machine Cycle


// 24 MHz
boat++; // 24000000 .
boat++; //
boat++; //
boat++; //
boat++; // 1 Machine Cycle (12 Clock) Delay
boat++; // 23999988
boat++; // 24000000
// boat++; // 24000012

P35_o_74f161_enp = 0; // .

trailer = _th0;
trailer = (trailer << 20) & 0x0ff00000;
task = _tl0;
task = (task << 12) & 0x000ff000;
trailer |= task;
task = _p3;
task = (task << 7) & 0x00000f00;
trailer |= task;
task = _p1 & 0x000000ff;
trailer |= task;

P35_o_74f161_enp = 1; //
// .
}

}
//////////////////////////////////////////////
if(int_state == 506) { // 1Hz
boat = trailer % 10;
mfnd[7] = segment_pattern[boat & 0xf];
trailer /= 10;

12 trong 30 03/01/2011 9:31 CH


SE-FCNTR http://www.sample.co.kr/sefcntr/index.htm

}
//////////////////////////////////////////////
if(int_state == 507) {
boat = trailer % 10;
mfnd[6] = segment_pattern[boat & 0xf];
trailer /= 10;
}
//////////////////////////////////////////////
if(int_state == 508) {
boat = trailer % 10;
mfnd[5] = segment_pattern[boat & 0xf];
trailer /= 10;
}
//////////////////////////////////////////////
if(int_state == 509) {
boat = trailer % 10;
mfnd[4] = segment_pattern[boat & 0xf];
trailer /= 10;
}
//////////////////////////////////////////////
if(int_state == 510) {
boat = trailer % 10;
mfnd[3] = segment_pattern[boat & 0xf];
trailer /= 10;
}
//////////////////////////////////////////////
if(int_state == 511) {
boat = trailer % 10;
mfnd[2] = segment_pattern[boat & 0xf];
trailer /= 10;
}
//////////////////////////////////////////////
if(int_state == 512) {
boat = trailer % 10;
mfnd[1] = segment_pattern[boat & 0xf];
trailer /= 10;
}
//////////////////////////////////////////////
if(int_state == 513) {
boat = trailer % 10;
mfnd[0] = segment_pattern[boat & 0xf];
trailer /= 10;
}
//////////////////////////////////////////////
int_state++;
//////////////////////////////////////////////
if(int_state >= 514) {
int_state = 0;
if (hold) {
fnd[0] = mfnd[0];
fnd[1] = mfnd[1];
fnd[2] = mfnd[2];

13 trong 30 03/01/2011 9:31 CH


SE-FCNTR http://www.sample.co.kr/sefcntr/index.htm

fnd[3] = mfnd[3];
fnd[4] = mfnd[4];
fnd[5] = mfnd[5];
fnd[6] = mfnd[6];
fnd[7] = mfnd[7];

if (P37_i_prescaler) {
fnd[1] &= 0x7F; // MHz Point
} else {
fnd[0] &= 0x7F; // GHz Point
}
}
}
//////////////////////////////////////////////
}

main()
{
_tmod = 0x15; // 0b00010101 Timer0 = Mode1, Counter, use TR0
// Timer1 = Mode1, Timer, use TR1
_tl0 = 0X0; _th0 = 0X0;
_tl1 = 0X0; _th1 = 0X0;
_tr0 = 1; // Timer 0
_tr1 = 1; // Timer 1

_et1 = 1; // 1
_ea = 1; //

while(1) ;

(1) Crossware 8051 C


c:\estudio_demo\Projects\fcntr4 .
(2) Crossware File Project Open
c:\estudio_demo\Projects\fcntr4 \fcntr4.xmk .
(3) Crossware Build Rebuild All fcntr4.hex .
(5) 8051 SE-516SP fcntr4 AT89C51

Crossware 8051 C . HEX 0000H 4K Hex


. Flash 4K AT89C51, AT89S51 AT89C1051/2051/4051 .
Crossware 8051 C

Crossware 8051 C

14 trong 30 03/01/2011 9:31 CH


SE-FCNTR http://www.sample.co.kr/sefcntr/index.htm

100 MHz
1M Ohm
 

100mV , 50MHz~ 100MHz 2V TTL .

15 trong 30 03/01/2011 9:31 CH


SE-FCNTR http://www.sample.co.kr/sefcntr/index.htm

10Hz ~ 100MHz 1M Ohm .

16 trong 30 03/01/2011 9:31 CH


SE-FCNTR http://www.sample.co.kr/sefcntr/index.htm

100 MHz SINE TTL SN74AHCT14

FET 2SK241

17 trong 30 03/01/2011 9:31 CH


SE-FCNTR http://www.sample.co.kr/sefcntr/index.htm

NEC 5 GHz 2SC2570

18 trong 30 03/01/2011 9:31 CH


SE-FCNTR http://www.sample.co.kr/sefcntr/index.htm

19 trong 30 03/01/2011 9:31 CH


SE-FCNTR http://www.sample.co.kr/sefcntr/index.htm

2.4 GHz
50 Ohm

10MHz ~ 2.4GHz 64 .

20 trong 30 03/01/2011 9:31 CH


SE-FCNTR http://www.sample.co.kr/sefcntr/index.htm

100mV .

21 trong 30 03/01/2011 9:31 CH


SE-FCNTR http://www.sample.co.kr/sefcntr/index.htm

Mini circuits IC .

50 Ohm .

22 trong 30 03/01/2011 9:31 CH


SE-FCNTR http://www.sample.co.kr/sefcntr/index.htm

Mini Circuits MAR-6

23 trong 30 03/01/2011 9:31 CH


SE-FCNTR http://www.sample.co.kr/sefcntr/index.htm

FUJITSU 2.4 GHz (64, 128, 256 ) MB506

24 trong 30 03/01/2011 9:31 CH


SE-FCNTR http://www.sample.co.kr/sefcntr/index.htm

Dip

25 trong 30 03/01/2011 9:31 CH


SE-FCNTR http://www.sample.co.kr/sefcntr/index.htm

100Mhz

26 trong 30 03/01/2011 9:31 CH


SE-FCNTR http://www.sample.co.kr/sefcntr/index.htm

27 trong 30 03/01/2011 9:31 CH


SE-FCNTR http://www.sample.co.kr/sefcntr/index.htm

80MHz (G ) .

28 trong 30 03/01/2011 9:31 CH


SE-FCNTR http://www.sample.co.kr/sefcntr/index.htm

2.4G

(Dip Meter)

 
SE-FCNTR 100MHz TTL (DC - 100MHz)
SE-PAMP 100MHz / 1M Ohm (10Hz ~ 100MHz)
SE-PRSCR 2.4G / 50 Ohm 64 ( 10MHz ~ 2.4GHz)
*** ***

(1) SE-FCNTR , .
(2) SE-FCNTR 24MHz .
(2) FND (Red) .
(3) SE-FCNTR, SE-PAMP, SE-PRSCR .
(4) IC , .
(5) CPU(AT89C51) HEX .

29 trong 30 03/01/2011 9:31 CH


SE-FCNTR http://www.sample.co.kr/sefcntr/index.htm

30 trong 30 03/01/2011 9:31 CH

You might also like