• skip to content



flink-project

Universal Serial Interface to FPGA's

User Tools

  • Admin
  • Log In

Site Tools

  • Recent Changes
  • Media Manager
  • Sitemap
You are here: start » subdevices

subdevices

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
subdevices [2023/12/06 10:54] – [Interrupt Multiplexer] ursgrafsubdevices [2024/04/09 20:46] (current) – [DAC] ursgraf
Line 34: Line 34:
 |0x28|4|value_1|r|no|channel 1: digitized input value| |0x28|4|value_1|r|no|channel 1: digitized input value|
 |..|4|..|r/w|no|..| |..|4|..|r/w|no|..|
-The status register in the subheader is unused with this function. In the configuration register setting the bit 0 will reset the subdevice. This subdevice uses a pin on the FPGA device for each channel.+The status register in the subheader is unused with this function. In the configuration register setting the bit 0 will reset the subdevice. This subdevice uses 3 to 4 pins for the SPI depending on the particular type.
 ==== Subtypes ==== ==== Subtypes ====
 Currently there are three subtypes of this subdevice. The subtype information can be found in the ''function'' register of the header. Currently there are three subtypes of this subdevice. The subtype information can be found in the ''function'' register of the header.
Line 49: Line 49:
 |0x28|4|value_1|r/w|no|channel 1: digital output value| |0x28|4|value_1|r/w|no|channel 1: digital output value|
 |..|4|..|r/w|no|..| |..|4|..|r/w|no|..|
-The status register in the subheader is unused with this function. In the configuration register setting the bit 0 will reset the subdevice. This subdevice uses a pin on the FPGA device for each channel.+The status register in the subheader is unused with this function. In the configuration register setting the bit 0 will reset the subdevice. This subdevice uses 5 pins.
 ==== Subtypes ==== ==== Subtypes ====
 Currently there is one subtype of this subdevice. The subtype information can be found in the ''function'' register of the header. Currently there is one subtype of this subdevice. The subtype information can be found in the ''function'' register of the header.
 ^Subtype ID^Description^Example^ ^Subtype ID^Description^Example^
 |0x1|Simple DAC where the outputs are continuously set. All channels are updated at the same time|AD5668| |0x1|Simple DAC where the outputs are continuously set. All channels are updated at the same time|AD5668|
 +|0x2|Simple DAC where the outputs are continuously set. All channels are individually updated, +-10V|AD5754|
  
 ===== GPIO ===== ===== GPIO =====
Line 238: Line 239:
 The status and control register in the subheader are described below. The status and control register in the subheader are described below.
  
-=== status ===+=== Status Register ===
 | 31 | ... | 05..04 | 03..02 | 01 | 00 | | 31 | ... | 05..04 | 03..02 | 01 | 00 |
 | | | ACCEL_FS_SEL |GYRO_FS_SEL|configuring| reset| | | | ACCEL_FS_SEL |GYRO_FS_SEL|configuring| reset|
Line 248: Line 249:
 //all other//: All other bits are described in the MPU9250 register map in the manual.  //all other//: All other bits are described in the MPU9250 register map in the manual. 
  
-=== config ===+=== Configuration Register ===
 | 31 | ... | 01 | 00 | | 31 | ... | 01 | 00 |
 | | |update_config|reset| | | |update_config|reset|
Line 304: Line 305:
 The status register in the subheader is unused with this function. In the configuration register setting the bit 0 will reset the subdevice.  The status register in the subheader is unused with this function. In the configuration register setting the bit 0 will reset the subdevice. 
  
-=== Signals===+=== Output Signals===
 This subdevice uses three pins to connect an ADC7476. Further, the appropriate number of pins for the decoder is number_of_sensors = 2<sup>number_of_decoder_pins</sup>. The //pulse// pin has to be connected to the trigger input of the module.  This subdevice uses three pins to connect an ADC7476. Further, the appropriate number of pins for the decoder is number_of_sensors = 2<sup>number_of_decoder_pins</sup>. The //pulse// pin has to be connected to the trigger input of the module. 
  
 ===== Stepper Motor ===== ===== Stepper Motor =====
-Used to control stepper motors without driver (do not forget power decoupling). You can set how the motor should be controlled (forward, backward, full or half step, two or single phase). As well as the ramp can be configured freely, per motor, which is moved up when starting or down when stopping. +Used to control stepper motors. You can set several configuration parameters (forward, backward, full or half step, two or single phase). When starting a motor its speed will ramp up to a given top speed and ramp down to its final position. When in speed mode, a ramp is used to change from its current speed to the new target speed.
  
-Changes in direction, step type, phase mode and start speed are only taken into account when the motor is stopped. Changes during operation are not taken into account. +Changes in direction, step type, phase mode and start speed are only taking place when the motor is stopped.  
 +Make sure to set the base clock of this subdevice correctly (in Altera or Vivado), because prescalers are derived from that clock. 
  
-Make sure to set the base clock of this subdevice correctly (in Altera or Vivado), because prescalers are derived from that clock. Setting the bit 0 in the configuration register will reset the steps of all motors.+==== Modes of Operation ==== 
 +=== Step Mode === 
 +The motor moves through the specified number of steps. It uses a ramp to accelerate up and down. Changes in the configuration, prescaler and steps registers are only applied when the motor is at standstill. The module automatically resets the start bit in the motor configuration register when done. When the start bit is manually reset, the motor immediately ramps down without reaching the number of steps. 
 + 
 +=== Speed Mode === 
 +The motor ramps up to a preset speed. When the stop command is issued, the speed ramps down to a standstill. Changes in acceleration and starting speed are only applied at standstill. The maximum speed can be changed at will. Any change in maximum speed is reached with a ramp. 
 + 
 +=== Free Running === 
 +The motor is freewheeling. This means that the windings are not magnetized and the motor has no holding torque. 
 + 
 +=== General Remarks === 
 +It is not recommended to change from step mode to fix speed mode. It is better to stop the engine first and then change the mode. However, when changing from one of these two modes to free running mode, the motor will simply come to a stop without any braking effect (all windings will be non-magnetized). When resetting the module, the motor keeps the current step (the windings are still magnetized). 
 + 
 +==== Configuration ==== 
 +Setting the bit 0 in the configuration register of the subdevice will reset the steps of all motors.
  
-=== Specific Registers === 
 ^Offset^Size [byte] ^Name^r/w^Const^Description^ ^Offset^Size [byte] ^Name^r/w^Const^Description^
 |0x20|4|base_clk|r|yes|base clock in Hz| |0x20|4|base_clk|r|yes|base clock in Hz|
-|0x24|4|conf_0|r/w|no|motor 0: configuration register| +|0x24|4|conf_0|r/w|no|motor 0: motor configuration register| 
-|0x28|4|conf_1|r/w|no|motor 1: configuration register|+|0x28|4|conf_1|r/w|no|motor 1: motor configuration register|
 |..|4|..|r/w|no|..| |..|4|..|r/w|no|..|
 |0xhh|4|set_conf_0|w|no|motor 0: set bits in conf_0 (atomic)| |0xhh|4|set_conf_0|w|no|motor 0: set bits in conf_0 (atomic)|
Line 332: Line 347:
 |0xll+4|4|top_1|r/w|no|motor 1: prescaler for top speed| |0xll+4|4|top_1|r/w|no|motor 1: prescaler for top speed|
 |..|4|..|r/w|no|..| |..|4|..|r/w|no|..|
-|0xnn|4|acc_0|r/w|no|motor 0: acceleration between start and top speed| +|0xnn|4|acc_0|r/w|no|motor 0: acceleration prescaler between start and top speed| 
-|0xnn+4|4|acc_1|r/w|no|motor 1: acceleration between start and top speed|+|0xnn+4|4|acc_1|r/w|no|motor 1: acceleration prescaler between start and top speed|
 |..|4|..|r/w|no|..| |..|4|..|r/w|no|..|
-|0xoo|4|stepps_todo_0|r/w|no|motor 0: number of steps to do| +|0xoo|4|dest_steps_0|r/w|no|motor 0: destination position (number of steps)| 
-|0xoo+4|4|stepps_todo_1|r/w|no|motor 1: number of steps to do|+|0xoo+4|4|dest_steps_1|r/w|no|motor 1: destination position (number of steps)|
 |..|4|..|r/w|no|..| |..|4|..|r/w|no|..|
-|0xpp|4|stepps_done_0|r|no|motor 0: number of steps have done| +|0xpp|4|curr_steps_0|r|no|motor 0: current position (number of steps)| 
-|0xpp+4|4|stepps_done_1|r|no|motor 1: number of steps have done|+|0xpp+4|4|curr_steps_1|r|no|motor 1: current position (number of steps)|
 |..|4|..|r|no|..| |..|4|..|r|no|..|
  
-== Configuration Register ==+=== Motor Configuration Register ===
 | 31 | ... | 06 | 05 | 04..03 | 02 | 01 | 00 | | 31 | ... | 06 | 05 | 04..03 | 02 | 01 | 00 |
-| | | Reset Stepcounter | Start | Run Mode | Two Phase | Full Step | Direction |+| | | Reset Step Counter | Start | Run Mode | Two Phase | Full Step | Direction |
  
-__Direction:__ 1 => CW; 0=> CCW\\ +  * Direction: 1 => CW; 0=> CCW 
-__Full Step:__ 1 => full steps; 0=> half steps\\ +  * Full Step: 1 => full step; 0=> half step 
-__Two Phase:__ 1 => two phase operation; 0=> one phase operation. Is only required in full step mode.\\ +  * Two Phase: 1 => two phase operation, 0 => one phase operation. Only required in full step mode. 
-__Run Mode:__ 00 => no holding torque; 01 => stepping mode; 10 => fixed speed; 11 => reserved\\ +  * Run Mode: 00 => free running, no holding torque, 01 => stepping mode, 10 => speed mode, 11 => reserved 
-__Start:__ if set to 1 the motor will start until stopped by a 0 or the number of steps is reached (only in stepping mode)\\ +  * Start: if set to 1 the motor will start. Writing a '0' will immediately stop the motor. The module will clear this bit to '0' when the number of steps is reached in stepping mode. You have to configure the register first and set the start bit only in a next register access. 
-__Reset Stepcounter:__ To reset the step counter, set it to 1 +  * Reset Step Counter: A '1' will reset the step counter
  
-=== Mode Description === +The motor configuration register can be reading or writing at address //conf_x//. You can set a given set of bits to '1' by writing to //set_conf_x// and you can reset to '0' with //reset_conf_x//. 
-__Gererell:__ +
-  *It is not recommended to change from STEP MODE to FIX SPEED mode. It is better to stop the engine first and then change the mode. +
-  *However, when changing from one of these two modes to DISABELD mode, the motor will simply coast to a stop without any braking effect (all windings will be non-magnetized). +
-  *When resetting the modules, the motor keeps the current step (The windings are still magnetized). +
-  *Attention: The acceleration is divided by two within the module. Since the motor accelerates with each trigger edge. Therefore the LSB is not considered by the acceleration. +
-  *An interrupt is triggered when the motor has completed the shutdown and changes normally to the stop state.+
  
-__DISABELD (RESERVED):__ +=== Prescaler === 
-  *The motor is freewheeling here. This means that the motor has no holding torque (all windings are not magnetized). +When a motor is started it will start with its start speed and accelerate to its top speed. Start speed, top speed and acceleration can be configured by setting their corresponding prescaler values. Start and top speed are calculated by the base clock of the submodule divided by the prescaler value. 
- +The acceleration is calculated by the base clock of the submodule divided by 2 times the prescaler value. The acceleration is divided by two within the module because the motor accelerates with each trigger edge. Therefore the LSB is not considered by the acceleration.
-__STEP MODE:__ +
-  *The motor moves through the specified number of steps. It uses a ramp to accelerate up and down. +
-  *Changes in the configuration, prescaler and steps registers are only applied when the motor is at standstill. +
-  *The module sends a signal to reset the start bit (osl_reset_start_bit). When the start bit is manually reset, the motor immediately ramps down without reaching the number of steps. +
- +
-__FIX SPEED:__ +
-  *The motor ramps up to a preset speed. When the command to stop is given, the ramp is lowered again until it comes to a standstill. +
-  *Changes in acceleration and starting speed are only applied at standstill. The maximum speed can be changed at will. Any change in maximum speed is approached with a ramp.+
  
 === Interrupt === === Interrupt ===
-An interrupt is always triggered when the motor has stopped. +An interrupt is asserted when the motor reaches its final position. 
  
-=== Outputs === +=== Output Signals === 
-This subdevice uses 4 pins on the FPGA. They are called A,A',B,B'. For the connection, a distinction must be made between unipolar and bipolar. \\ +This subdevice uses 4 pins per channel on the FPGA. They are called A,A',B,B'. For the connection, a distinction must be made between unipolar and bipolar motors. \\ 
-**Unipolar:** In Unipolar, each coil can be connected to one output. In order to maintain the direction of rotation, the outputs must be connected to the motor in the above mentioned order in CW orientation.\\ +**Unipolar:** In unipolar motors, each coil can be connected to one output. In order to maintain the direction of rotation, the outputs must be connected to the motor in the above mentioned order in CW orientation.\\ 
-**Bipolar:** In the case of the bipolar motor, the outputs are to be considered as pairs. A, A' and B, B' belong together. And thus on a common coil. When A is high, the coil is positively magnetized and when A' is high, the coil is negatively magnetized.+**Bipolar:** In the case of the bipolar motor, the outputs are to be considered as pairs. A, A' and B, B' belong together and thus on a common coil. When A is high, the coil is positively magnetized and when A' is high, the coil is negatively magnetized.
  
 ===== Interrupt Multiplexer ===== ===== Interrupt Multiplexer =====
Line 385: Line 386:
  
 ^Offset^Size [byte] ^Name^r/w^Const^Description^ ^Offset^Size [byte] ^Name^r/w^Const^Description^
-|0x20|4|irq_line_0|r/w|no|IRQ line 0: number to flink IRQ| +|0x20|4|irq_line_0|r/w|no|IRQ line 0: number of flink IRQ| 
-|0x24|4|irq_line_1|r/w|no|IRQ line 1: number to flink IRQ|+|0x24|4|irq_line_1|r/w|no|IRQ line 1: number of flink IRQ|
 |..|4|..|r/w|no|..| |..|4|..|r/w|no|..|
  
Line 396: Line 397:
 1 => first signal (LSB) of the input vector.\\ 1 => first signal (LSB) of the input vector.\\
 2 => second signal of the input vector.\\ 2 => second signal of the input vector.\\
-... (and so on)+... 
  
subdevices.1701856485.txt.gz · Last modified: 2023/12/06 10:54 by ursgraf

Page Tools

  • Show page
  • Old revisions
  • Back to top
Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Share Alike 4.0 International
CC Attribution-Share Alike 4.0 International Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki