|
Size: 2513
Comment:
|
Size: 2513
Comment:
|
| Deletions are marked like this. | Additions are marked like this. |
| Line 7: | Line 7: |
| Highlights of the Code(script attached):\\ | Highlights of the Code(script attached):\n |
Before using the Mini Circuits UFC-6000 RF Frequency Counter in FOLL, we must characterize the system and estimate the type of noise we expect to see it introduce into the system, so that it may be accounted for when building the loop.
Interfacing the Frequency Counter with the Raspberry Pi
To interface the Mini Circuits RF Frequency Counter(FC) Model UFC-6000 with Raspberry Pi on Linux platform it must be communicated with USB-HID code byte programming. Also a User friendly interface is made to control the FC with command lines.
Highlights of the Code(script attached):\n The code enables the user to communicate and control different parameters of the FC like: 1)Frequency Range Selection( for the device to read different frequencies, AutoRange is set by default). 2)Sampling Time (The time intervals for which the data will be retrieved) 3)Read Device Status(Whether the device is reading data or not).
Description of the Code:
HID USB Interfacing by sending byte Values.
1)Read The Freq or Range
Reading the Freq is done by reading the 1st and 2nd LCD of the Frequency counter.
1st line containing Range information, 2nd line is the Frequency result
the code should be send is 2
1st byte: 2
The returned 64 byte array is as follows:
1st byte: 2
2nd byte to Byte17 the ascii value of 16 characters of the 1st LCD line
Byte18 to Byte33 the ascii value of 16 characters of the 2nd LCD line
2) Set the Range
By default Freq Counter is in "AutoRange" mode.
To set the range manually send the code 4
1st byte: 4
2nd byte: the range value. can be any legal range value. for auto range need to be 255.
the 64 byte array is:
1st byte: 4
3)Set the Sample Time
By default Freq Counter Sample Time is 1 sec.
you can set the sample time from 0.1 sec and up in step of 0.1 sec.To set the Sample Time send the code 3
1st byte: 3
2nd byte: the sample value in sec double 10.
for example: to set the sample time to 0.4 sec 2nd byte need to be: 4
the 64 byte array is:
1st byte: 3
These bytes can be changed by changing the values of buffer[0] and buffer[1] in function /*Write to the device*/ in the main program.
The data is written into a .txt file(example attached) and the user can control the recording of data. The frequency data is now be made to talk to EPICS through slow channels. The data from the .txt file can be used for error analysis at different sampling periods.
