Search results

  1. Kuba0040

    Generating an accurate 32768Hz signal with a Teensy 4.0

    Thank You, I'd like to know which test point it is, as there are quite a few on the bottom of the PCB. I have previously attached some wires to the bottom GPIO pins of my teensy board. Desoldering these would take some time and I'd rather not do that if the test point turns out to be somewhere...
  2. Kuba0040

    Generating an accurate 32768Hz signal with a Teensy 4.0

    Hello, I need to urgently figure out how to generate, as accurately as possible a 32768Hz 50% duty cycle pulse with a Teensy 4.0. I’ve built a clock for a friend (not using the teensy, it’s an unrelated project) and need to tune its crystal oscillator. I need a as accurate as possible reference...
  3. Kuba0040

    Allowing the compiler to choose a register - Inline assembly

    Hello, I have this function written in assembly. It loads a 32-bit value from memory, performs a OR operation on it with another variable, and then saves it back into the same place in memory. Basically, it does this: some_variable |= value_to_or_with; But it allows you to do this on any memory...
  4. Kuba0040

    Inline assembly - Set all operands as inputs

    Thank You, all works perfectly now.
  5. Kuba0040

    Inline assembly - Set all operands as inputs

    Hello, I am currently working on a program where the compiler is driving me nuts, so I decided to go around it with inline assembly. I have prepared this function that takes in two pointers. The goal for it is to take the address of pointer [value_to_store] and store it at the address of...
  6. Kuba0040

    How do I manually input a memory address into a pointer?

    Hello, I’ve done some testing as well as applied the DMA base offset and all works fine now. I can write to the TCD just like I wanted to, however with slight problem. When I want to write into SADDR (for example, but the same issue occurs with any other pointer) an address of a different...
  7. Kuba0040

    How do I manually input a memory address into a pointer?

    Hello, I have a simple question today. I want to maunally input some memory addresses into pointers, so then I can write and read data from these addresses easily. Here is an example: int32_t *TCD_SADDR=0x1000; int32_t *TCD_DADDR=0x1010; I want the pointer TCD_SADDR to point to address 0x1000...
  8. Kuba0040

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

    Hello, I have figured out what I was doing wrong by complete accident while preparing the source code for this post. It seems like I didn’t set the SOFF and DOFF registers properly (they were all 0). All works fine now. I apologize for not providing the full source code before. I will provide...
  9. Kuba0040

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

    Thank You. This has just made the issue even more confusing. Maybe the compiler is feaking out?
  10. Kuba0040

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

    Hello, I’ve encountered some weird behavior when using pointers. My goal is to write the address in memory of an array to the DMA Source Adress register (SADDR). However, some weird things happen. Here is my code: int32_t TestChunkMemory[64]; //Array in memory int32_t...
  11. Kuba0040

    Warning when saving memory address to variable?

    Hello, I have a pretty simple piece of code. I want to store the memory address of TestChunkMemory into TestChunkAdress, as shown here: int32_t TestChunkMemory[64]; uint32_t TestChunkAdress=&TestChunkMemory; However, the compiler always gives me this warning: warning: invalid conversion from...
  12. Kuba0040

    Passing a memory address to a function.

    Hello, This will take some explaining, so here it goes. I have an array in memory to which I have setup a pointer to called ArrayPointer, so I can pass on the array to other functions: int32_t myArray[64]; //Real array in memory int32_t *ArrayPointer=myArray; //Pointer to the array Now, one...
  13. Kuba0040

    Printing 64-bit numbers on the Serial Monitor?

    Thank You. The "Serial.printf("64bit hex: 0x%" PRIX64 "\n", 0x01234567'89ABCDEF)" method works perfectly.
  14. Kuba0040

    Printing 64-bit numbers on the Serial Monitor?

    Hello, I am currently debugging a program using the Serial Monitor and could really use the ability to print the contents of 64-bit variables in HEX. However, the stock print and println functions don’t seem to work with 64-bit numbers. Do I just have to write my own printing routine or is...
  15. Kuba0040

    Configuring DMA crashes CPU?

    Update: I’ve figured out what was wrong. The DMA_TCDx_NBYTES_MLOFFYES register isn’t just a normal register like DMA_TCDx_CR for example. Where each bit always controls the same thing. Here, what individual bits do in the DMA_TCDx_NBYTES register changes based on your other settings. If you...
  16. Kuba0040

    Configuring DMA crashes CPU?

    Hello, I've updated both the Arduino IDE and Teensyduino as well as cleaned the Temp folder after instalation (Windows 10). Indeed I had the old version however the issue still presists.
  17. Kuba0040

    Configuring DMA crashes CPU?

    Thank You, While it makes no sense, I think I'll keep using the DMA how I am now in most cases. I feel like I'm learning more this way. However thank you for the suggestion.
  18. Kuba0040

    Configuring DMA crashes CPU?

    Hello, I am trying to get the DMA working on a Teensy 4.0. To do so I’m currently in the process of reverse-engineering the DMAChannel.cpp and .h file, along with the datasheet's help. However, I have encountered a peculiar problem. When I try to configure the DMA, writes to some registers...
  19. Kuba0040

    Why is digital audio processed in blocks, why not one sample at a time?

    Hello, I've done some testing, and encountered some issues, mainly with the DSP Extensions I am most confused about them. Are you referring to situations like the SMLAWx instruction - better known as “signed_multiply_accumulate_32x16x” from the Audio Library's DSP list - where it has two...
  20. Kuba0040

    Why is digital audio processed in blocks, why not one sample at a time?

    Thank You. Yea, I haven't even taken into consideration the IRQ losses. Thank you very much.
  21. Kuba0040

    Why is digital audio processed in blocks, why not one sample at a time?

    Hello, This is something I’ve been wondering recently. I am coding from scratch my own software synth on the Teensy 4.0. Why don’t I use the Audio library? – I need something that I can easily add my own modules to and that runs faster. During the development I noticed something. Observations...
  22. Kuba0040

    One register used both as input and output?

    Hello, I am trying to get a fast function that will compute this: (a*b>>32)+sum for me: a, b and sum are uint32_t variables. With the help of more people here I have already figured out the a*b>>32 part. Now I want to add the accumulation step. After checking the instruction set for the ARM M7...
  23. Kuba0040

    Array Pointers just as fast as Normal Arrays?

    Hello, I am currently writing a program where speed is a big factor for me. I have a 2048 cell array in a separate .h file that I want to be able to read quickly. I want to use a pointer to do that, here is how I’ve set it up, the contents of myArray as well as the variable read_value are both...
  24. Kuba0040

    Adding more DSP instructions to Arduino Code.

    It works like a charm. I've just changed the variables to be uint32_t instead of int32_t. The total execution time is only 1 CPU cycle. Perfect! Thank You very much everyone.
  25. Kuba0040

    Adding more DSP instructions to Arduino Code.

    Hello! Recently, in one of my projects I ran into a situation where I need to quickly multiply two unsigned 32-bit numbers (uint32_t) together and then shift the result 32 bits to the right. There exists a DSP instruction in the ARM M7 (Teensy 4.0) CPU called "smmul" which performs a similar...
  26. Kuba0040

    How to use I2S on a Teensy 4.0?

    Hello, I'm just posting to let people know that all is working now. I have configured the communication to occur just like my bit-banging tests with a single 16-bit word, and a active high SYNC pulse during transmission. I have kept the RX module to generate the Bit Clock, as the TX's pins are...
  27. Kuba0040

    How to use I2S on a Teensy 4.0?

    Thank You, I'll try it out. I've already setup the communication to have the correct number of bits per LR pulse, but I'll try to play some more with the I2S parameters. Though I can see that I may have made a few mistakes in my setup so hopefully I'll be able to get this working. Thank You very...
  28. Kuba0040

    How to use I2S on a Teensy 4.0?

    Hello, Unfortunately, I can't try to verify it with the audio library because, you see. This DAC isn't even I2S. It's an old chip (YM3014). It is working and I have figured out how to communicate with it using manual bit banging with fastDigitalWrite before, and all works fine. However, I've...
  29. Kuba0040

    How to use I2S on a Teensy 4.0?

    Hello, I would like to use the I2S functionality that the Teensy 4.0 has to communicate with a DAC chip. To do this I've dug up the output_i2s.h file written by Paul Stoffregen. Along with his accompanying forum post I was able to roughly figure out what each part does, and with some slight...
  30. Kuba0040

    Controlling things with the Teensy without the CPU's involvement?

    Hello, I've gotten the SPI to work at the correct clock and all other critical parameters, however I have ran into a slight problem. While I was figuring out how to communicate with the YM3014 using CPU-driven bit-banging I noticed something. This chip absolutely requires one more clock pulse...
  31. Kuba0040

    Controlling things with the Teensy without the CPU's involvement?

    Hello! I want to connect my Teensy 4.0 board up to some older chips. I want the teensy to be able to communicate with them. Now these chips, being you know… old. Want their digital signals to be held high or low for let’s say… a minimum of 250ns. That would constitute a clock of 4MHz. Now...
  32. Kuba0040

    GPT Timer Locks UpTeensy.

    Hello, I am in the process of getting the GPT Timers figured out and setup via low-level means. I am doing this to learn how they work, without any extra libraries. I am using the 24Mhz Crystal Oscillator as a clock. Unfortunately, I am running into problems. In my ISR function void...
  33. Kuba0040

    Low Level Timer Programming. GTP Timers

    Hello, I am currently trying to learn how to use the GTP timers of the Teensy 4.0's CPU. I am doing this as a part of my general adventure into learning how to use ARM microcontrollers as AVR isn’t doing it anymore. Today I wanted to tackle the GTP - General Purpose Timer. I mainly tried to...
  34. Kuba0040

    Using Teensy's DSP instructions

    Hello! So, the Teensy 3.0 and 4.0 boards have a pretty cool CPUs on them with a lot of useful DSP instructions that can speed up many tasks dramatically. I'd like to take advantage of these. Thankfully, the Audio library comes with a very neat dspinst.h file, where all the DSP instructions are...
  35. Kuba0040

    Adding custom blocks to the audio library

    Hello, I am reposting this from another subgroup. This is probably against the rules, however, a lot in my project depends on this. Sorry. I would like to add some custom "blocks" to the audio library. In my case a envelope follower block. Which can be made very, very efficient if written on...
  36. Kuba0040

    Adding functionality to the audio library. (New DSP blocks)

    Hello, I am working on a vocoder right now using the teensy 4.0. I need to create some sort of envelope follower for the vocoder bands. However, the method using the rectify block and a biquad filter isn't working very well for me. Plus, a dedicated envelope follower, especially with the FPU and...
  37. Kuba0040

    attachInterrupt priority (Teensy 4.0)

    Hello, I am working on a project using the audio library that has 2 running interrupts in it. The first one is a IntervalTimer which triggers an interrupt at a fixed rate. The other is a rising pin interrupt (attachInterrupt). I would like to be able to set the priority for these interrups so...
  38. Kuba0040

    Maximum signal level on audio inputs.

    Hello, I'd like to connect some analog circuitry to the audio board's (Rev D with Teensy 4.0) line level inputs. And I have a couple of questions. First of all. What is the voltage range for the accepted line in signals (From Teensy GND)? So, they get converted to values from 0 to 65,535 (entire...
  39. Kuba0040

    Using the Hardware Timers - Teensy 4.0

    Hello, I am working on a project that requires some precise timing. Not only repeated interrupts on equal intervals but also precise time delays. So I want to use the 32 bit hardware timers of the Teensy 4.0. I am aware of the IntervalTimer object. But that isn't enough. So here is my question...
  40. Kuba0040

    Using less pins - Audio library

    Thank You :)
  41. Kuba0040

    Using less pins - Audio library

    Hello, So in my latest project I am using a Teensy 4.0 with the audio board. I noticed however (more like saw on this pin diagram: https://www.pjrc.com/store/teensy40_card10a_rev2.png ). That almost all the pins are used up by the audio library. But here is the thing. My project only uses I2S...
  42. Kuba0040

    Measuring precise CPU time.

    Thank you guys :)
  43. Kuba0040

    Measuring precise CPU time.

    Hello, I am doing some optimization work on my Teensy 3.2 synth (unreleated to the audio library). I would like to test and see how much faster some methods of doing things are over others. Basically, is there a way to measure precisely (individual CPU cycles would be great) how long does code...
Back
Top