Could I get a footprint of the new board so I can start laying out my circuit board to use it (an eagle library would be even better).
I have a project where I'm using a teensy 3.1, but I had to use a mux to get all the serial ports I needed and I'm still short i/o's.
This new board will solve my problems (and make coding easier).
My confusion arises from this new High Speed mode of 180 MHz. Does this mean that the FTM "system clock" will now be 90 MHz?
Another confusion is the term TPM timers in Chapter 43. Are these the same thing as FTM timers, or is this yet another set of flexible timers with "Channel" outputs/inputs?
Attach.
Enumerated.
device cdc attached:
pid=0x42 vid=0x2341 address=1
cdc device attached
# PIN ALT0 ALT1 ALT2 ALT3 ALT4 ALT5 ALT6 ALT7
-- --- ---- ------ --------- ----- --------- ------ -------- ---------
40 A28 PTA28 MII0_TXER FB_A25
41 A29 PTA29 MII0_COL FB_A24
42 A26 PTA26 MII0_TXD3 FB_A27
43 B20 PTB20 SPI2_PCS0 FB_AD31/SDRAM_D31 CMP0_OUT
44 B22 PTB22 SPI2_SOUT FB_AD29/SDRAM_D29 CMP2_OUT
45 B23 PTB23 SPI2_SIN SPI0_PCS5 FB_AD28/SDRAM_D28 CMP3_OUT
46 B21 PTB21 SPI2_SCK FB_AD30/SDRAM_D30 CMP1_OUT
47 D8 PTD8 I2C0_SCL LPUART0_RX FB_A16
48 D9 PTD9 I2C0_SDA LPUART0_TX FB_A17
49 B4 A1_10 PTB4 ENET0_1588_TMR2 SDRAM_CS1-b FTM1_FLT0
50 B5 A1_11 PTB5 ENET0_1588_TMR3 FTM2_FLT0
51 D14 PTD14 SPI2_SIN SDHC0_D6 FB_A22
52 D13 PTD13 SPI2_SOUT SDHC0_D5 FB_A21
53 D12 PTD12 SPI2_SCK FTM3_FLT0 SDHC0_D4 FB_A20
54 D15 PTD15 SPI2_PCS1 SDHC0_D7 FB_A23
55 D11 PTD11 SPI2_PCS0 SDHC0_CLKIN LPUART0_CTS_b FB_A19
56 E10 PTE10 I2C3_SDA I2S0_TXD0 LPUART0_CTS_b FTM3_CH5 USB1_ID
57 E11 PTE11 I2C3_SCL I2S0_TX_FS LPUART0_RTS_b FTM3_CH6
Pin ADC Ser PWM SPI I2C CAN Touch I2S Eth Port
40 TXER A28
41 COL A29
42 TXD3 A26
43 CS2-0 B20
44 MOSI2 B22
45 MISO2/CS0-5 B23
46 SCK2 B21
47 RX6 SCL0 D8
48 TX6 SDA0 D9
49 A? B4
50 A? B5
51 MISO2 D14
52 MOSI2 D13
53 SCK2 D12
54 CS2-1 D15
55 CS2-0 D11
56 SDA3 txd0 E10
57 SCL3 lrclk E11
From the Pin Table I believe that I sort of described all of these pins in #756
Which the MUX table looks like:
Code:# PIN ALT0 ALT1 ALT2 ALT3 ALT4 ALT5 ALT6 ALT7 -- --- ---- ------ --------- ----- --------- ------ -------- --------- 40 A28 PTA28 MII0_TXER FB_A25 41 A29 PTA29 MII0_COL FB_A24 42 A26 PTA26 MII0_TXD3 FB_A27 43 B20 PTB20 SPI2_PCS0 FB_AD31/SDRAM_D31 CMP0_OUT 44 B22 PTB22 SPI2_SOUT FB_AD29/SDRAM_D29 CMP2_OUT 45 B23 PTB23 SPI2_SIN SPI0_PCS5 FB_AD28/SDRAM_D28 CMP3_OUT 46 B21 PTB21 SPI2_SCK FB_AD30/SDRAM_D30 CMP1_OUT 47 D8 PTD8 I2C0_SCL LPUART0_RX FB_A16 48 D9 PTD9 I2C0_SDA LPUART0_TX FB_A17 49 B4 A1_10 PTB4 ENET0_1588_TMR2 SDRAM_CS1-b FTM1_FLT0 50 B5 A1_11 PTB5 ENET0_1588_TMR3 FTM2_FLT0 51 D14 PTD14 SPI2_SIN SDHC0_D6 FB_A22 52 D13 PTD13 SPI2_SOUT SDHC0_D5 FB_A21 53 D12 PTD12 SPI2_SCK FTM3_FLT0 SDHC0_D4 FB_A20 54 D15 PTD15 SPI2_PCS1 SDHC0_D7 FB_A23 55 D11 PTD11 SPI2_PCS0 SDHC0_CLKIN LPUART0_CTS_b FB_A19 56 E10 PTE10 I2C3_SDA I2S0_TXD0 LPUART0_CTS_b FTM3_CH5 USB1_ID 57 E11 PTE11 I2C3_SCL I2S0_TX_FS LPUART0_RTS_b FTM3_CH6
And the Cardish might look something like:
Sorry I probably don't have the tabbing set correctly as this was cut and past from my Excel documentCode:Pin ADC Ser PWM SPI I2C CAN Touch I2S Eth Port 40 TXER A28 41 COL A29 42 TXD3 A26 43 CS2-0 B20 44 MOSI2 B22 45 MISO2/CS0-5 B23 46 SCK2 B21 47 RX6 SCL0 D8 48 TX6 SDA0 D9 49 A? B4 50 A? B5 51 MISO2 D14 52 MOSI2 D13 53 SCK2 D12 54 CS2-1 D15 55 CS2-0 D11 56 SDA3 txd0 E10 57 SCL3 lrclk E11
I am also playing around with trying to setup footprint and the like for Diptrace.
Warning, When I put up things like CS, I have additional information like which CS, as you can only use 1 of each duplicate pin.
Again Paul, when it is OK I will post this document as well
As Paul said in another post, The code wins!The only problem I have is post #3 and #8 and even your post conflict on some of the pin features. Making it hard to tell what is right or wrong.
#define CORE_PIN40_BIT 28
#define CORE_PIN41_BIT 29
#define CORE_PIN42_BIT 26
#define CORE_PIN43_BIT 20
#define CORE_PIN44_BIT 22
#define CORE_PIN45_BIT 23
#define CORE_PIN46_BIT 21
#define CORE_PIN47_BIT 8
#define CORE_PIN48_BIT 9
#define CORE_PIN49_BIT 4
#define CORE_PIN50_BIT 5
#define CORE_PIN51_BIT 14
#define CORE_PIN52_BIT 13
#define CORE_PIN53_BIT 12
#define CORE_PIN54_BIT 15
#define CORE_PIN55_BIT 11
#define CORE_PIN56_BIT 10
#define CORE_PIN57_BIT 11
#define CORE_PIN40_PORTREG GPIOA_PDOR
#define CORE_PIN41_PORTREG GPIOA_PDOR
#define CORE_PIN42_PORTREG GPIOA_PDOR
#define CORE_PIN43_PORTREG GPIOB_PDOR
#define CORE_PIN44_PORTREG GPIOB_PDOR
#define CORE_PIN45_PORTREG GPIOB_PDOR
#define CORE_PIN46_PORTREG GPIOB_PDOR
#define CORE_PIN47_PORTREG GPIOD_PDOR
#define CORE_PIN48_PORTREG GPIOD_PDOR
#define CORE_PIN49_PORTREG GPIOB_PDOR
#define CORE_PIN50_PORTREG GPIOB_PDOR
#define CORE_PIN51_PORTREG GPIOD_PDOR
#define CORE_PIN52_PORTREG GPIOD_PDOR
#define CORE_PIN53_PORTREG GPIOD_PDOR
#define CORE_PIN54_PORTREG GPIOD_PDOR
#define CORE_PIN55_PORTREG GPIOD_PDOR
#define CORE_PIN56_PORTREG GPIOE_PDOR
#define CORE_PIN57_PORTREG GPIOE_PDOR
@TelephoneBill: it is somewhat extreme overlclocking, but it works to set fbus=fcpu on all my teensy3.x ...
Nothing gets warm.
Intriguing... what value fcpu freq was that running at?
Just for the fun of it I played around some with FTM1. In particular I hacked up a copy of PulsePosition library, to use FTM1 instead. Some of the things I have needed to do include:To be honest, this is one of the parts of the chip I haven't really explored yet. My understand from only the ref manual is they're yet another 2 flexible timers which a total of 4 more channels.
They seem to share all the same resources as FTM1 & FTM2, so how you use them isn't perfectly clear to me. If anyone experiments with them, please share anything you learn. Is it really possible to get another 4 PWM outputs?
3) Also wondering globally, about doing code like: SIM_SCGC2 |= SIM_SCGC2_TPM2; // Enable the clock
Should we define some form of setup to use bitband setting of these values to make them atomic?
Kurt
void serial_begin(uint32_t divisor)
{
SIM_SCGC4 |= SIM_SCGC4_UART0; // turn on clock, TODO: use bitband
...
Sketch uses 617,860 bytes (58%) of program storage space. Maximum is 1,048,576 bytes.
Global variables use 51,216 bytes (19%) of dynamic memory, leaving 210,928 bytes for local variables. Maximum is 262,144 bytes.
For what it is worth, I downloaded it, built it at 180mhz... It installed, I uncommented the two loops and built again:Arduino 1.6.10, TD 1.30b2
I've run into a problem when uploading a large chunk of code to the K66. In the latest incarnation of the vocoder, instead of storing just one sample loop, I have declared all eleven of them to be const so that they are stored in program memory. The IDE reports this for sketch size:
However, it won't upload properly. Teensyduino goes through the upload process and appears to complete but then the serial port disappears and I have to run Blink to get it back again. It will load if I remove enough loops to get the sketch size below 512kB but the K66 ought to handle up to a megabyte.Code:Sketch uses 617,860 bytes (58%) of program storage space. Maximum is 1,048,576 bytes. Global variables use 51,216 bytes (19%) of dynamic memory, leaving 210,928 bytes for local variables. Maximum is 262,144 bytes.
Is this a TD problem or mea culpa?
I've attached the version of the vocoder giving problems. View attachment 7872
It is set so that it will upload by commenting loops 7 and 10 in loops.cpp. Uncommenting either of those pushes it over the limit and it won't execute.
The code only uses a microphone on the audio board and outputs to headphones so it shouldn't be too difficult to test - check that the micGain is right (I use a gain of zero for a MEMS microphone but you might need to set it to 30 or so for other microphone types). You can switch from one loop to the next by grounding pin 28.
Pete
Using library Bounce in folder: C:\arduino-1.6.10\hardware\teensy\avr\libraries\Bounce (legacy)
Sketch uses 617,828 bytes (58%) of program storage space. Maximum is 1,048,576 bytes.
Global variables use 51,024 bytes (19%) of dynamic memory, leaving 211,120 bytes for local variables. Maximum is 262,144 bytes.
C:\Users\Kurt\Desktop\vocoder_16rec_9fx_SF_6_rectify\vocoder_16rec_9fx_SF_6_rectify.ino
F_CPU = 180 MHz
C:\Users\Peter\Documents\Teensy\my_audio\k66\vocoder\vocoder_16rec_9fx_SF_6_rectify\vocoder_16rec_9fx_SF_6_rectify.ino
F_CPU = 180 MHz
Found 10 loops
Loop = CARRIER22
setup done
CASCADE_2
bp_base = 100.0, bp_width = 400.0
mixer18_gain = 4.0, mixera_gain = 3.0
Using MICROPHONE input
Proc = 55.79 (55.79), Mem = 25 (29)