Search results

  1. Q

    DMA to 9-bit display

    Just busy talking to myself over here but realised two things.. firstly that bit-banging would be even more difficult as I'd have to do it on the clock line also. Secondly as SPI data has no start and stop bits like serial, I could just have a silly big for loop and insert those ninth 'data'...
  2. Q

    DMA to 9-bit display

    OK. Sorted roadblock A. I was inadvertently overflowing the buffer, which caused a string of other issues. So now I'm just trying to do 9-bit DMA SPI writes (from an 8-bit array). Bit-banging a single high bit between writes seems to be the most logical approach.
  3. Q

    DMA to 9-bit display

    Further investigation.. this is the line in SPI.cpp where it faults the 2nd time:_dmaRX->TCD->ATTR_SRC = 0;
  4. Q

    DMA to 9-bit display

    I've tried creating a local buffer in my main program code so I control the setup of it, and using memcpy to shift the buffer into it before directing SPI.transfer to it (proving that the buffer is copying correctly but using my SPI.transfer9 fn first). Neither putting DMAMEM nor aligning to...
  5. Q

    DMA to 9-bit display

    Sure, here's the report: CrashReport: A problem occurred at (system time) 7:12:34 Code was executing from address 0xB28A CFSR: 82 (DACCVIOL) Data Access Violation (MMARVALID) Accessed Address: 0x27 Temperature inside the chip was 36.47 °C Startup CPU clock speed is...
  6. Q

    DMA to 9-bit display

    I've been using a 256x64 display in one of my designs for some years now and it's been great, but I'm limited to 20MHz SPI and that makes a full screen write a touch over 4ms for 9-bit. It's 9-bit because I don't use a D/C pin, I run the display in 9-bit mode with the MSB low for C, high for D...
  7. Q

    SPI, DMA, EventResponder?

    Wise folk! I'd really love your help. I've jumped through a lot of hoops on this project already, including making 3-wire SPI happen (because when I did my due diligence I wasn't thorough enough and read 3-wire SPI as simply meaning no MISO connection.. this cost me a day of my life as I've...
  8. Q

    9-bit SPI, any more accessible on Teensy 4.0 ?

    FWIW, I did get this to work by modifying the SPI.cpp file in Paul's SPI library. port().TCR = (tcr & 0xfffff000) | LPSPI_TCR_FRAMESZ(8); // turn on 9 bit mode Literally just pinched that from the transfer16 function in there (duplicated the function, tweaked it some) tested it and it came up...
  9. Q

    9-bit SPI, any more accessible on Teensy 4.0 ?

    Hi folks, There was this old discussion about 9-bit SPI on Teensy 3.2. I wondered if it's any more accessible on Teensy 4.0 ? Does the MCU allow for it? If so, is there some code I can find to initialise this, or modify the SPI library to allow it? Many thanks!
  10. Q

    QNEthernet connect() grief

    Hi Shawn, thanks for this library and for such a comprehensive response! My code above - which I drastically reduced from the main program to try and rule other factors out - gave me about the same amount of grief (with nc -lvk 80) as I was getting with my main code that talks to a device via...
  11. Q

    QNEthernet connect() grief

    I make interfacing devices that use a mix of UDP and TCP, and usually have a small webserver for configuration. I was using embedded T3.2's, then T4's with Wiznet W5500's, but these days I largely use the Teensy 4.1 with its native ethernet. Last year I moved a couple of projects from the...
  12. Q

    VS Code/Platform IO and Lockable Teensy 4.1

    How to use lockable Teensy's with VSCode/PlatformIO I found this thread helpful but I found no documentation on how to use lockable Teensy’s with VSCode/PlatformIO. This is what I had to do to run it on my install on macOS. I didn’t want to install the Arduino app, I’ve been happily using...
  13. Q

    Risks to non-locked Teensy 4.0

    Thanks, that's really helpful! And the raw data they could get off the chip, is that effectively the same as the hex file in terms of vulnerability?
  14. Q

    Risks to non-locked Teensy 4.0

    Hi folks, I think something is missing from https://www.pjrc.com/teensy/td_code_security.html which is the why. I want to know what the risks are with an unlocked (normal) Teensy 4.0. What lengths would someone have to go to, to either read the program off the chip or reverse-engineer a .hex...
  15. Q

    PPP over serial

    *bump* Any ideas, friends?
  16. Q

    PPP over serial

    Hi there, So I've researched this a bit and I'm having trouble finding real examples. PPP over serial is - I gather - how early dial-up modems worked.. the computer handled the PPP transaction itself. PPP over some manner of serial (usually SPI) is still used for ethernet and cellular...
  17. Q

    FastCRC on Teensy 4.0 - Change CRC init value?

    That does appear to work. Thanks!
  18. Q

    FastCRC on Teensy 4.0 - Change CRC init value?

    Hi Frank, Thanks for your speedy reply! You described exactly what I've tried though, and I don't get the correct sum.. You can replicate this by doing the above on a Teensy 3.2 and a Teensy 4.0. If you have an irregular seed, the checksum is different.. and the T3.2 is correct..
  19. Q

    FastCRC on Teensy 4.0 - Change CRC init value?

    Hi there, Hoping to get the attention of the FastCRC library creator, Frank B. I've got a project I'm trying to transition from Teensy 3.2 to Teensy 4.0. It uses FastCRC to create a 16-bit CRC, but it requires a CRC init that is neither 0x0000 or 0xFFFF. I've been using the generic function as...
  20. Q

    From embedded MK20DX256, where to next?

    Yeah that's fair enough. I'll probably have to find something else, for this particular product at least. Thanks for the info.
  21. Q

    From embedded MK20DX256, where to next?

    Hi friends, I've got a product that has evolved from the Atmega328P to the MK20DX256, and I want to take it into production in the near future.. but a consideration is the bootloader chip. If we stick with the MK20DX256 then we'll need to buy a lot of the pre-programmed bootloader chips from...
  22. Q

    SPI clock polarity setup not long enough..

    Hi there, any follow-up on this? :)
  23. Q

    SPI clock polarity setup not long enough..

    Yeah it's a hardware issue it appears. Which means the solution is unlikely to get a whole lot more elegant.
  24. Q

    SPI clock polarity setup not long enough..

    Hi friends, Thanks Paul - I'm sure you're plenty busy! Kurt, I got to the same place the other day, I've just done it more wholesale. Mine fires the empty packet anytime there's a mismatch in settings.ctar & port().CTAR0, so it's a little less efficient. Much better to only do it when the...
  25. Q

    SPI clock polarity setup not long enough..

    Thanks, yes, it may be. The workaround only kind of works. Any time I change clock polarity - including back to the ethernet controller - I need to fire off that dead packet as per the above. That means modifying four libraries, including the very busy ethernet library. The more I read from the...
  26. Q

    SPI clock polarity setup not long enough..

    Update: I've been reading through the NXP documentation for the MK20DX256, and added CSSCK delay to the CTAR register by doing the following in the SPI.beginTransaction(SPIsettings settings) function in the SPI.h library file:settings.ctar |= B11 << 12;This successfully adds setup time, but the...
  27. Q

    SPI clock polarity setup not long enough..

    Any advice on how I can patch this SPI library, friends? I'd be surprised if I'm the first to encounter this, even some of the faster SPI devices in my chain are ignoring the first packet as the clock setup time is insufficient..
  28. Q

    SPI clock polarity setup not long enough..

    I've had a look through the SPI library, and tried adding this to the SPI.beginTransaction(SPIsettings settings) function: digitalWrite(SCK,(settings.ctar >> 26 & B1)); Unfortunately this hasn't fixed things - I don't understand these complex library files well enough to be able to diagnose it...
  29. Q

    SPI clock polarity setup not long enough..

    My temporary workaround is that I've created a function in each of the libraries for the devices as follows: void prepare() { SPI.beginTransaction(test1); SPI.transfer(0x00); SPI.endTransaction(); } This fixes my problem for now, but it's a bit of an ugly fix. You need to transfer the...
  30. Q

    SPI clock polarity setup not long enough..

    That's entirely reasonable :) Here's a test program: #include <SPI.h> SPISettings test1(20000000, MSBFIRST, SPI_MODE1); SPISettings test2(1000000, LSBFIRST, SPI_MODE3); uint8_t cs1 = 22; uint8_t cs2 = 8; void setup() { pinMode(cs1,OUTPUT); pinMode(cs2,OUTPUT); digitalWrite(cs1,HIGH)...
  31. Q

    SPI clock polarity setup not long enough..

    Hi there, I've got a project I've transferred from Arduino to the Teensy 3.2. It has six SPI devices on the bus, of which half are SPI mode 1, and the other half are SPI mode 3. This change in clock polarity wasn't an issue on the Arduino.. but on the Teensy it appears to be. My logic analyzer...
Back
Top