Search results

  1. U

    Low-pass filter problem

    Not shown in that diagram is the connection between the ground pins of the two systems. That is important because one is generating an analog voltage with respect to its ground while the the other is measuring a voltage with respect to its ground. The two grounds might not be the same.
  2. U

    SD logger issues

    SD card write times can vary and with large files it gets worse. The best method for dealing with this is to separate the SD writing process from the data collection using buffers. The data collection process stores data into buffers and when a buffer is full the SD write process writes it to...
  3. U

    Teensy4.0 slows down while logging data to SD card

    The specification has something about this. 4.13.1.7.2 (version 8 of the spec) says that the maximum FAT write time shall be less than 750ms. A little later in 4.13.1.8.2 it has a table for various speed classes. All of which show an average time of 100ms but keep that maximum of 750ms. Plus of...
  4. U

    SD Card 4 bit mode license

    Unfortunately, the SD specifications say: What triggers a license requirement? I don't know. Maybe it is hiding in one of those documents or somewhere else on the web site. But people have been writing code to these specs for a couple of decades.
  5. U

    Teensy4.0 slows down while logging data to SD card

    I prefer to write my data logging programs differently. Data collection is driven by interrupts and the data gets packed off to a data buffer. Multiple buffers some power of two times 512 bytes in size. When a buffer is full, the foreground task notices and begins the write operation. This...
  6. U

    Filter acceleration signal

    For more than you ever want to know about your sensor noise, there is Allan Variance. It does require that you collect samples at a uniform and known rate of course.
  7. U

    optimizing SD write access

    You probably want to read the SD specification as it goes into more detail. It used to be pretty simple but with each new revision of the specification it has gotten more complicated. Recording Unit size, Allocation Unit size, Erase size. But if you are writing via something with a file system...
  8. U

    Interrupt End?

    Interrupts vary between processors. Some disable all interrupts while servicing an interrupt (MSP430 for example) others allow higher priority interrupts to horn in. It all depends. Since interrupts are for things that happen infrequently (usually) or need to be serviced quickly, it is always...
  9. U

    SD card and max write current - when is it safe to say that it will not bite?

    CMD6 is included in the libraries. It is used to query the card before switching the clock speed above 25MHz.
  10. U

    SD card and max write current - when is it safe to say that it will not bite?

    You need to read the SD specification as it has quite a bit to say about power limits. For example: "CMD6 mode 0 is used to query which functions the card supports, and to identify the maximum current/power consumption of the card under the selected functions." 200mA seems to be the limit for...
  11. U

    Modbus RTU

    For documents, use Google or other search engine. I think you are confusing the signal requirements on the RS485 side and the micro-controller side. The RS485 side can handle voltages in excess of Vcc. See data sheet. (Common mode range: -7V to 12V) And read The Art and Science of RS485 from...
  12. U

    Modbus RTU

    Or use one of the many MAXIM 3.3V RS485 chips.
  13. U

    Teensy 4.1, Modbus RTU, Sparkfun BOB-10124

    Art and Science of RS485 from Circuit Cellar Ink magazine way back in 1999 is always a good thing to read when starting out with RS485. Google usually turns up a link or two to a copy. Some of the MAXIM chips have slightly altered input thresholds which make idle bias redundant. Although I...
  14. U

    ARM math question

    The M32x16() function looks like a fixed point operation. Sort of. Works with any C compiler but is of course faster on targets with hardware multiply. Like some ARM chips. Floating point and integer multiply on the Teensy 3.6 are equally fast. Although for fixed point what I usually look for...
  15. U

    Maximum average throughput to SD card on T4.1

    I never found that sort of data very useful. I prefer graphs. For my testing I wrote the current value from a hardware timer into the write buffer before issuing the write command. Then read the data back and process to find the time since the previous write command. Producing graphs like...
  16. U

    Maximum average throughput to SD card on T4.1

    Maximum write speed requires writing data in RU (Recording Unit) sized blocks which are over 128KB for big SD cards. But not to worry, it has been a while but I recall looking at the code for one library (I forget which one) and rather than complete a small write would leave it open. Continuing...
  17. U

    Question for those who know the gps system

    Most current GPS receivers will provide data in 30 seconds. This is the time required to receive the ephemeris data. They do not need almanac data. The NMEA data strings contain the almanac data. That and the correct time will let you compute which satellites are in view. But with the current...
  18. U

    RS-485 Serial/Modbus gurus requested for Teensy4.1 running Paul's ModbusRTU library.

    Many of the MAX RS485 parts have slightly altered input thresholds that should eliminate the need for bias. But it reminds me of an article I read in Circuit Cellar long ago that is always a good reference: https://www2.htw-dresden.de/~huhle/ArtScienceRS485.pdf This refers to an application note...
  19. U

    RS-485 Serial/Modbus gurus requested for Teensy4.1 running Paul's ModbusRTU library.

    When you say the RX line goes low with enable line makes me suspect a particular problem. If you disable the RS485 receiver when you enable the transmitter you will have trouble unless you have something to pull up the receiver output. Which is a tri-state. No pullup and it just floats around.
  20. U

    Uart protection

    Consulting "Noise Reduction Techniques in Electronic Systems" by Ott is probably in order. Or maybe not as the chapter on ESD scared me. Put it in a metal box with no connections to the outside world. It's the only safe way. :-)
  21. U

    MODBUS RTU communication

    MODBUS RTU is pretty simple. Unless you are trying to reuse code written by someone else for different hardware. Then you will have to dig into that code to see if it is doing what you need it to. Is it using the serial port you expect? Is the driver enable working? With the correct timing...
  22. U

    Max 31850K and thermocouple non linear Temp. curve ??

    That specification assumes that the internal IC temperature is identical to that of the cold junction. You have to make sure that is true.
  23. U

    Max 31850K and thermocouple non linear Temp. curve ??

    The cold junction on that breakout is where you solder the thermocouple wires to the board. This may not be at the same temperature as the guts of the IC. Especially if it is located badly.
  24. U

    Max 31850K and thermocouple non linear Temp. curve ??

    It is absolutely vital that the MAX31850 and the cold junction be at the same temperature. What steps have you taken to assure that?
  25. U

    Voltage Appearing on LED_BUILTIN pin during startup, Teensy 3.2

    If your only problem is with the LED pin, then the likely culprit is in the startup code. I took a quick look to see if I could spot anything but didn't. There is a hook to allow you to run code early, well before the code to ramp up the clock system and USB with their long delays. The catch is...
  26. U

    Inline assembly - Set all operands as inputs

    Your instruction modifies memory so that should be included. https://www.ibiblio.org/gferg/ldp/GCC-Inline-Assembly-HOWTO.html#ss5.3
  27. U

    Teency LC or 3.2 driving N- MOSFET : current limiting resistor + common ground

    The current limits on the I/O pins is steady state so the pulsed current for driving a MOSFET is not a problem. You do want to put a resistor of 100 Ohms or so as close as possible to the FET gate to limit its tendency to oscillate. (Because of the parasitic inductance of the wire.) For best...
  28. U

    Builtin Sd-Card Teensy 4.1 - SD.begin() errors

    There have been a few changes to the initialization scheme over the years. The two most significant being the SD V1 specification (update from MMC) and the V2 spec. (You might want to have a copy on hand: https://www.sdcard.org/downloads/pls/ It is up to V8 now.) I looked over the init code and...
  29. U

    More of an electronics question about voltage references

    If you use the same voltage source to provide the ADC reference and the supply to the sensor (whose output is proportional to that supply), the absolute value of that supply drops out. The ADC output then depends only on the sensor and not the supply voltage. Assuming a reasonably stable supply...
  30. U

    Two different results from writing the same thing? - Pointer Crazyness

    If you read from a 32 bit register and end up with extra garbage in a 64 bit value, the garbage didn't come from the 32 bit register.
  31. U

    40x4 LCD on Teensy 4.1

    Which is exactly what I was refering to with that 1320us delay when reading data. Do not use that slow version of pulseEnable with its 100us delay. The whole point of checking the busy flag is so you can avoid that delay. The 1us delay just before the function return is pointless. It is wildly...
  32. U

    Interference with two SPI devices (MS5611 and IMU)

    The data sheet for the MS5611 shows separate pins for protocol select and SPI chip select.
  33. U

    40x4 LCD on Teensy 4.1

    I know nothing about that library code. I have only used character LCDs with the MSP430 and writing my own code. Various versions over the years: 4 bit, 8 bit, and with or without read. Before writing new code, look at what you have and see if you can find the problem. With a copy of the LCD...
  34. U

    40x4 LCD on Teensy 4.1

    The resistor is there to limit fault currents when the clamp diode turns on. (5V signal to 3.3V device) Most devices list a current limit (a few mA) in their data sheet but I couldn't find one here. Exceed that limit and you risk latchup. There is a limit of Vdd+0.3V on inputs. You can use...
  35. U

    T4 SDIO SD Card "initialization failed!"

    ACMD41 is not the first command sent (CMD0 and CMD8 precede it) and it appears that this error code is sent if there is a timeout waiting for a response. I can't think of any reason why a card wouldn't respond at all to ACMD41. Unless it doesn't like the voltage range specified in the argument...
  36. U

    Killed another Teensy 3.5 - but don't know how

    Part of that schematic fragment bugs me. While it isn't shown as being connected to anything else, the INA169 output is connected to a capacitor rather than the required resistor. The INA169 puts out a current that you have to convert to a voltage. With a capacitor I don't know how high that...
  37. U

    One register used both as input and output?

    It has been a while since I have looked in this particular rabbit hole, so I have forgotten most of what I learned. :-) Pretty much everything I learned, I learned here: https://www.ibiblio.org/gferg/ldp/GCC-Inline-Assembly-HOWTO.html#ss5.3 It includes an example of using a register as both...
  38. U

    possible ESD/Power Supply issue with T3.6 on robot

    That is not an ESD clamp. It is simply there to protect against voltages which would trigger the internal parasitic SCR between Vdd and Vss. You still have to limit current through the clamping diodes. Not sure how the Vdd side gets along without the clamp. I just finished reading the second...
  39. U

    possible ESD/Power Supply issue with T3.6 on robot

    Unused GPIOs should be set as outputs or at the very least have their internal pull ups enabled so that they don't float. While the pins on CMOS devices will usually have clamping diodes on them those are useless for protection against ESD. You have to provide that. (See also "The Art and...
  40. U

    possible ESD/Power Supply issue with T3.6 on robot

    Connecting any input pin directly to something which the user can touch is a bad idea. Of course I just finished reading Henry Ott's book from start to finish so that final chapter on ESD may color my thinking a bit. The series RC filter is certainly a good idea.
  41. U

    Do I need a Mosfet Driver?

    Microchip makes some nice FET drivers in several varieties. Something like the MIC4416 should do the job.
  42. U

    Help with too many if statements... there must be a better way!

    It appears that all of the ranges are multiples of 30. So divide EncoderCount by 30 and use the result to index into a table. digitalWrite(30, encodertable[EncoderCount/30]);
  43. U

    Analog Input Noise at Midrange

    Which suggests that there is something flaky with the pot. Since you are feeding the pot from an external supply, drop its voltage to say 2V. Does the problem occur at a proportionally lower voltage? If yes then it is definitely the pot. If it stays at 1.65V, then it might be the ADC. ADC's...
  44. U

    SPI issues with external ADC

    The time required to hold CNVH high is 10ns. It would require an exceptionally fast micro to violate that. I would worry with a Teensy 4.1 but not with a 3.2. The conversion time of 700ns is a different story. An easy way to manage this is to lower CNV, read the data, and raise CNV. Do not...
  45. U

    longevity and sealant

    I have a can of the MG Chemical Silicone Conformal Coating that I use on boards that will be exposed to corrosive environments.
  46. U

    SPI issues with external ADC

    Wait a minute, are you really expecting to get 1.8V out of a LM317 with 3.3V in? The minimum input to output differential is 3V.
  47. U

    GPS and DMA

    DMA works best with things that provide data in nice known block sizes. You have what is effectively a continuous stream, since the GPS is not going to wait after each 4KB, you must always be processing data. The ISR that is called when each block of DMA completes must setup for the next block...
  48. U

    Modbus RS484 and Teensy 3.2 implementation

    If this is your first experience with RS485 I recommend digging up an old CIrcuit Cellar article titled "The Art and Science of RS485". Google usually turns up a pdf. One thing to watch out for is the state of your serial data in pin while in transmit mode. The MAX485 floats the receiver output...
  49. U

    Low-level direct IO for SD cards

    It depends a lot on your application. I went the low level route with no file system because I needed higher write speeds. When writing data to an SD card you get best performance when writing in large, and I do mean large, blocks. (See SD specification.) There is a library around that sneaks...
  50. U

    not initialize mpu6050 ,Failed to find MPU6050 chip

    A MPU6050 should always report 0x68. Since this is derived from the I2C address, it should also require a change to that to get something different. Unless it is not a MPU6050. Some other flavor of MPU or even a fake. (The MPU6050 is not recommended for new designs so production of the real...
Back
Top