Forum Rule: Always post complete source code & details to reproduce any issue!

# Thread: Prop Shield Beta Test

1. Originally Posted by manitou
How does the shield connect to the teensy 3? All of my teensy 3's have male pins for breadboard use.
My guess would be using something like: http://www.pjrc.com/store/header_14x1_d.html

2. Hopefully no pins so we can connect it how we wish... have my Teensy pins "upside down"; would like the same with this board. Once the projects complete, pins will be removed

3. I don't yet have the shield, but from the schematic one can derive that the audio amp will clip with a full scale input from the teensy DAC.
The gain will be 2*(40k/(20k+2.2k) = 3.604 = 11.1dB (see the datasheet on page 13).

The Amp's outputs can swing to the rails, but for a reasonable THD+N-figure it needs about 300 to 400mV headroom.***
400mV headroom means a maximum differential output swing of 2*(Vdd-400mV) = 9.2V
Input by the DAC is 3.3V peak-peak, so maximum allowed gain without severe distortion is about 9.2V / 3.3V = 2.788 = 8.91dB.

I guess you used 2.2kOhms for the input low pass because 2.2k is already used on the shield. Fair point from a manufacturing perspective. But this other 2.2ks are I2C-pullups, quite non-critical regarding their value.

My suggestion is to:
change all 2.2k resistors on the board to 6.8k and the 3.3nF caps to 1nF for a gain of 2.98 = 9.48dB
or
change all 2.2k resistors on the board to 8.2k and the 3.3nF caps to 680pF for a more conservative gain of 2.84 = 9.06dB

Another thought: you can omit the RC-lowpass on the inverting input and connect the 1uF do AGND directly (and recalculate the remaining lowpass on the DAC output to readjust gain). pro: less parts. con: degrades PSRR and CMRR due to input impedance mismatch, so this might be a bad idea in an unshielded mixed-signal environment.

I hope I didn't miscalculate anything

***One can calculate that by extracting data points from the Output Power vs Supply Voltage graphs, page 8, then use P=Urms^2/R --> sqrt(P*R)=Urms, and Urms*sqrt(2)=Upeak)

Ben

4. Got my prop shield, thanks! That was fast. I hope to begin testing on saturday.

5. Mine arrived too !
With longer header pins, my "connector board 2.0" fits great and is still breadboard compatible (sorry, no pics allowed )

(@Paul i sent you a photo)

Now some testing..

Edit: I2C works..
Code:
```Scanning...
Device found at address 0x1E  (LSM303D,HMC5883L,FXOS8700,LIS3DSH)
Device found at address 0x20  (MCP23017,MCP23008,FXAS21002)
Device found at address 0x60  (MPL3115,MCP4725,MCP4728,TEA5767,Si5351)
done```
Edit:
Amplifier works. Needs the following:
Code:
```  pinMode(5, OUTPUT);
digitalWrite(5, HIGH);```
Edit: 5-Volt Outputs: Work both (tested with DVM only)

6. Mine arrived today as well!

Thanks, should be a lot of fun.

But looks like I may need to order a few more T3.2s

Also may make an order to Adafruit for the LEDS or any other suggestions.

Thanks again!

Kurt

7. hmm.. there is a problem with the flash.
Code:
```Flash Memory has 8388608 bytes.
Erasing ALL Flash Memory:
estimated wait: 20 seconds.
Yes, full chip erase is SLOW!
.....................
Erase completed
actual wait: 22 seconds.```
Code:
```Raw SerialFlash Hardware Test

Read Chip Identification:
JEDEC ID:     EF 40 17
Part Nummber: W25Q64FV
Memory Size:  8388608 bytes
Block Size:   65536 bytes

Reading Chip...

Writing 4096 signatures
error writing signature at 0
Read this: FF FF FF FF FF FF FF FF
Expected:  00 00 00 00 15 F5 95 4B

Tests Failed  :{

The flash chip may be left in an improper state.
You might need to power cycle to return to normal.```
The hardware, at least the connections, seem to be ok as it reads the JEDEC ID correctly.. so it can't be a problem with cs, sck, miso or mosi. correct ?
Unfortunately i have no access to the flash-WP pin (board is soldered under the teensy) to check the voltage.

8. Mine arrived today as well.

I still find through hole soldering slow going, so I tend to move my Teensys from breadboard setup to breadboard setup rather than dedicating them to a particular build. But with the prop board, I'm going to have to dedicate a Teensy to being used by the prop board so that I can solder pins to connect the DAT pin for speaker output.

It might be useful to include a set of 5 pin male headers in the retail package similar to the 2 sets of 14x1 male headers provide, in case people don't have their own set of headers. By now, I have headers of every sort, but I'm thinking of somebody just starting out that gets a Teensy and Prop kit and wants to make something for an upcoming convention. I see complaints on the Sparkfun board from time to time about lack of headers (Adafruit tends to provide them, so you don't see it there).

I looked around for drivers for the FX0S8700, and I didn't see any. Google search would deliver pages mentioning the Pololu LSM303* boards (but in the link FX0S8700 was not mentioned). Is the FX0S8700 compatible with the LSM303* boards at the i2c level, or it there another set of libraries we should use for the motion sensing and compass functions. I see the datasheet at http://cache.nxp.com/files/sensors/d...CQ.pdf?pspll=1, but I would prefer not to have to re-invent the wheel to access it.

<edit #1>
If you ever re-do the PCB, it may make sense to add something like 'speaker' near the front 4 pins for the speaker output. Given these pins are directly under the micro USB port of the Teensy, I suspect somebody may mis-read it, and think the +/- refers to the USB interface and not the audio interface. I don't expect too many people to be confused, but you never know.

9. good news..
i hav'nt found the exact problem (maybe later this this evening), but after adding some delays into SerialFlashChip.cpp the flash works!!!

so, my board is 100% ok.

10. Hey there,

What a nice surprise! I'd be very glad to beta test this.

Thanks guys

11. Bugfix for my flash problem:

In SerialFlashChip.cpp,
void SerialFlashChip::write(uint32_t addr, const void *buf, uint32_t len) {

add a delay:
Code:
```        CSASSERT();
// write enable command
SPI.transfer(0x06);
CSRELEASE();
max = 256 - (addr & 0xFF);
pagelen = (len <= max) ? len : max;
//Serial.printf("WR: addr %08X, pagelen %d\n", addr, pagelen);

delayMicroseconds(1); //<------- ADD THIS !!!!

CSASSERT();
if (flags & FLAG_32BIT_ADDR) {
SPI.transfer(0x02); // program page command
SPI.transfer16(addr >> 16);```
I have no idea why this is needed, but now it works (with 120MHz, too)
The documentation of the chip mentions no delay (?!)

Edit: This is sufficiant, too:
asm volatile("NOP");

(hm. suspicious. could it be a compiler problem (too much optimizing for CSRELEASE()...CSASSERT()? between them there should one F_BUS cycle pause minimum, correct? I#m using a newer compiler)

Edit:
making "max" volatile, works too... - but a NOP is the better way, i think.

12. Ever so excited

Thanks for including me

I'm not 100% sure what to do with it yet but definitely will involve an audio library Synth and my usb midi keyboard

...

...

...

I lied. My plan is complete.

13. Originally Posted by MichaelMeissner
It might be useful to include a set of 5 pin male headers in the retail package...
Quite agree, I am one of those that are starting out on Teensy; returning to "electronics" after a 20 year-ish break. Including a few cheap headers will please a fair number of customers.

Originally Posted by MichaelMeissner
I looked around for drivers for the FX0S8700, and I didn't see any...
I'm a seasoned programmer, since aged 6! So I'm coming at this from a programmers point of view. I recently bought a HMC5883L and quite frankly think that there's a better way of doing things than the Arduino way. I'll will almost certainly be writing my own code for some, if not all of this board. I'm also quite happy to shared relevant code with, at least, this group. After all, if no-one had re-invented the wheel, we wouldn't have created the tyre!

14. I did one search - turns out onehorse put something on his GitHub:[/URL]
https://github.com/kriswiner/FRDM-FXS-MULT FXOS8700CQBasicExample.ino
FXOS8700CQ combination 14-bit accelerometer/16-bit magnetometer
FXAS21000 14-bit gyroscope

USMail said I'd have my Prop board today - but apparently the wormhole Portland to Seattle opened again and 2 days isn't enough to cover 180 miles.

15. a black hole where gravity is too high and time goes slow.. Einstein was right.
ha!. or somebody inserted too many "NOP"s

The wormhole was between OR and Germany Never got anything from US so fast ! Somebody pressed the "turbo" knob..

good night.

16. Trying to think of a project within my reach. Here are some ideas in case anyone else wants ideas:
• POV globe
• POV top
• Poi, etc.
• Ball with LEDs that responds to acceleration, e.g. bouncing, spinning, changing direction
• Weather station with anemometer based on deflection either of the module hanging from a cord or deflection of the module mounted on a spring (think car antenna)
• Handheld sensor including compass, temperature, barometric pressure, inertial navigation for orienteering or add a GPS module and display for full nav system.
• UAV guidance system
• Student lab instrument for learning about the physics of motion, i.e. force, gravity, friction, momentum, momentum, etc.
• Combine with audio shield to make a toy that responds aurally to being moved, tossed, dropped, etc.
• Estimate fluid flow rate in a pipe based on the vibration of the pipe

17. If it was a black hole - I would expect to never see it (though that has happened). I think the USMail has those with an aversion delivery in inordinately fast times - when they saw the wormhole they choose select packages for alternate means of delivery - slower than the pony express

18. My prop shield arrived.

Testing with teensy 3.1 96mhz opt (clip-jumpers for now), IDE 1.6.7, loader 1.27

I2C scan OK
I2C device found at: 0x1E
I2C device found at: 0x20
I2C device found at: 0x60

SPI serial flash: EraseEverything and RawHardwareTest OK (lastest SerialFlashlib from github), also created and read some files
(reran tests @120mhz, all OK). serial flash OK with teensy LC @48MHz

Used https://github.com/sparkfun/MPL3115A2_Breakout
pressure/altitude and temperature OK
Altitude(ft):625.82 Temp(f):78.01
Altitude(ft):626.85 Temp(f):78.01

used Paul's https://github.com/PaulStoffregen/Magnetometers_Test

FXOS8700: 11.20 19.10 95.30
FXOS8700: 10.50 18.80 98.10
seems to be doin' something
added readTemp (0x51) get 22C OK

used https://github.com/sabas1080/FXAS21002C_Arduino_Library
T Gyroscope: 9
Gyroscope X: 16301 Y: 105 Z: 16362
T Gyroscope: 0
Gyroscope X: 16287 Y: 128 Z: 16362
T Gyroscope: 0
Gyroscope X: 16320 Y: 111 Z: 16371
doing something, but temperature T is funky ?
FIX: added false to endTransmission in readReg(), fixed temperature
T Gyroscope: 26

used https://github.com/mlwarner/fxos8700cq-arduino
Mag X: 16375 Y: 16379 Z: 16381
Accel X: 1806 Y: 60 Z: 12848
doin' somethin
added temperature and change readReg to use false in endTransmission, temp 22C ok

sine wave to DAC, AGRND, Vin, Grnd, pin 5 HIGH, DAC and opamp output to cheap scope, all with jumper wires. DAC 3.3v wave looks fine, opamp + output is very jagged (spread spectrum?), but opamp path looks operational

No LEDs, but with pin 5 HIGH, confirmed DATA and CLK are OK with logic analyzer.

19. Originally Posted by defragster
USMail said I'd have my Prop board today - but apparently the wormhole Portland to Seattle opened again and 2 days isn't enough to cover 180 miles.
It worked for about 75 miles north of you

20. Has anyone tried the linked onehorse lib? Or another?

Originally Posted by KurtE
It worked for about 75 miles north of you
Could be - I'll need to deal with import from Canada ... 2.5 days on the road - even the post office isn't sure where it went.

21. Got my beta yesterday in good order, and I think I have a nifty idea for this. I'll have to look into it a bit deeper before I say anything though :-)

22. Paul, dude... this has everything I've been looking for, all in one nice small neat package! This is useful for SO many things!
So here's one of my crazy idea that has been brewing for a long time, but haven't had a chance or excuse to do.
Slotcat + teensy3.x + prop shield == slotcar that could:
* Not wipe out... accellerometer could detect when bad motion is happening, and slow down for me
* Drive the track on its own
* Provide nifty race sounds as it goes around the track
* Crazy cool lighting on the car.
* other strange things like send data back to phone/tablet and graph out G-forces and the like.

NICE!!!

23. can someone confirm or deny the clipping issue I suspected in post #28? Mine's still on its way.

24. Originally Posted by Frank B
Bugfix for my flash problem:
....
Edit:
making "max" volatile, works too... - but a NOP is the better way, i think.
Thanks!

I'll get this merged in a few days. At the moment I need to clean up the IMU code....

Originally Posted by MichaelMeissner
I looked around for drivers for the FX0S8700, and I didn't see any.
Please hold on for a day or two. I'm still cleaning up the magnetic cal stuff.

Or if you *really* want to play now, there's this very rough code...

https://github.com/PaulStoffregen/Magnetometers_Test

Originally Posted by Ben
can someone confirm or deny the clipping issue I suspected in post #28? Mine's still on its way.
You might be off by a factor of 2, or something, since the specs are fully differential. Sorry, didn't have time to go through your analysis in detail right now.

But I can tell you a 3.3Vp-p full scale DAC output is able to make the amp clip somewhat. A 1.2Vp-p can not. (yes, I've already done quite a bit of testing) Those two DAC ranges actually work out pretty nicely, 1.2V for normal to quiet rooms, and use 3.3V (not quite the full range) for noisy rooms or outdoors.

The seemingly redundant or unnecessary parts connected to the inverting input (pin 2) are meant to balance the impedance seen by the LM48310. There's a least a couple old threads on this forum and at least one youtube video where people experienced quite a lot of switching noise coupling when they tried to use class D amps. This board also has APA102 LED signal output, so we can expect people to use it together with dozens, perhaps hundreds of LEDs, where the current can rapidly switch by multiple amps as the LED turn different colors, or use different PWM patterns. My cautious approach here is meant to allow this chip's good CMRR to (hopefully) give us nice, clean audio even in the presence of a tremendous amount of power supply noise, from the class D switching and massive LED current changes.

Please be patient, and then you can test with the real hardware.

25. Originally Posted by defragster
Nice, 'Prop Shield' makes sense now after seeing the name dropped. Glad you got over its issues - and to be included, Thanks. Looked at the LC - 5V buffers allows 'output a 5V logic signal'. How many pins @5V? Is this the right family to order: Adafruit DotStar
@defragster, yes, particularly the APA102 leds (Adafruit calsl them dotstar). These have rapid update and are the 'current' goto led for props that get twirled, thrown, spun, POVed, etc.

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•