Editing Modulation Plugin

Jump to navigation Jump to search

Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.

The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.

Latest revision Your text
Line 1: Line 1:
This project aims to develop an Modulation Plugin Module, to be used in conjunction with a 8/16 bits embedded system such as the dsPic33F development board.
+
==ToDos==
 
+
*make sure each components freq. response, to make sure the highest freq.  
==ToDo==
+
*place DAC into this module board together, then only 4 wires(Vcc, I2C clk, Gnd & I2C data) from host.
*Voltage during "Lo" time of DAC can also be set (i.e. not necessary zero)
+
*understand all components
*modulation cct & PCb
+
*call sample
**Bias resistors for op-amp
+
*draw circuit and PCB and grounding problem
**crystal & SMD res. too close, easy to short when soldering
+
*test by real circuit and firmware
**footprint of some chips are too small, enlarge it for easily soldering
 
**some cct modification
 
***modify the res. value
 
  
  
Line 14: Line 11:
 
*The modulation module is used to deliver a digital output signal with the following characteristics:
 
*The modulation module is used to deliver a digital output signal with the following characteristics:
 
**Square wave
 
**Square wave
**Variable frequency (0 - >10kHz)
+
**Variable frequency (>1kHz)
 
**Variable amplitude (0V - 2.5V)
 
**Variable amplitude (0V - 2.5V)
**Accuracy frequency response (error < 2%)
+
*interface to MCU which do the control
*Interface to MCU which do the control
+
 
 +
 
 +
Q: Is square wave where the "Lo" time is always at "GND" OK?
 +
Q: If not, is a switch between "Lo is GND" vs. "Lo is negative Hi" OK? Or does "Lo" need to be independently controlled with another ADC?
  
 +
Q: Will people be connecting a speaker directly to the output, requiring a relatively high-power output [[op amp]] such as the LM386N-3 ?
  
 
==Software Solution==
 
==Software Solution==
*Timer Interrupt controlling I2C DAC can only achieve frequency response of about 500Hz
+
*Timer Interrupt controlling I2C 10-bit DAC can only achieve frequency response of about 1kHz
 
**5byte/cmd
 
**5byte/cmd
 
**8bit/byte
 
**8bit/byte
Line 27: Line 28:
 
**This yields 10kHz (0.1ms)
 
**This yields 10kHz (0.1ms)
 
**As OS context switch is 10ms, set timer to 1ms (1kHz), so that 0.9ms can be used to process other tasks
 
**As OS context switch is 10ms, set timer to 1ms (1kHz), so that 0.9ms can be used to process other tasks
**timer frequency of 1kHz yields a modulation frequency of 500Hz
 
 
*Due to higher freq. response requirement, so using hardware to implement the clock
 
*Due to higher freq. response requirement, so using hardware to implement the clock
  
  
 
==Hardware Solution==
 
==Hardware Solution==
 
  
 
===Circuit===
 
===Circuit===
Line 48: Line 47:
 
    
 
    
  
*This architecture allows the square wave to run at a very high frequency, even with a slow I2C and a slow DAC.
+
This architecture allows the square wave to run at a very high frequency, even with a slow I2C and a slow DAC.
  
  
Line 79: Line 78:
 
w 272 128 336 128 0
 
w 272 128 336 128 0
 
w 176 256 176 144 0
 
w 176 256 176 144 0
r 272 224 272 288 0 10000.0
+
r 272 224 272 288 0 1000.0
 
w 272 128 272 224 0
 
w 272 128 272 224 0
 
w 272 288 272 352 0
 
w 272 288 272 352 0
 
159 144 128 208 128 0
 
159 144 128 208 128 0
r 208 128 256 128 0 10000.0
+
r 208 128 256 128 0 1000.0
 
w 256 128 272 128 0
 
w 256 128 272 128 0
 
w 144 256 176 256 0
 
w 144 256 176 256 0
r 336 224 336 288 0 10000.0
+
r 336 224 336 288 0 1000.0
 
g 336 352 336 368 0
 
g 336 352 336 368 0
 
w 336 288 336 352 0
 
w 336 288 336 352 0
 
w 336 192 336 224 0
 
w 336 192 336 224 0
r 352 192 432 192 0 10000.0
+
r 352 192 432 192 0 1000.0
o 4 64 0 34 2.5 9.765625E-5 0 -1
+
o 4 64 0 34 2.5 7.8125E-4 0 -1
 
o 0 64 0 35 5.0 9.765625E-5 1 -1
 
o 0 64 0 35 5.0 9.765625E-5 1 -1
o 11 64 0 34 2.5 3.90625E-4 2 -1
+
o 11 64 0 34 2.5 0.0015625 2 -1
 
</nowiki></pre>
 
</nowiki></pre>
  
  
===Selected Chips===
+
==Components Inside Circuit==
 +
 
 +
===DAC chip===
 +
*datasheet -- http://focus.ti.com/lit/ds/symlink/dac6574.pdf
 +
 
 +
===CLK chip===
 +
*CY2545 : [http://download.cypress.com.edgesuite.net/design_resources/datasheets/contents/cy2545_8.pdf datasheet] buy at [http://new.hqew.com/Web/Public/Buyer/ICStockSearch.aspx?keyword=cy2545 here]
 +
 
 
{|border="1" cellspacing="0" cellpadding="5"
 
{|border="1" cellspacing="0" cellpadding="5"
 
|+  
 
|+  
!  Part No. !! Description
+
!  Part No. !! Opertating Volt !! Operating Freq !! Min Volt !! Max Volt !! output freq !! Min Temp !! Max Temp !! Pin
 
|-valign="top"
 
|-valign="top"
| [http://ww1.microchip.com/downloads/en/DeviceDoc/70165E.pdf dsPIC33FJ256GP506-I/PT] || uP programed as I2C Quad-channel programmable clock[*]
+
| CY2545 || 2.5V, 3.0V, 3.3V || 400KHz || -0.5V || 4.5V || 3- 166 MHz
|-valign="top"
+
| -40<sup>o</sup>C || 85<sup>o</sup>C || 24-pin
| [http://focus.ti.com/lit/ds/symlink/dac7574.pdf DAC7574IDGS] || Quad-channel 12-bit I2C DAC
+
|-
|-valign="top"
+
| NIL || NIL|| NIL || NIL || NIL
| [http://focus.ti.com/lit/ds/symlink/sn74ahc4066.pdf SN74AHC4066PWR] || Quad-channel Bilateral Analog Switch
+
| NIL||NIL || NIL || NIL
|-valign="top"
+
|-
| [http://focus.ti.com/lit/ds/symlink/opa4340.pdf OPA4340EA] || Single-Supply, Quad-channel, Rail-to-Rail Operational Amplifiers
 
 
|}
 
|}
*[*]Alternatives: [http://www.maxim-ic.com/quick_view2.cfm/qv_pk/4474 DS1089L]: 3.3V Center Spread-Spectrum EconOscillator
+
CLK 1-8 : frequency output
 +
  CLK 3 : frequency selection (FS)
 +
          (Function 2) cy2545 has 4 PLLs, each PLLs can be set 2 frequency, CLK 3 use to select the frequency
 +
  CLK 6 : spread spectrum ON/OFF control input
 +
          (Function 2) for synthesizing and modulating the frequency
 +
Vdd_CLK_BX (X=1,2,3) control the output frquency of Blanck X (X=1,2,3)
 +
 +
                +------------------+       
 +
                |        |        |------CLK 1
 +
                |        |Blanck 1|
 +
                |        |        |------CLK 2
 +
                |------------------|   
 +
                |        |        |------CLK 3
 +
                |        |Blanck 2|------CLK 4
 +
                |        |        |------CLK 5
 +
                |------------------|
 +
                |        |        |------CLK 6
 +
                |        |Blanck 3|------CLK 7
 +
                |        |        |------CLK 8
 +
                +------------------+
 +
CLKIN/RST ---1. 2.5V/3.0V/3.3V external reference clock frequency
 +
              2. Reset function POR :back to default condition /  
 +
                        Clean Start : keep the programmed value
 +
Xout        Crystal frequency output
 +
Xin/EXCLKIN Crystal frequency input/ 1.8V external clock input
  
 +
*Coding
 +
  [Start Bit]->[7-bits devices]-->[R/W bit]-->[  Slave  ]-->[  8-bits    ]--> .. 
 +
  [ address ]  [  address    ]  [      ]  [ CLK ACK ]  [memory address] 
 +
 
 +
  ..[ACK]-->[8-bits]-->[  8-bits    ]-->....[  8-bits    ]......until... [stop bit]
 +
    [  ]  [ data ]  [data in MA+1]      [data in MA+n]              [        ]
  
===Overall Performance===
+
===Analog Switch===
 
+
*http://focus.ti.com/docs/prod/folders/print/ts5a1066.html
====dsPic Programmable Clock====
+
*call sample
*I2C Baudrate: 400kHz
 
*Output Voltage Range: 0 - 3.3V
 
*Output Frequency Range: 0 - 200kHz
 
**Cannot reach higher frequency due to minimum time to execute code in interrupt routine is about 500ns
 
*Number of channels: 4
 
*Accuracy of frequency: <2%
 
**Conditions: external crystal, no OS context switch, single channel operation
 
**Measurements (by scope)
 
***+/-2.100kHz@200kHz => 1.05%
 
***+/-0.520kHz@100kHz => 0.52%
 
***+/-0.140kHz@50kHz => 0.28%
 
***+/-0.006kHz@10kHz => 0.06%
 
***+/-0.002kHz@5kHz => 0.04%
 
***+/-0.200Hz@1000Hz => 0.02%
 
***+/-0.000Hz@500Hz => 0.00%
 
***+/-0.000Hz@100Hz => 0.00%
 
***+/-0.0001Hz@50Hz => 0.02%
 
***+/-0.000Hz@10Hz => 0.00%
 
***+/-0.000Hz@5Hz => 0.00%
 
*Accuracy of frequency: <2%
 
**Conditions: external crystal, no OS context switch, 4 channel operation, Ch2 = 1kHz, Ch3 = 50kHz, Ch4 = 200kHz
 
**Measurements of ch1 (by scope)
 
***+/-2.000kHz@200kHz => 1.00%
 
***+/-0.520kHz@100kHz => 0.52%
 
***+/-0.130kHz@50kHz => 0.26%
 
***+/-0.130kHz@10kHz => 0.06%
 
***+/-0.002kHz@5kHz => 0.04%
 
***+/-0.200Hz@1000Hz => 0.02%
 
***+/-0.100Hz@500Hz => 0.02%
 
***+/-0.000Hz@100Hz => 0.00%
 
***+/-0.010Hz@50Hz => 0.01%
 
***+/-0.000Hz@10Hz => 0.00%
 
***+/-0.001Hz@5Hz => 0.02%
 
  
 +
{|border="1" cellspacing="0" cellpadding="5"
 +
|+
 +
! Part No. !! Operating Volt(V) !! Freq Resp(Hz) at 3V !! On-state Resist(Ω) at 3V !! Min Volt(V) !! Max Volt(V) !! Min Temp !! Max Temp !! Indenpent Circuit !! Voltage Supply Source !! Pin !
 +
|-valign="top"
 +
| [http://focus.ti.com/lit/ds/symlink/sn74ahc4066.pdf SN74AHC4066] || Vcc : 2V~5.5V || 35MHz || 29Ω || Vcc : -0.5V || Vcc :  7V||-40<sup>o</sup>C || 85<sup>o</sup>C || 4 || single || 14
 +
|-
 +
| [http://www.nxp.com/acrobat_download/datasheets/74HC_HCT4051_3.pdf 74HC4051D] || Vcc : 2V~10V Vee : -10V~2V || Nil || 80Ω || Vcc :-0.5V Vee : -11V  || Vcc :  11V Vee :  2V ||-40<sup>o</sup>C || 85<sup>o</sup>C || 4 || Dual || 16
 +
|-
 +
| [http://www.onsemi.com/pub/Collateral/MC74VHC4051-D.PDF MC74VHC[[4051]]] || Vcc : 2V~6V Vee : -6V~0V || 80MHz || 80Ω || Vcc :-0.5V Vee :-7V  || Vcc :  7V Vee :  5V ||-40<sup>o</sup>C || 85<sup>o</sup>C || 4 || Dual || 16
 +
|-
 +
| [http://www.onsemi.com/pub/Collateral/MC74VHC4051-D.PDF MC74VHC[[4052]]] || Vcc : 2V~6V Vee : -6V~0V || 90MHz || 90Ω || Vcc :-0.5V Vee :-7V  || Vcc : 7V Vee : 5V ||-40<sup>o</sup>C || 85<sup>o</sup>C || 4 || Dual || 16
 +
|-
 +
| [http://www.onsemi.com/pub/Collateral/MC74VHC4051-D.PDF MC74VHC[[4053]]] || Vcc : 2V~6V Vee : -6V~0V || 120MHz || 90Ω || Vcc :-0.5V Vee :-7V  || Vcc : 7V Vee : 5V ||-40<sup>o</sup>C || 85<sup>o</sup>C || 4 || Dual || 16
 +
|-
 +
|}
  
===[http://chungyan5.no-ip.org/vc/?root=modulation_plugin SVN Server]===
+
*more information about the series 7400 in wiki: http://en.wikipedia.org/wiki/7400_series
*Contains circuit PCB and software
+
*there is model G which is super high speeds at more than 1 GHz in 7400 family, however this model is very expensive.
====Version 1.00.01====
 
*dsPic programmable clock + dac + analog switch + op-amp
 
====Version 2.02.00====
 
*dsPic programmable clock only.
 
*dac + analog switch + op-amp introduce bouncing noise spikes when switching.
 
*New board provides trigger signal to external circuitry only.
 
  
===Testing Procedure===
+
===op-amp buffer===
 +
*OPA340
  
====Version 1.00.01====
 
*For each channel (ch 1 - 4) at pin H2.1, H2.3, H2.5, H2.7
 
**Use a CRO to watch the signal
 
***Enable the channel
 
***Adjust the voltage from 0 - 2.5V (measure accuracy).
 
***Adjust the frequency from DC - 200kHz (measure accuracy). If frequency is not accurate, check crystal circuitry.
 
  
 +
==Possibly Useful References ==
  
[[category:projects]]
+
[http://www.ladyada.net/wiki/openbench/fgen An open source waveform generator]

Please note that all contributions to OpenCircuits may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see OpenCircuits:Copyrights for details). Do not submit copyrighted work without permission!

Cancel Editing help (opens in new window)