로그인회원등록 내글장바구니주문조회현재접속자
 상품 검색








 게시판 검색





 
 
회원등록 비번분실


온라인 입금계좌
ㆍ기업은행
ㆍ219-043192-01-028
ㆍ이건영

      거래은행 바로가기
 
  AVR Applications
AVR 자료실
작성자 leeky        
작성일 2006/12/27
Link#1 (Down:76)
ㆍ추천: 0  ㆍ조회: 910   
  ATmega16 RFID #3 소프트웨어
 5. RFID 장치 소프트웨어의 설계
5.1 그림 5.1.a. RFID 장치의 구성도
 
 
The figure 5.1.a. shows the block diagram of RFID ToolBOX device, and its main parts,
which are Sykomat RFID reader, microprocessor ATMEGA16L (both placed on one PCB
board), communicating using special protocol (described in section 3.6.4.2), and the J2ME
part, which is the interface for J2ME end users. The communication between RFID Tool Box
and J2ME application is performed using designed protocol, described in the next chapter,
using RS232 communication.
.
5.2 RFID 장치의 프로토콜
The communication from Java point of view is based on standard serial connection, which
interface is CommConnection class available in J2ME edition or Connection class in first
edition of JME in the javax.microedition.io . This interface defines a logical serial port
connection. The port is defined as a logical connection through which bytes are transferring
serially. The logical serial port is defined within the underlying operating system and may not
necessarily correspond to a physical RS-232 serial port. For instance, IrDA IRCOMM ports
can commonly be configured as a logical serial port within the operating system so that it can
act as a "logical" serial port.
.
The difference in usage of serial connection between JME editions is possibility of opening
both: input and output data stream using one connection in J2ME, while in JME the input or
output data stream must be closed before opening the other one.
.
The default baudrate for RFID Toll Box serial communication is set to 9600.
One package byte of data consists of 8 data bits, 0 parity bits and 1 stop bit.
The protocol between the class and RFID Read/Write device ensure communicating
devices to understand each other, simply by mapping complicated commands to integer
values. The commands mapping is performed using RFID Tool Box command conversion
table ( Table 5.2.a). The commands are translated on a basis of parameters sent in the method
call.
.
Table 5.2.a. RFID Tool Box command map
 
 
The return data frame consist of command send to device (8 bits), one character 45 (8 bits),
error code (8 bits), data and stop character 88 (8 bits). The frame is shown on picture 5.2.b.
.
Figure 5.2.b. Received data frame.


The length of data part depends on Return Data Format value, and is shown in table 5.2.a.
.
5.3 J2ME API
5.3.1 J2ME short introduction.
“… Write once, run everywhere. ™”
This is the main idea of introducing Java editions. All recent editions of Java have its origin in
Java 2 Standard Edition (J2SE).
The main aim during developing and introducing these platforms was to allow users of
different devices to write the universal applications, which could be applied in most of them.
.
5.3.2 Java Editions.
Java divide for three main groups – editions shown in he figure 5.3.2.a.
The recent editions of Java platform are the following:
• Java Standard Edition (J2SE) – developed for desktop and workstation computers.
• Java Enterprise Edition (J2EE) – aimed especially to server-based applications.
• Java Micro Edition (J2ME) – developed for devices with limited processing,
memory and display capabilities.
.
J2ME edition of Java makes the devices supporting this platform not static anymore.
The modern devices like cellular phones, Personal Digital Assistants (PDAs), allow their
users to create and download new application, other then provided during manufacturing
process.
.
Micro Edition of Java was developed taking under consideration the technical constraints of
aimed devices. It is obvious that not all features of J2SE or J2EE could be applied to cellular
phone or PDA, like for example graphical interface, which is limited by device display.
To fit into the different features of target devices, Sun has introduced the concept of
configuration and profile.
.
5.3.2.a. Java editions. (Data sheet Java 2 Micro Edition. sun.com/software)
 
 

5.3.3 Configuration.
Division for configurations is based on the technical features of the devices, like
memory, display or processor efficiency, as also is very closely connected with Java Virtual
Machine (JVM), and defines language features and core libraries.
.
The very basic statement regarding this division made by Sun is following:
“ The J2ME has two design centers: things that you hold in your hand and things you plug
into the wall. ”
.
There are two defined configurations:
• Connected Device Configuration (CDC)
with minimum of 512 kilobytes memory for running Java,
with minimum of 256 kilobytes of memory for runtime allocation,
with high bandwidth network connectivity.
• Connected, Limited Device Configuration (CLDC)
with 128 kilobytes memory for running Java,
with 32 kilobytes of memory for runtime allocation,
with small user interface capabilities,
with usually battery power supply (low power),
with typically wireless, low bandwidth network connectivity.
.
This division seems to be very clear, but the technology is more and more advanced, what
causes the division to be not so obvious any more. Some devices can fall into both categories,
and this is one of the reasons Sun introduced profile.
.
The profile describes more clearly the broad range of device capabilities, and provides the
libraries for particular type of device.
The example of a profile is Mobile Information Device Profile (MIDP), used in the project,
which defines all needed components, like user interface, event handling, data storage taking
into account memory and screen capabilities.
.
5.3.4 Java Virtual Machine
Java Virtual Machine (JVM) is the engine behind all Java applications. It translates the
class files to machine code, as also is responsible for security, memory allocation, threads
management and for execution of the program.
.
The devices from CLDC profile do not fulfill the technical Java Virtual Machine
requirements so the K Virtual Machine (KVM) was introduced .The basic requirements of
KVM is less then 100 kilobytes of memory, 20 to 40 kilobytes for dynamic memory purposes,
and processors with much smaller power than for standard JVM.
.
5.4 API design
Very important assumption made for the project is the mobility. The mobility not only in the
meaning of portable device interacting with external portable systems like cellular phone or
PDA, but also in the area of software.
The device and project structure should allow other users or programmers to make their own
applications supporting the RFID Reader/Writer, not being aware of device firmware
architecture.
.
The main software part of the project regarding Java Micro Edition is the API for RFID
device usage. API in the meaning of interface written in J2ME in CLDC configuration.
This interface should implement all necessary extensions to ensure full device control for
future programmers, providing comfort in usage.
.
5.4.1 J2ME interface.
The mobile device – RFID Reader Writer interface is built on a basis of J2ME class, named
RFIDrwSupport. The class was created as separate implementation of MIDLET.
The interface implements the following functionality :
.
• The protocol for basic communication with the device,
• Reading data from the Tag,
Writing the data to the Tag,
• Getting information about supported tag architectures,
• Shutting down the Sykomat reader.
.
5.4.1.1 Reading data from the TAG
Reading the data from the tag is implemented in the RFIDrwSupport class with ReadTheTag
method. The method implements also all activities needed to make the connection and
transfer the data.
.
Method call has the following structure:
public String ReadTheTag(String ConStr, int Gain, int DataType)
The method returns string value depending on the action result. In the case of Exception the
IOException is caught and return as a result of the command. If the communication is
performed successfully, the return string is parsed according to DataType parameter.
.
Parameters:
String – Class placed in java.lang package. In easy way lets to make operations on
string of characters data. This argument passes so called connection string, needed to supply
all needed information to communicate on certain device.
Gain – The integer value ( 0 or 5 ), to indicate usage of gain for the antenta.
DataType – The integer value ( 0,1 or 2 ), to chose what in what form the data should be
received.
.
5.4.1.2 Writing data to the Tag.
Writing the data to the tag is implemented in the RFIDrwSupport class with WriteTheTag
method. The method implements all activities needed to make the connection and transfer the
data.
.
Method call has the following structure:
public String WriteTheTag(String ConStr, String Send , String TagType)
The method returns string value depending on the action result. In the case of Exception the
IOException is caught and return as a result of the command.
.
Parameters:
String –This argument passes connection string, needed to supply all needed information
to communicate on certain device.
String – Used to pass the data to be sent.
String – Used to supply the information about supported Tag architecture at the moment.
.
5.4.1.3 Getting information about supported tag architectures
Getting info about supported tag architectures is implemented in the RFIDrwSupport class
with GetTagInfo method.
.
The method call has the following structure:
public String GetTagInfo(String ConStr)
The method returns string value depending on the action result. In the case of failure method
returns caught IOException, otherwise received data is returned in the string. The format of
this information is CSV (Comma Separated Value), where the tag type names are separated
with comma.
.
Parameters:
String – Used to pass connection string.
.
5.4.1.4 Shutting down the Sykomat reader.
Shutting down the Sykomat reader is implemented in the RFIDrwSupport class with
ShutDown method.
.
The method call has the following structure:
public String ShutDown(String ConStr)
The method returns string value depending on the action result. In the case of failure method
returns caught IOException.
.
Parameters:
String – Used to pass connection string.
.
5.4.1.5 RFIDrwSupport class code overview.
The interface is implemented as fully defined class. Clear requirements of the interface
succeeded in full definition of RFIDrwSupport class methods, what excluded Interface
implementation (in the meaning of Java language). Also abstract class is not necessary in this
case.
.
All methods of this class implements connections and data streams, so that it is enough to call
the function not thinking about connection support. This is the reason all the methods needs
connection string as parameter, as also that ports are named differently in different devices.
The class imports following packages
• java.io.* package, which provide classes for input and output through data streams,
.
javax.microedition.io.* package, which provide networking support based on the
Generic Connection framework from the CLDC.
.
5.4.2 Test Application
Midlet My_Menu presents the usage of RFIDrwSupport class, and basic methods usage.
Main midlet class My_Menu, as also two base classe BaseDemo were implemented in
UIDemo midlet, released together with J2ME Wireless Toolkit 2.0 Beta 2 which is Sun
simulator of mobile devices supporting Java.
.
Both of these classes implements basic functionality of created later user interface.
Midlet My_Menu consist of following classes:
• My_Menu
• BaseDemo
• TagType
• ReadTag
• WriteTag
• GetInfo
• Shut_Down_Sykomat
.
These classes create Midlet and demonstrates the usage of RFIDrwSupport interface.
My_Menu demo was tested using J2ME Wireless Toolkit 2.0 Beta 2 simulator.
The main difference between this version of simulator and the previous one is the usage of
Connection interface. New version of Sun’s simulator supports J2ME, while the previous one
only the first version of Java Micro Edition.
.
Old version of Java Micro do not allow to the programmer to open simultaneously Output
and Input Data Streams using the same connection, while J2ME implementing
CommConnection class allows in very comfortable way to use serial connection.
.
5.4.2.1 Class Diagram
Figure 5.4.2.1.a shows in general way the basic dependencies and data flow from J2ME point of view.
Figure 5.4.2.1.a. Class Diagram
 

.
5.4.2.2 Class My_Menu
This is the main class of My_Menu application and the first menu available in the
Midlet. It presents all actions available to the user. The class is implemented on a basis of
UIDemo class from UIDemo midlet released with Sun WT1041 simulator.
The screen shot of this class is shown in the figure 6.4.2.2.a.
.
Figure 5.4.2.2a. My_Menu class screen shot.
 
 

5.4.2.3 Class Base_Demo
This is a base class for some of the classes in the My_Menu.. It enables the functionality of
going back to the main screen.
The class is implemented on a basis of BaseDemo class from UIDemo midlet released with
Sun WT1041 simulator.

5.4.2.4 Class Tag_Type
This class extends BaseDemo class. Using this menu user chooses tag architecture supported
at the moment.
In comparison to other classes this one imports also javax.microedition.rms.* package, to
enable record store management. The information about tag architecture chosen by the user is
kept in the memory and updated at each change.
.
TagType class needs also to implement ItemStateListener interface, to enable receiving record
change-related events.
The screen shot of this class is shown in the figure 6.4.2.4a.
.
Figure 5.4.2.4.a. Tag_Type class screen shot.
 
 

5.4..2.5 Class Read_Tag
Using this class the information from tag are read. Read data or IOException is printed to the
screen. The screen shot of this class is shown in the figure 6.4.2.5.a.
.
Figure 5.4.2.5.a. Read_Tag class screen shot.
 

5.4..2.6 Class Write_Tag
Using this class user can write the tag with given information passes with Send parameter.
The screen shot of this class is shown in the figure 6.4.2.6.a.
.
Figure 5.4.2.6.a. Write_Tag class screen shot.
 

5.4.2.7 Class Get_Info
This class uses the GetTagInfo method of RFIDrwSupport class, to read the information about
supported tag architectures. Read information is printed to the screen.
The screen shot of this class is shown in the figure 6.4.2.7.a.
.
Figure 5.4.2.7.a. Get_Info class screen shot.
 
 
5.4.2.8 Class ShutDown
This class uses the ShutDown method of RFIDrwSupport class, shut down the Sykomat
reader. The screen shot of this class is shown in the figure 6.4.2.8.a.
.
Figure 5.4.2.8.a. ShutDown class screen shot.
 
 
5.4.3 마이크로 제어기 소프트웨어 (펌웨어)
avr-gcc -g -Os -mmcu=atmega16 -c main.c
The command compiles main.c source file to main.o object file.
avr-gcc -g -mmcu=atmega16 -o main.elf main.o
Next from the file main.o, binary application file main.elf is created.
avr-objcopy -j .text -j .data -O ihex main.elf main.hex
From the binary application file, new file main.hex is extracted giving Intel Hex file format,
which is written to microprocessor.

ATmega16을 사용한 RFID 소스는 첨부된 파일을 내려 받으십시요. 
   
윗글 mega8 적외선 거리측정 레이더
아래글 ATmega16 RFID #2 하드웨어
    N         제목    글쓴이 작성일 조회 추천
AVR 자료실 안내 avrtools™ 2008/09/02 (화) 311 0
97 AVR Basic Compiler (4K Free) avrtools™ 2008/12/03 (수) 243 0
96 코드비젼 V2.05.0 평가판 avrtools™ 2011/07/17 (일) 163 0
95 8x8 LED Audio Spectrum Display avrtools™ 2009/10/18 (일) 278 0
94 AVR 펌웨어로 만드는 USB 드라이버 avrtools™ 2009/10/07 (수) 479 0
93 AVR-CDC and V-USB avrtools™ 2009/10/06 (화) 249 0
92 AVR USB-HID-Bootloader의 제작 avrtools™ 2009/10/01 (목) 285 0
91 AT91SAM7S256 개발환경과 컴파일러 [2] avrtools™ 2008/11/03 (월) 2217 0
90 SAM7S256 USB 드라이버와 AT91-ISP avrtools™ 2008/11/01 (토) 1211 0
89 AT91SAM7S256 공부를 시작합니다. avrtools™ 2008/11/01 (토) 603 1
88 ICCAVR V7.16A AVR 컴파일러 45일판 avrtools™ 2009/03/09 (월) 156 0
87 CodeVisionAVR1248b 最新版下载 leeky 2008/11/08 (토) 331 0
86 AVR UART 소스 (ICC AVR V6) avrtools™ 2008/12/03 (수) 215 0
85 cvAVR Soft Uart Source avrtools™ 2008/12/03 (수) 174 0
84 cvAVR 직렬포트와 LCD 시험용 소스 avrtools™ 2008/12/03 (수) 178 0
83 Free SmallC for AVR avrtools™ 2008/12/03 (수) 216 0
82 AVR910-ISP용 AVR-OSP2 Ver5.43 avrtools™ 2008/12/03 (수) 196 0
81 Code Vision AVR 컴파일러 2K 데모버전 avrtools™ 2008/12/02 (화) 129 0
80 AVR delay loop generator avrtools™ 2008/12/02 (화) 181 0
79 ICC tiny C컴파일러 V6 데모버전 (30일 제한판) avrtools™ 2008/12/02 (화) 92 0
78 ICC AVR C 컴파일러 V6 (4K 제한판) avrtools™ 2008/12/02 (화) 117 0
77 DasmAVR (Windows용 AVR 역어셈블러) avrtools™ 2008/12/02 (화) 178 0
76 AVR PROG KIT avrtools™ 2008/12/02 (화) 201 0
75 AVR JTAG ICE KIT avrtools™ 2008/12/02 (화) 294 0
74 AVR 부동소수점, 지연시간 계산기 avrtools™ 2008/12/02 (화) 202 0
73 ATtiny45 USB to RS232 인터페이스 avrtools™ 2008/09/26 (금) 228 0
72 MEGA32 128x64 GLCD Scope 제작 avrtools™ 2008/09/22 (월) 336 0
71 PC송신방식 Tiny2313 50x7 LED 전광판 avrtools™ 2008/09/10 (수) 290 0
70 mega8 적외선 거리측정 레이더 leeky 2006/05/07 (일) 1401 0
69 ATmega16 RFID #3 소프트웨어 leeky 2006/12/27 (수) 910 0
68 ATmega16 RFID #2 하드웨어 leeky 2006/12/27 (수) 1158 0
67 ATmega16 RFID #1 태그 leeky 2006/12/27 (수) 888 0
66 ISO 14443A RFID 카드의 읽기/쓰기 방법 [1] leeky 2007/02/25 (일) 1522 1
65 ATmega8 PSK31 RF Modem의 제작 leeky 2006/03/07 (화) 1406 21
64 T89C51SND1C 64M USB MP3 플레이어 avrtools 2006/03/04 (토) 1021 8
63 AVR 13.56MHz RFID 읽기/쓰기 장치의 제작 [7] leeky 2007/02/19 (월) 1089 4
62 WhereAVR for APRS GPS/Telemetry avrtools 2006/05/05 (금) 428 2
61 ATmega8 UI-TNC 무선모뎀의 제작 avrtools 2006/03/07 (화) 424 0
60 AVR APRS(GPS) Packet 무선모뎀 avrtools 2006/03/07 (화) 421 0
59 AT90PWM3 교류모터 속도제어 leeky 2006/04/07 (금) 976 1
58 M128 MMC LED 전광판 leeky 2006/03/07 (화) 955 0
57 Charon 2 이더넷 모듈의 소개 avrtools 2006/04/04 (화) 509 0
56 S2313 LED 회전계 (TACHO METER) avrtools 2006/03/28 (화) 627 0
55 Mega8 + 128x128 LCD 스코프 avrtools 2006/03/28 (화) 1217 0
54 Mega8 + OV6630 Treva 모바일용 카메라의 화상처리 leeky 2006/03/19 (일) 825 0
53 YUKI Mega8 MP3 Player #3 avrtools 2006/03/11 (토) 871 0
52 AVR JTAG 에뮬레이터의 제작 avrtools 2006/03/07 (화) 881 0
51 USB AVR 프로그래머 AvrUsb500 avrtools 2006/03/07 (화) 760 1
50 Mega88 USB 버스 모니터 avrtools 2006/03/07 (화) 417 0
49 M16 MMC Flash Memory leeky 2006/03/07 (화) 487 1
48 M163 SD,MMC Interface leeky 2006/03/07 (화) 471 0
47 S2313 MMC to Serial leeky 2006/03/07 (화) 346 0
46 ATmega48 UDP/IP 적외선 리모콘 수신장치 avrtools 2006/03/07 (화) 448 0
45 HDD MP3 플레이어 leeky 2006/03/07 (화) 627 0
44 MP3 yampp-3/USB leeky 2006/03/07 (화) 319 0
43 MP3 Player yampp-3 leeky 2006/03/07 (화) 284 0
42 YUKI MP3 플레이어2의 제작 (ATmega8 + SD Card) avrtools 2006/03/07 (화) 416 0
41 AVR CD 플레이어 leeky 2006/03/07 (화) 567 0
40 S2313 초음파 거리계 (미터, TV 스크린, LED 표시) avrtools 2006/03/07 (화) 578 0
39 RF Spectrum Monitor avrtools 2006/03/07 (화) 422 0
38 Easy Ethernet AVR 웹서버 leeky 2006/03/07 (화) 484 0
37 90S4433 LCD표시 100Mhz 주파수 카운터 leeky 2006/03/07 (화) 278 0
36 ELM Audio Spectrum Monitor avrtools 2006/03/07 (화) 393 0
35 Mega8 Door Bell leeky 2006/03/07 (화) 306 0
34 AVR 휴대용 DVM leeky 2006/03/07 (화) 537 0
33 Minimum Mass Waveform Capture and Display leeky 2006/03/07 (화) 289 0
32 AT90S2313 디지털 용량계 avrtools 2006/03/07 (화) 397 0
31 SLO2016 Alphanumeric Intelligent Display leeky 2006/03/07 (화) 200 0
30 AT90S2313 흔드는 LED 전광판 (POV) leeky 2006/03/07 (화) 453 0
29 ATtiny2313 Scrolling LED Sign avrtools 2006/03/07 (화) 389 0
28 Tiny22,S1200 나이트 라이더 avrtools 2006/03/07 (화) 340 0
27 ATtiny26L의 AD 변환과 PWM 출력제어 leeky 2006/03/07 (화) 543 0
26 S2313을 사용한 DS1820 온도계 leeky 2006/03/07 (화) 293 0
25 ATmega8535 온도센서 leeky 2006/03/07 (화) 322 0
24 AVR2313 100MHz RF연결 주파수 측정메터 avrtools 2006/03/07 (화) 225 0
23 VHF 무선 데이터 송신기 leeky 2006/03/07 (화) 528 0
22 90S2313 1MHz 파형 포착기 leeky 2006/03/07 (화) 262 0
21 VHF 무선 데이터 수신기 avrtools 2006/03/07 (화) 420 0
20 AVR 5x7 Dotmatrix LED leeky 2006/03/07 (화) 264 0
19 Mega163 웹 LCD leeky 2006/03/07 (화) 418 0
18 AVR 이더넷 시험소프트 avrtools 2006/03/07 (화) 344 0
17 AVR 넷트웍 시계 (타임 프로토콜) avrtools 2006/03/07 (화) 406 0
16 RS-232 to 100 MHz RF desktop avrtools 2006/03/07 (화) 263 0
15 AVR 6디지트 50MHz 주파수 카운터 leeky 2006/03/07 (화) 241 0
14 AVR DS1820 온도센서 avrtools 2006/03/07 (화) 283 0
13 AVR 직접주파수 발생기 (AT90S2313 DDS) avrtools 2006/03/07 (화) 431 0
12 프로그래머블 PLL 제어 avrtools 2006/03/07 (화) 261 0
11 AVR AT90S2313 7Segment LED Display leeky 2006/03/07 (화) 240 0
10 TINY15L 무전원 4채널 온도계 avrtools 2006/03/07 (화) 367 0
9 8PIN AVR을 사용한 풀컬러 LED leeky 2006/03/07 (화) 397 0
8 DS1820 고분해능 온도계 avrtools 2006/03/07 (화) 369 0
7 S2313 디지털 전압계 avrtools 2006/03/07 (화) 492 0
6 S2313 적외선 USB 모듈 avrtools 2006/03/07 (화) 355 0
5 S2313 주파수 카운터 avrtools 2006/03/07 (화) 287 0
4 AVR90S2313과 Treva 카메라의 연결 leeky 2006/03/07 (화) 340 0
3 Mega8 PID 온도제어 leeky 2006/02/24 (금) 712 1
2 90S2333 3채널 다이오드 온도계 avrtools 2006/02/24 (금) 263 0
1 AT89S8252로 만드는 1~40MHz DDS leeky 2006/02/14 (화) 332 0
1

바구니 : 0
 보관함 : 0
오늘뷰 : 0
HOME   |   회사소개   |   제휴안내   |   회사위치   |   서비스이용 약관   |   개인정보 보호정책   |   사이트맵
17015 경기도 용인시 기흥구 동백중앙로16번길 16-25, 508호. 전화 : 031-282-3310
사업자 등록번호 : 697-47-00075 / 대표 : 이건영 / 업태 : 제조업 / 종목 : LED조명, LED전원, 제어장치.
개인정보 관리책임자 : 홈페이지 관리자 . Copyright ⓒ2016 아크레즈 (ACLEDS INC.)
HOME TOP PREVNEXT 0 0 0