Adept Scientific - English
The world's best software and hardware for research, science and engineering.
flag arrow
clearclear

 Adept Store | register Join My Adept | Flags  
Adept Scientific | Amor Way | Letchworth Garden City | Herts | SG6 1ZA | Tel: +44 (0)1462 480055  
UKdedksvnofi
Home
Products
Training
Events
 Buy Online
Downloads
Academic Discounts
Support
My Adept
International |  About Us |  Adept Scientific Blog |  Contact Us |  Press Room |  Jobs
Adept Scientific on Facebook Adept Scientific on Twitter Adept Scientific on YouBube Adept Scientific on LinkedIn
Knowledge Base  > Browse Categories  > Measurement Computing
PWM with Measurement Computing Counter cards and Universal Library

Email This Article

To email this article enter and address below and click on the "Email" Article button.



Last Modified: 3rd Jan 2013
Category: Data Acquisition Hardware and Software > Measurement Computing
Version: All
Article Ref.: CC0E
»Return to previous search
»Print friendly version of this article.
4 out of 4 people have found this article useful.
PWM with Measurement Computing Counter cards and Universal Library

We have implemented a PWM control using Universal Library controlling the 8254 counter chip on a PCI-DAS1200. You should be able to do the same using Softwire or Universal Library and any MCC board with a 8254 counter with three user counter channels. You could also use the 9513 counter chip boards in a similar way.

The Universal Library program simply sets up the counter channels which then run stand-alone on the board. The program needs to update one of the counter channels to change the pulse width, but having done so the counters then continue to run stand alone on the board. The program is used to initially set the counters modes, then only needs to update one counter to change pulse width. This means the PWM waveform is very solid with no jitter.

Set up

NB: We used the internal clock source as the master clock (You could use an external clock if you wished.) All the counters must be clocked by the same source. Only counter 4 of the PCI-DAS1200 can be software configured to use the internal clock. There is no direct access to the internal clock on the screw terminal panel however it is possible to access the internal clock by configuring counter 4 to use the internal clock (this is a setting which can be configured from Instacal.) The internal clock signal is then present on the OUT of counter 4, and this can be used as the main driving clock by wiring this pin to the external clock pin of the other counters. This is an indirect way for the other counters to use the internal clock.

Counter number:8254 Mode:Comment:
4Mode 3 Squarewave Squarewave mode just to access boards Internal clock. Internal clock is 10MHz and I set this counters COUNT register to 10 so OUT is 1MHz: seemed convenient...
5Mode 2 Rate GeneratorGives a trig pulse at required period - this sets period of 1 PWM cycle
6Mode 1 Hardware Retriggerable One-ShotThe length of the PWM LOW period is set by the loaded COUNT into this counter, This one shot 'LOW' pulse is triggered by the OUT of  counter 4,


Operation

1. Counter4 CLK input is driven by the Internal XTAL clock on the board (you set this connection in software in Instacal.)
2. Counter4 OUT feeds the CLK i/p of Counter 5 and 6 (you need to hard wire this- see  wiring diagram.)
3. Counter 5 produces a trigger pulse periodically, you set the rate of this pulse by loading the required value into the COUNT register for this counter.
4. Counter 6 CLK input is driven by Counter 4 OUT (you need to hard wire this- see  wiring diagram.)
5. Counter 6 is set to One shot mode, and it's OUT is normally high , but when it gets a rising edge i/p on it's GATE it's OUT goes LOW for a period determined by the value you have loaded into it's COUNT register.
6. The final PWM output is from Counter 6 OUT, you set the mark space ration by loading the required value into this counter's COUNT register.
7. NB: Counters 4 and 5 GATE need to be held high to enable these counters  (you need to hard wire this- see wiring diagram.)



Wiring Diagram




Notes

If you would like to look at the SoftWIRE example, the latest version of SoftWIRE 5.1 can be downloaded free of charge from the Adept Scientific Downloads page:

http://www.adeptscience.co.uk/products/dataacqu/computerboards/softwire/

2.
 
82C54.pdf PWM_Counter_Softwire5.1.zipMkPWM.veeULCT01.CPP
 
Related Articles
adept

Top of the Page

Popular Links: ChemDraw | ChemOffice | Data Acquisition | Data Analysis | EndNote | Maple | MapleSim | Mathcad | MathType | Quality Analyst | Reference Manager | VisSim

EU ePrivacy Directive | Our Privacy and Terms and Conditions Statement
All Trademarks Recognised. Copyright © 2013, Adept Scientific plc.
Site designed and maintained by Lyndon Ash

Adept Scientific | Amor Way | Letchworth Garden City | Herts | SG6 1ZA | Tel: +44 (0)1462 480055