summaryrefslogtreecommitdiff
path: root/docs/GQ-RFC1201.txt
blob: 6f096c16beec7e70f26ee91ef9bffb0a89cbb973 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
***************************************************
GQ-RFC1201

GQ Geiger Counter Communication Protocol
***************************************************
Ver 1.40    Jan-2015


Status of this Memo

   This document specifies a GQ GMC Geiger Counter Communication Protocol for the
   communication between GQ GMC Geiger Counter and a computer host via serial port, and requests discussion and suggestions for
   improvements.  Distribution of this memo is unlimited.

Copyright Notice

   Copyright (C) GQ Electronics LLC (2012).  All Rights Reserved.

Abstract

   This document defines a GQ GMC Geiger Counter Communication Protocol
   to support communication between GMC Geiger Counter and a computer host via serial port.  The protocol allows to send data request command from a computer host to a GQ GMC geiger counter. 


**************************
Serial Port configuration
**************************

For the GMC-300 V3.xx and earlier version, the serial port communication is based on a fixed baud rate.

Baud: 57600
Data bit: 8
Parity: None
Stop bit: 1
Control: None

For the GMC-300 Plus V4.xx and later version firmware,  115200 BPS is used.

For GMC-320, the serial port communication baud rate is variable. It should be one of the followings:

1200,2400,4800,9600,14400,19200,28800,38400,57600,115200 BPS.  The factory default is 115200 BPS.


**************************
Command format
**************************

A valid command start with ASCII '<'  and ended with ASCII '>>'. Both command and parameters are in between '<' and '>>'.

Command is a ASCII string. All parameters of command are true value in hexadecimal. 


Direction: All commands are initiated from computer(HOST).


**************************
Commands
**************************

1. Get hardware model and version

Command:  <GETVER>>


Return:   total 14 bytes ASCII chars from GQ GMC unit. It includes 7 bytes hardware model and 7 bytes firmware version.

	  e.g.:  GMC-300Re 2.10   

Firmware supported:  GMC-280, GMC-300 Re.2.0x, Re.2.10 or later


2. Get current CPM value


Command:  <GETCPM>>

Return:   A 16 bit unsigned integer is returned. In total 2 bytes data return from GQ GMC unit. The first byte is MSB byte data and second byte is LSB byte data.

	  e.g.: 00 1C     the returned CPM is 28.

Firmware supported:  GMC-280, GMC-300 Re.2.0x, Re.2.10 or later



3. Turn on the GQ GMC heartbeat

Note:     This command enable the GQ GMC unit to send count per second data to host every second automatically. 

Command:  <HEARTBEAT1>>

Return:   A 16 bit unsigned integer is returned every second automatically. Each data package consist of 2 bytes data from GQ GMC unit. The first byte is MSB byte data and second byte is LSB byte data.


	 e.g.: 10 1C     the returned 1 second count is 28.   Only lowest 14 bits are used for the valid data bit.  The highest bit 15 and bit 14 are reserved data bits.



Firmware supported:  GMC-280, GMC-300  Re.2.10 or later


4. Turn off the GQ GMC heartbeat


Command:  <HEARTBEAT0>>

Return:   None

Firmware supported:  Re.2.10 or later


5. Get battery voltage status


Command:  <GETVOLT>>

Return:   one byte voltage value of battery (X 10V)

          e.g.: return 62(hex) is 9.8V

Firmware supported:  GMC-280, GMC-300 Re.2.0x, Re.2.10 or later


6. Request history data from internal flash memory

Command:  <SPIR[A2][A1][A0][L1][L0]>>

	A2,A1,A0 are three bytes address data, from MSB to LSB.  The L1,L0 are the data length requested.  L1 is high byte of 16 bit integer and L0 is low byte.
	
	The length normally not exceed 4096 bytes in each request.
 
Return: The history data in raw byte array.

Comment: The minimum address is 0, and maximum address value is the size of the flash memory of the GQ GMC Geiger count. Check the user manual for particular model flash size.

Firmware supported:  GMC-300 Re.2.0x, Re.2.10 or later

 
7. Get configuration data

Command:  <GETCFG>>

Return: The configuration data.  Total 256 bytes will be returned.


Firmware supported:  GMC-280, GMC-300 Re.2.10 or later



8. Erase all configuration data 

Command:  <ECFG>>

Return: 0xAA 

Firmware supported: GMC-280, GMC-300 Re.2.10 or later


9. Write configuration data

Command:  <WCFG[A0][D0]>>
	
	A0 is the address and the D0 is the data byte(hex).  

Return: 0xAA 

Firmware supported: GMC-280, GMC-300 Re.2.10 or later



10. send a key

Command:  <key[D0]>>
	
	D0 is the key value from 0 to 3. It represents software key S1~S4.  
Return: none 

Firmware supported:  GMC-280, GMC-300 Re.2.0x, Re.2.10 or later

Note: for Re.2.11 or later, each key can be a ASCII string: <KEY0>>,<KEY1>>,<KEY2>>,<KEY3>>   


  
11. get serial number

Command: <GETSERIAL>>

Return: serial number in 7 bytes. 

Firmware supported: GMC-280, GMC-300 Re.2.11 or later



12. Power OFF

Command: <POWEROFF>>

Return: none

Firmware supported: GMC-280, GMC-300 Re.2.11 or later


13. Reload/Update/Refresh Configuration


Command: <CFGUPDATE>>

Return: 0xAA

Firmware supported: GMC-280, GMC-300 Re.2.20 or later


14. Set realtime clock year

command: <SETDATEYY[D0]>>

	D0 is the year value in hexdecimal
	
Return: 0xAA

Firmware supported: GMC-280, GMC-300 Re.2.23 or later


15. Set realtime clock month

command: <SETDATEMM[D0]>>

	D0 is the month value in hexdecimal
	
Return: 0xAA

Firmware supported: GMC-280, GMC-300 Re.2.23 or later


16. Set realtime clock day

command: <SETDATEDD[D0]>>

	D0 is the day of the month value in hexdecimal
	
Return: 0xAA

Firmware supported: GMC-280, GMC-300 Re.2.23 or later

17. Set realtime clock hour

command: <SETTIMEHH[D0]>>

	D0 is the hourvalue in hexdecimal
	
Return: 0xAA

Firmware supported: GMC-280, GMC-300 Re.2.23 or later

18. Set realtime clock minute

command: <SETTIMEMM[D0]>>

	D0 is the minute value in hexdecimal
	
Return: 0xAA

Firmware supported: GMC-280, GMC-300 Re.2.23 or later



19. Set realtime clock second

command: <SETTIMESS[D0]>>

	D0 is the second value in hexdecimal
	
Return: 0xAA

Firmware supported: GMC-280, GMC-300 Re.2.23 or later


20. Reset unit to factory default

command: <FACTORYRESET>>

	
Return: 0xAA

Firmware supported: GMC-280, GMC-300 Re.3.00 or later


21. Reboot unit

command: <REBOOT>>

	
Return: None

Firmware supported: GMC-280, GMC-300 Re.3.00 or later


22. Set year date and time

command: <SETDATETIME[YYMMDDHHMMSS]>>

	
Return: 0xAA

Firmware supported: GMC-280, GMC-300 Re.3.00 or later



23. Get year date and time

command: <GETDATETIME>>

	
Return: Seven bytes data: YY MM DD HH MM SS 0xAA

Firmware supported: GMC-280, GMC-300 Re.3.00 or later



24. Get temperature

command: <GETTEMP>>

Return: Four bytes celsius degree data in hexdecimal: BYTE1,BYTE2,BYTE3,BYTE4
	Here: BYTE1 is the integer part of the temperature.
	      BYTE2 is the decimal part of the temperature.
	      BYTE3 is the negative signe if it is not 0.  If this byte is 0, the then current temperture is greater than 0, otherwise the temperature is below 0.
`	      BYTE4 always 0xAA

Firmware supported: GMC-320 Re.3.01 or later


25. Get gyroscope data

command: <GETGYRO>>

Return: Seven bytes gyroscope data in hexdecimal: BYTE1,BYTE2,BYTE3,BYTE4,BYTE5,BYTE6,BYTE7
	Here: BYTE1,BYTE2 are the X position data in 16 bits value. The first byte is MSB byte data and second byte is LSB byte data.
	      BYTE3,BYTE4 are the Y position data in 16 bits value. The first byte is MSB byte data and second byte is LSB byte data.
	      BYTE5,BYTE6 are the Z position data in 16 bits value. The first byte is MSB byte data and second byte is LSB byte data.
	      BYTE7 always 0xAA

Firmware supported: GMC-320 Re.3.01 or later


26. Power ON

Command: <POWERON>>

Return: none

Firmware supported: GMC-280, GMC-300, GMC-320 Re.3.10 or later