Forum Rule: Always post complete source code & details to reproduce any issue!
Results 1 to 4 of 4

Thread: Teensy 3.1: number of PGAs is actually 2?

  1. #1
    Junior Member
    Join Date
    Nov 2012
    Posts
    4

    Teensy 3.1: number of PGAs is actually 2?

    As far as I can tell, there are two independent PGAs on the Teensy 3.1 chip; if this is true and there are no chip errata in the way, might want to update the technical-specs table here:

    http://www.pjrc.com/teensy/teensy31.html

    This is relevant for me because I'd like to use both ADCs in differential mode and with PGA enabled on both channels. At first I was a bit worried that this was not possible, or that a single PGA was shared or multiplexed among both ADCs, or something like that. (I haven't yet run an experiment with an actual Teensy 3.1 board to verify.)

    See also Figure 3-32 in the reference manual, which seems to clearly show that each ADC has its own PGA.

    Thanks!

  2. #2
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    17,617
    Yes, you're right, it does say there are 2. I must confess, this is one of the parts of the new chip I haven't tried actually using yet.

    Two are also defined in the ADC docs. I've added the register defs on github. They'll be in the next Teensyduino version.

    https://github.com/PaulStoffregen/co...23d5614867d7a7

    I've updated the web page too. Thanks for pointing this out.

  3. #3
    Junior Member
    Join Date
    Mar 2013
    Posts
    18
    Just to clarify, you are not speaking of an on chip FPGA ? which would be awesome.

  4. #4
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    17,617
    Quote Originally Posted by brianb00 View Post
    Just to clarify, you are not speaking of an on chip FPGA ? which would be awesome.
    LOL, that would be awesome. But no, there's no Programmable Gate Array on Teensy.

    In this case, PGA means Programmable Gain Amplifier.

    Teensy 3.1 has 2 of these special amplifiers. Why I thought there was only 1, I'm not sure. It was a simple error when I made that page in the week before we released version 3.1. There are a LOT of last minute things to do, so it's kind of a miracle I didn't mess up more details on the documentation.

    These amplifiers let you measure tiny analog voltages. They're fully differential, so you can read tiny voltages that aren't referenced to ground, as long as they're between 0 to 3.3V. That's useful for certain types of sensors like thermocouples and strain gauges. It might also be able to lets some cheap condenser microphones work, maybe?

    Currently there's no support for this in analogRead(), so you'll have to hack the low level code. There's a register to turn the amplifier on, using either a standard mode or a lower power mode where it has slower response, and of course some bits to configure the gain. It can amplify the signal up to 64X. The ADC needs to read one of the other "unused" analog inputs, which is where the amplifier's output connects (all inside the chip), again not currently supported by the analogRead() code, but also pretty easy to hack by just changing a number.

    I haven't actually done this yet, so all this is only from reading the documentation. It looks pretty straightforward, but there might be hidden gotchas.

Tags for this Thread

Posting Permissions

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