technical_information
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| technical_information [2018/08/30 16:25] – Add proper page's header giometti | technical_information [2025/02/24 09:02] (current) – [Parallel port generator] giometti | ||
|---|---|---|---|
| Line 148: | Line 148: | ||
| Sometimes one needs to be able not only to catch PPS signals but to produce | Sometimes one needs to be able not only to catch PPS signals but to produce | ||
| them also. For example, running a distributed simulation, which requires | them also. For example, running a distributed simulation, which requires | ||
| - | computers' | + | computers' |
| - | invent some complicated hardware solutions but it may be neither necessary | + | |
| - | nor affordable. The cheap way is to load a PPS generator on one of the | + | |
| - | computers (master) and PPS clients on others (slaves), and use very simple | + | |
| - | cables to deliver signals using parallel ports, for example. | + | |
| - | | + | To do so the class pps-gen has been added. PPS generators can be |
| - | pin | + | registered in the kernel by defining a '' |
| - | 1 | + | follows: |
| - | 2 | + | |
| - | 3 | + | static struct pps_gen_source_info pps_gen_dummy_info = { |
| - | 4 | + | .name = " |
| - | 5 | + | .use_system_clock |
| - | 6 | + | .get_time |
| - | 7 | + | .enable |
| - | 8 | + | }; |
| - | 9 | + | |
| - | 10 ACK | + | Where the '' |
| - | 11 BUSY * * | + | clock to generate its pulses, or they are from a peripheral device |
| - | 12 PE * * | + | clock. Method '' |
| - | 13 SEL | + | generator clock, while the method '' |
| - | 14 AUTOFD | + | disable the PPS pulse generation. |
| - | 15 ERROR | + | |
| - | 16 INIT * * | + | Then calling the function '' |
| - | 17 SELIN | + | initialization routine as follows creates a new generator in the |
| - | 18-25 | + | system: |
| + | |||
| + | pps_gen = pps_gen_register_source(& | ||
| + | |||
| + | ===== Generators SYSFS support ===== | ||
| + | |||
| + | If the SYSFS filesystem is enabled in the kernel it provides a new class: | ||
| + | |||
| + | $ ls / | ||
| + | pps-gen0/ | ||
| + | |||
| + | Every directory is the ID of a PPS generator defined in the system and | ||
| + | inside of it you find several files: | ||
| + | |||
| + | $ ls -F / | ||
| + | dev enable | ||
| + | |||
| + | To enable the PPS signal generation you can use the command below: | ||
| + | |||
| + | $ echo 1 > / | ||
| + | |||
| + | ===== Parallel port generator ===== | ||
| + | |||
| + | One way to do this is to invent some complicated hardware solutions but it | ||
| + | may be neither necessary nor affordable. The cheap way is to load a PPS | ||
| + | generator on one of the computers (master) and PPS clients on others | ||
| + | (slaves), and use very simple cables to deliver signals using parallel | ||
| + | ports, for example. | ||
| + | |||
| + | Parallel port cable pinout: | ||
| + | |||
| + | | ||
| + | 1 | ||
| + | 2 | ||
| + | 3 | ||
| + | 4 | ||
| + | 5 | ||
| + | 6 | ||
| + | 7 | ||
| + | 8 | ||
| + | 9 | ||
| + | 10 ACK | ||
| + | 11 BUSY * * | ||
| + | 12 PE * * | ||
| + | 13 SEL | ||
| + | 14 AUTOFD | ||
| + | 15 ERROR | ||
| + | 16 INIT * * | ||
| + | 17 SELIN | ||
| + | 18-25 | ||
| Please note that parallel port interrupt occurs only on high-> | Please note that parallel port interrupt occurs only on high-> | ||
| Line 179: | Line 224: | ||
| using polling in the interrupt handler which actually can be done way more | using polling in the interrupt handler which actually can be done way more | ||
| precisely because interrupt handling delays can be quite big and random. So | precisely because interrupt handling delays can be quite big and random. So | ||
| - | current parport PPS generator implementation ('' | + | current parport PPS generator implementation (pps_gen_parport module) is |
| geared towards using the clear edge for time synchronization. | geared towards using the clear edge for time synchronization. | ||
| Line 186: | Line 231: | ||
| latencies. But if it is too small slave won't be able to capture clear edge | latencies. But if it is too small slave won't be able to capture clear edge | ||
| transition. The default of 30us should be good enough in most situations. | transition. The default of 30us should be good enough in most situations. | ||
| - | The delay can be selected using '' | + | The delay can be selected using '' |
| + | |||
technical_information.1535646330.txt.gz · Last modified: by giometti
