Enclosed Type
The USB communication of CNC woodworking engraving machine with single chip microcomputer
by:Transon
2020-07-25
For interpolation arithmetic in the client software, must transfer the motion of the motor can make steps, direction, speed and motion information to CNC woodworking engraving machine at the bottom of the single chip microcomputer, sending way of communication is through the USB transmission, USB transmission speed, can meet the interpolation arithmetic of interpolation in the process of data transmission needs.
( 1) Circuit connection diagram
system USES AT89S52 control PDIUSBD12 transmission data, and real-time control signal output. Its circuit connection diagram as shown in the figure below. USB support four transfer types: interruption, control, and synchronization. Engraving machine system reliability is the key, on the premise of meet the requirements of data transmission speed, the system adopts the control transmission and interrupt transmission two kinds of ways.
PDIUSBD12 as complete interrupt-driven firmware design, use KeilC51 to write. USB transmission can be in the background, its basic idea is: the background ISR ( Interrupt service routine) And the foreground of data exchange between the main program loop by event flags and data buffers. The microcontroller program, the control of the motor pulse output real-time requirements of the highest, so set the timer interrupt level to high level, the single chip microcomputer internal ring buffer, timer interrupt routine check ring buffer fills, and when allowed to reopen the low-level interrupt service.
( 3) USB device driver development
USB device driver must comply with the WDM ( The Windows driver model) Specification. WDM driver has two main initialization entry point) DriverEntry and AddDevice routines. DrvierEntry main job is to put all sorts of function Pointers, fill in the driver object to register other callback routines. The PnP manager will call for each hardware instance an AddDevice routines, AddDevice function's main job is to create a device object and connect it to the device stack. Driver and application program and hardware communication is between IRP ( I/O request packet) The finished. In the running process, the kernel will call different callback routines to complete different IRP. DriverUnload is the removal of the equipment when unload routine.
( 4) USB application development
completed the USB firmware program development and USB device driver development, the USB host client programs, you can write the upper real play to the role of the USB device. Application by accessing the API communication function, is located in the upper application and is located in the lower level of device drivers for data exchange.
engraving machine price information in the numerical control network.
( 1) Circuit connection diagram
system USES AT89S52 control PDIUSBD12 transmission data, and real-time control signal output. Its circuit connection diagram as shown in the figure below. USB support four transfer types: interruption, control, and synchronization. Engraving machine system reliability is the key, on the premise of meet the requirements of data transmission speed, the system adopts the control transmission and interrupt transmission two kinds of ways.
PDIUSBD12 as complete interrupt-driven firmware design, use KeilC51 to write. USB transmission can be in the background, its basic idea is: the background ISR ( Interrupt service routine) And the foreground of data exchange between the main program loop by event flags and data buffers. The microcontroller program, the control of the motor pulse output real-time requirements of the highest, so set the timer interrupt level to high level, the single chip microcomputer internal ring buffer, timer interrupt routine check ring buffer fills, and when allowed to reopen the low-level interrupt service.
( 3) USB device driver development
USB device driver must comply with the WDM ( The Windows driver model) Specification. WDM driver has two main initialization entry point) DriverEntry and AddDevice routines. DrvierEntry main job is to put all sorts of function Pointers, fill in the driver object to register other callback routines. The PnP manager will call for each hardware instance an AddDevice routines, AddDevice function's main job is to create a device object and connect it to the device stack. Driver and application program and hardware communication is between IRP ( I/O request packet) The finished. In the running process, the kernel will call different callback routines to complete different IRP. DriverUnload is the removal of the equipment when unload routine.
( 4) USB application development
completed the USB firmware program development and USB device driver development, the USB host client programs, you can write the upper real play to the role of the USB device. Application by accessing the API communication function, is located in the upper application and is located in the lower level of device drivers for data exchange.
engraving machine price information in the numerical control network.
Custom message