Jump to content

peterd

Members
  • Content Count

    10
  • Joined

  • Last visited

About peterd

  • Rank
    Beginner

Profile Information

  • Country
    United States
  • Are you University user?
    No
  1. Atan2(sin(θ), cos(θ)) uniquely determines angle throughout a full 2pi rotation. A single arctan(sin(θ)/cos(θ)) is ambiguous since negative valued sin(θ)/positive cos(θ) has the same value as positive sin(θ)/negative cos(θ) Additionally, using atan2 in fixed point is computationally faster and more precise than dividing sin/cos and then doing arctan(). The result angle of fxAtan2 ranges from 0 to 1, atan2 ranges from -π to π In the plot above we use 1 Hz sin and cos.
  2. The thing to remember about SPI is that the Master controls the clock. So if you want to read data from the slave, the Master must write dummy data to the slave just to drive the clock even though the slave will ignore any data that the Master writes. In your diagram the Master never does a write, so no data will be exchanged. The attached diagram has the master drive the clock at a 1kHz rate. Please try it. SPI-New-Slv2.vsm
  3. Hi Jake, I'm a little unclear about what you want to do. Please attach your diagram so we can advise you better.
  4. Select Embedded > Piccolo > ADC > ADC Config... and see the screen below. Each ADC block is associated with an ADC result register. In the dialog screen below, you map analog pins on the chip to result registers. The default mapping is shown below. The trigger source is an event that causes an ADC sample to occur. The timer 2 is used as the RTOS timer, so is a default for the ADC trigger. It is also common to use a PWM to send an ADC SOC (Start Of Conversion) also. To see an example of plotting ADC values, select Embedded > Examples > Piccolo > ADC > ADCtestF28035 The datatype of the ADC result is fx4.16, this means that it has 4 magnitude bits and 12 fractional bits. Since the ADC result is only 12 bits, the value can range from 0 to 1 (or 0 to .9997 to be precise)
  5. Post your .vsm files so we can see what the problem might be
  6. For some reason, your environment variable VS_DIR is not set. It should be set to c:\stembed2017 in your case. The link below explains how: https://www.computerhope.com/issues/ch000549.htm
  7. Toolbars can become stacked vertically for no apparent reason. The stacked tool bars are due to the unmaximized window of being quite narrow. Solution is to: 1) unmaximize 2) mouse drag vertical edges of app window to expand near full screen 3) arrange toolbars as desired, then exit. On restart, toolbars should retain horizontal arrangement.
  8. Toolbars can become stacked vertically for no apparent reason. The stacked tool bars are due to the unmaximized window of being quite narrow. Solution is to: 1) unmaximize 2) mouse drag vertical edges of app window to expand near full screen 3) arrange toolbars as desired, then exit. On restart, toolbars should retain horizontal arrangement.
  9. Yogesh, what distances are you trying to measure? It affects the data rate of the timer as it can only hold 16 bits. The attached should measure up to 34 meters with .5 mm accuracy. I assume pin functions as follows: Pin Functions P1.1 - send usonic pulse out P1.2 - read return pulse P1.0 - set high when distance > 40cm Pete pulseMeasurement.vsm
×
×
  • Create New...