Weird A6 behavior on Teensy 3.1

Status
Not open for further replies.

phoenixperry

Active member
Hey folks. I am using the sparkfun XBee shield w/the teensy 3.1 and I have some problems. My hot prob is that A6 is acting bonkers. All my analog pins will do an analogRead just fine except A6. A6 is just stuck at like 986. If I touch the pad with the jumper I have plugged in to my circuit 's sensor she jumps to 1021 and does not move even if I change the sensor output.

Now here's the weird bit - it behaves perfectly as an analogWrite pin - no issues at all. It gladly goes from 0-3.3V no problems as expected.

I can promise you all this isn't a code issue (I teach pcomp for a living at the University level and have an MS from an Engineering school).

Why is only this pin being weird. It's consistent.

Thoughts? Anyone else seen this? It's a first gen teensy 3.1 and I bought it out of the vending machine at NYU resistor. She's legit hardware.

Now my bottom row of header pins are soldered in tossing just the teensy on a breadboard isn't an easy affair. It's my last one!
 
I worked in the IT field and we've seen people who claim to be MCSE certified yet they managed to bend the pins on the cpu/mainboard. Even the most perfect coder in the world can make mistakes, not saying it's you, just saying in general.

could you post a pic of the teensy and your wiring?
 
It's the same wiring and same code that works on every other analog pin - it's the pin. I'm just asking to see if this is a known problem, not to debug a circuit I am positive works down an entire row of pins and suddenly quits working on a specific pin.
 
Only one pin damaged sounds a bit strange.. :)
But ok, may be possible.
I guess, it's a software-problem. Either in your code or maybe, in the core-lib ?
If you post some code, i can try it on a 3.1
 
I second what #tonton mentioned, pictures help to clarify things. Example: people don't mention that they have not soldered the pins into the Teensy and hope friction will make good connections or pins ... Or don't describe the complete setup.

Example: I may be confused here but how do you plug the XBee Shield into a Teensy?
My assumption is maybe you are using a sparkfun Teensy Arduino shield? https://www.sparkfun.com/products/13288

If so how are you using A6? I believe the only place it comes out is to a jumper that allows you to use A6/A7 for the SCL/SDA pins instead of the default A4/A5 pins.

But again only guessing
 
Ground is just cut off in the photo - it's plugged to in on the other side. Sorry not going to upload another photo now. It's my data plan and I can't get my phone on wifi at work. I will later though if folks really need to see it.
 
Thanks, it helps to see pictures and know which product...

If it were me, I would probably try touching all of the pins again with solder iron and make sure good contacts. And/or I would use Ohm meter and measure the resistance from the pin on the Teensy to your breadboard.
 
Ok my scope is giving me the same thing - I just get a steady 3.3V no mater what I do on A6 and on A7 it does exactly what you'd expect which is vary the voltage with light the full range.

The pin only works as PWM and only as output.

Also tighten all my joints under magnification with my good iron.
 
FWIW, I tested just now as well. Works fine. I tested twice, with the green Teensy 3.1 from the last batch we ever made (with the white pushbutton), and a black Teensy 3.1 from the very first batch. Both work fine. I tested on a breadboard.

t31.jpg
 
Thank you! Yes - it's the shield. I'll read up on the other link. I really, really regret not getting the pink one. Dear lord, I think of that fondly. Thank you for checking for me!
:D
Phoenix
PS. I have a different shield and it seems to be ok so far. Should I put that 10k resistor between reset and 3.3v on mine?
 
Last edited:
The UART/SUART switch is on your XBEE board is connected to 20/A6 and 21/A7. So if the switch is in SUART position then weird things might happen.
 
Ok! So - on to new problem with this same shield.
I'm using the sparkfun explorer to receive serial data. I have the radios set up as serial pass through. I'm doing nothing at all tricky other than writing serial data.
This is the code I am using:
int val = 0;
void setup() {
// put your setup code here, to run once:
val = 0;
Serial.begin(9600);
}

void loop() {
int val2 = val + 10;
val = val2;
if(val2 > 100){
val = 0;
}

Serial.println(val);
delay(200);

}

Next step is I make sure the xbee isn't attached and I program the teensy. No problems - all goes well.
I plug the teensy into an external power supply via the teensy USB port spitting 3.23 (on average according to my scope) with the xbee now attached.
I open up xctu and connect to my sparkfun explorer via the USB port to monitor the received serial data.
I get nothing.

I am pretty sure the radios are configured correctly. If I just pop the radio off the teensy/xbee shield and into an Uno / Seeed shield and power that, my sparkfun explorer gets the data as expected.

I have the switch put in uart1 mode, which I think is correct for this code as I'm not using the software serial port.

Any guesses as to why my teensy isn't getting data out to my xbee? I ran my scope into the shield with the teensy & xbee on it and these are the voltages at on the xbee pins:
VCC: 2.7
DIN: 2.7
DOUT: 2.66

So - the xbee isn't getting 3.3 - our VCC out after the xbee pulls voltage is too low.

Here's my fear. I plug into the power rail and bye bye little teensy!

I'm only using a series 1 xbee with an external antenna. It should be more than fine off the 3.23 volts. The guide for hooking this shield up (https://www.sparkfun.com/products/13032) infers it should be fine just running the power into the teensy unless I am totally misunderstanding it.
I know it's not exactly 3.3 but there's some variance on the from your standard wall socket.

If I remove the xbee and read the VCC with the teensy powered from the wall 3V supply I get a stable 2.91v

Thoughts? Suggestions?

Not enough power?
Thanks everyone!
 
Last edited:
I'm following this with this link http://www.digi.com/resources/docum...rence/r_xb_xbpro_s1_802.15_leg_power_reqs.htm
which now leads me to think it's got ample voltage as it's getting 3V at the supply before I plug the xbee in on the VCC pin.

Also, my power supply is up to 350mA of current just in case people are curious.

Another odd thing is if I send keystrokes to the teensy / xbee shield externally from xctu via the explorer, the light on the DOUT pin lights up. I would think it would be DIN as I'm sending data in to it.

Here are photos:

Teensy w/shield (usually plugged in - I just have it swapped out right now b/c I made sure the code was indeed the same on it and the UNO)
https://www.dropbox.com/s/9y91f2dr3lh6r73/IMG_20170125_100900019.jpg?dl=0

Teensy sending 0 data
https://www.dropbox.com/s/p7rfvexfyiu6ogs/IMG_20170125_100936831.jpg?dl=0

Moving the radio from the teensy / xbee shield to my uno / seeed shield with the same code
https://www.dropbox.com/s/j25xn831istqah0/IMG_20170125_100828086.jpg?dl=0

Data coming in as it should to xctu out of the UNO
https://www.dropbox.com/s/itb1p801yxcxumk/IMG_20170125_100802891_BURST000_COVER.jpg?dl=0
 
Last edited:
On Teensy, Serial is USB Serial and the first HardwareSerial port (pin 0 and 1) is Serial1.

https://www.pjrc.com/teensy/td_uart.html
The most common issue with serial ports on Teensy is use of code designed for Arduino Uno with Serial within the code. On Teensy, Serial accesses the USB. For hardware serial ports, Serial1, Serial2, Serial3, Serial4, Serial5 or Serial6 must be used.
 
Status
Not open for further replies.
Back
Top