[I'm rediting to get the port table below to work...I'll take any hints on how to input tables here, this is the best I could do. Spaces and tabs are your enemy.]
I have some I\O intensive work I used a Teensy 3.6 for. I do direct reads on ports that have bits 0-7 exposed. Putting the two reads together yields the desired 16 bit input. I had had massive pin conflict problems arriving at this implementation, but I got it done. I used up every single CPU cycle and was able to sample an external ADC at 100khz on 8 simultaneous channels at 16 bits. The ADC goes to 200khz so I'm looking at Teensy 4 push that.
With the reduced number of pins, the parallel input on Teensy 4.0 gets messier, but the added CPU speed can deal with it if the number of port reads can still be kept to 2 or less. Given the Teensy 4's CPU speed, it seems that I'd choose to execute the fewest port reads possible in favor of messier bit shuffling in the CPU. Please confirm.
Paul mentioned Teensy 4.0 upgrades for next year. (I can't find the thread now.) Is there any advance info on how the pin-port mapping might work out? Any chance a port with a contiguous 16 bits might be exposed? That'd be sweet.
With present Teensy4 units I'm expecting conflict mania sorting out what pins to use. I haven't tested doing port reads where unused pins in the port are configured for output, used for SPI etc. Any advice on things to look out for?
If I understand the pinout correctly, I'll still need to make two port reads to take in a minimum of 16 bits. The obvious choices are AD_B1 and EMC. I have no idea what EMC is or what it might conflict with. Where can I read?
If we assumed I was going to be using a Teensy 4 with SPI and an SD card, how could I hopscotch through the pins to obtain 16 bit bits with only two port reads and no conflicts? I mapped the Teensy 4 ports to bits below. I omitted the SD_B0 port assuming it would be off limits for SD card use.
Bonus points for fewest CPU cycles to shuffle the bits into the proper order...its a pittance at 600mhz
AD_B1_00...B0_00...B1_00
AD_B1_01...B0_01...B1_01
AD_B1_02...B0_02..............AD_B0_02
AD_B1_03...B0_03..............AD_B0_03
AD_B1_04........................................EMC_04
.....................................................EMC_05
AD_B1_06........................................EMC_06
AD_B1_07........................................EMC_07
AD_B1_08........................................EMC_08
AD_B1_09
AD_B1_10
AD_B1_11
................B0_12..............AD_B0_12
......................................AD_B0_13
AD_B1_14
AD_B1_15
....................................................EMC_31
....................................................EMC_32
....................................................EMC_36
....................................................EMC_37
I have some I\O intensive work I used a Teensy 3.6 for. I do direct reads on ports that have bits 0-7 exposed. Putting the two reads together yields the desired 16 bit input. I had had massive pin conflict problems arriving at this implementation, but I got it done. I used up every single CPU cycle and was able to sample an external ADC at 100khz on 8 simultaneous channels at 16 bits. The ADC goes to 200khz so I'm looking at Teensy 4 push that.
With the reduced number of pins, the parallel input on Teensy 4.0 gets messier, but the added CPU speed can deal with it if the number of port reads can still be kept to 2 or less. Given the Teensy 4's CPU speed, it seems that I'd choose to execute the fewest port reads possible in favor of messier bit shuffling in the CPU. Please confirm.
Paul mentioned Teensy 4.0 upgrades for next year. (I can't find the thread now.) Is there any advance info on how the pin-port mapping might work out? Any chance a port with a contiguous 16 bits might be exposed? That'd be sweet.
With present Teensy4 units I'm expecting conflict mania sorting out what pins to use. I haven't tested doing port reads where unused pins in the port are configured for output, used for SPI etc. Any advice on things to look out for?
If I understand the pinout correctly, I'll still need to make two port reads to take in a minimum of 16 bits. The obvious choices are AD_B1 and EMC. I have no idea what EMC is or what it might conflict with. Where can I read?
If we assumed I was going to be using a Teensy 4 with SPI and an SD card, how could I hopscotch through the pins to obtain 16 bit bits with only two port reads and no conflicts? I mapped the Teensy 4 ports to bits below. I omitted the SD_B0 port assuming it would be off limits for SD card use.
Bonus points for fewest CPU cycles to shuffle the bits into the proper order...its a pittance at 600mhz
AD_B1_00...B0_00...B1_00
AD_B1_01...B0_01...B1_01
AD_B1_02...B0_02..............AD_B0_02
AD_B1_03...B0_03..............AD_B0_03
AD_B1_04........................................EMC_04
.....................................................EMC_05
AD_B1_06........................................EMC_06
AD_B1_07........................................EMC_07
AD_B1_08........................................EMC_08
AD_B1_09
AD_B1_10
AD_B1_11
................B0_12..............AD_B0_12
......................................AD_B0_13
AD_B1_14
AD_B1_15
....................................................EMC_31
....................................................EMC_32
....................................................EMC_36
....................................................EMC_37
Last edited: