@Robin T3.6 arrived in Germany this morning. Yeah like this little beauty
Hm. Mine is still on the road..
@Robin T3.6 arrived in Germany this morning. Yeah like this little beauty
Thanks for all the work on this. It shouldn't be too bad getting it into Kicad now that you have the exact dimensions nailed down.Not that im aware of. I will be making one in the next few days, I need one for another project i'm working on that is to big for free eagle.
Same here, thank you!@Robin T3.6 arrived in Germany this morning. Yeah like this little beauty
Hm. Mine is still on the road..
Hm. Mine is still on the road..
Thanks for all the work on this. It shouldn't be too bad getting it into Kicad now that you have the exact dimensions nailed down.
Looks great, may have to update my Diptrace version to have some more information and maybe the order of things. One thing I wonder about as I do that is what to do with all of the GND and 3.3v pins. I typically add them as their own entry on the Schematic Component and Pattern and I either add some or all of them to the same signal like GND. The problem is each one I add, I then typically have to run etch between them as the system does not know they are connected. Not sure if I can tell Diptrace they are connected, and sometimes probably don't want them to be assumed as for example would not want all of the servos to run their GND through the chip...Made a few more changes and grabbed the T36 top card and added some markings(RX5/TX5).
Has anyone started the T36 backside card? If not I may do a lazy mans paint version just to get it started.
View attachment 7926
View attachment 7927
Looks great, may have to update my Diptrace version to have some more information and maybe the order of things. One thing I wonder about as I do that is what to do with all of the GND and 3.3v pins. I typically add them as their own entry on the Schematic Component and Pattern and I either add some or all of them to the same signal like GND. The problem is each one I add, I then typically have to run etch between them as the system does not know they are connected. Not sure if I can tell Diptrace they are connected, and sometimes probably don't want them to be assumed as for example would not want all of the servos to run their GND through the chip...
With the -36000 in the array size declaration, the code was 463,420 bytes long and loads and executes without problem. Remove the -36000 and the code size becomes 535,420 bytes, the sketch won't run and the serial port disappears.
Was wondering, would you like us to continue to have most of the Teensy 3.5/3.6 Beta/Kickstarter conversation still in this thread or start new threads for different things.
Just to confirm, this is a bootloader bug. I will be working on it soon.
I don't think the getmac function has been updated. Paul fetches the serial number for the USB id in usb_init_serialnumber() inBtw. did someone know where I can find the Serialnumber?
Sounds Good.This thread is still best. This is the place I'm looking for important things I've missed over the last week....
Note: there is an issue of being able to read the USB serial number if you are running at a speed over 120mhz, which is why windows will not necessarily know one T3.6 from another and so which Serial port may not be consistent. I have a "hack" that I believe is working on my machine, where I grab the serial number before we switch to high speed.I don't think the getmac function has been updated. Paul fetches the serial number for the USB id in usb_init_serialnumber() in
https://github.com/PaulStoffregen/cores/blob/master/teensy3/usb_desc.c#L1218
Ethernet MAC will uses lower 24-bits of the serial number word (as I understand it).
#include <Bounce.h>
#define MIN_DELTA 5
uint8_t analog_pins[] = {A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16,
A17, A18, A19, A20, A21, A22, A23, A24, 44, 45
};
uint8_t analog_pin_index = 0;
Bounce button0 = Bounce(0, 15);
uint16_t last_analog_val = 0;
void setup() {
pinMode(0, INPUT_PULLUP);
while (!Serial && (millis () <= 3000));
Serial.begin(115200);
delay(200);
Serial.println("Test Analog T3.6 analog pins");
Serial.printf("Temp: %d Volt: %d\n\r", analogRead(44), analogRead(45));
}
void loop() {
button0.update();
if (button0.fallingEdge()) {
analog_pin_index++;
if (analog_pin_index >= sizeof(analog_pins))
analog_pin_index = 0;
last_analog_val = 0;
Serial.printf("Checking A%d\n\r", analog_pin_index);
}
if (Serial.available()) {
analog_pin_index = Serial.parseInt();
last_analog_val = 0;
Serial.printf("Checking A%d\n\r", analog_pin_index);
while (Serial.read() != -1) ;
}
uint16_t analog_val = analogRead(analog_pins[analog_pin_index]);
if (abs(analog_val - last_analog_val) >= MIN_DELTA) {
last_analog_val = analog_val;
Serial.printf("A%d %d\n\r", analog_pin_index, analog_val);
}
delay(50);
}
/*
These routines are built for speed... they assume valid pins ... use with caution
They are board specific constant access to pins cause every board has different ways of doing basically the same stuff at a low level!
*/
#if defined(__MK20DX256__) // 3.1
#define __TEENSY_3_1__
#define __TEENSY_3__
#endif
#if defined(__MK20DX128__) // 3.0
#define __TEENSY_3_0__
#define __TEENSY_3__
#endif
#if defined(__TEENSY_3__)
#define BOARD_MSG "** Teensy 3.x 32 bit ARM code!"
// These variables are the native 8/32 bit types and used for things 0-127 and 0-255
static const uintX_t digitalPinCount = CORE_NUM_TOTAL_PINS;
// https://www.pjrc.com/teensy/td_libs_Wire.html
// Two Wire (aka I2C) ports
#define SDA_PIN SDA
#define SCL_PIN SCL
// https://www.pjrc.com/teensy/td_libs_SPI.html
#define SS_PIN SS
#define MOSI_PIN MOSI
#define MISO_PIN MISO
#define SCK_PIN SCK
struct pin_map_t
{
volatile uint32_t *ddr;
volatile uint32_t *inp;
volatile uint32_t *write_set;
volatile uint32_t *write_clear;
volatile uint32_t *write_toggle;
uint32_t port_bit;
};
#define ADDR(_p,_b) &GPIO##_p##_PDDR, &GPIO##_p##_PDIR, &GPIO##_p##_PCOR, &GPIO##_p##_PSOR, &GPIO##_p##_PTOR, 1 << _b
static const pin_map_t digitalPinMap[] =
{
{ ADDR(B,16) }, // 0
{ ADDR(B,17) }, // 1
{ ADDR(D,0) }, // 2
{ ADDR(A,12) }, // 3
{ ADDR(A,13) }, // 4
{ ADDR(D,7) }, // 5
{ ADDR(D,4) }, // 6
{ ADDR(D,2) }, // 7
{ ADDR(D,3) }, // 8
{ ADDR(C,3) }, // 9
{ ADDR(C,4) }, // 10
{ ADDR(C,6) }, // 11
{ ADDR(C,7) }, // 12
{ ADDR(C,5) }, // 13
{ ADDR(D,1) }, // 14
{ ADDR(C,0) }, // 15
{ ADDR(B,0) }, // 16
{ ADDR(B,1) }, // 17
{ ADDR(B,3) }, // 18
{ ADDR(B,2) }, // 19
{ ADDR(D,5) }, // 20
{ ADDR(D,6) }, // 21
{ ADDR(C,1) }, // 22
{ ADDR(C,2) }, // 23
{ ADDR(A,5) }, // 24
{ ADDR(B,19) }, // 25
{ ADDR(E,1) }, // 26
{ ADDR(C,9) }, // 27
{ ADDR(C,8) }, // 28
{ ADDR(C,10) }, // 29
{ ADDR(C,11) }, // 30
{ ADDR(E,0) }, // 31
{ ADDR(B,18) }, // 32
{ ADDR(A,4) } // 33
};
static __INLINE__ void fastDigitalToggle(uint32_t pin) { *digitalPinMap[pin].write_toggle = digitalPinMap[pin].port_bit; }
#define SHIELD_MSG "** DIB 8/16 bit interface pins NOT implemented"
static __INLINE__ void fastDigitalWrite8_1(uint32_t val8) { //todo }
static __INLINE__ void fastDigitalWrite8_2(uint32_t val8) { //todo }
static __INLINE__ void fastPinMode8_1_INPUT() { }
static __INLINE__ void fastPinMode8_2_INPUT() { }
static __INLINE__ void fastPinMode8_1_OUTPUT() { }
static __INLINE__ void fastPinMode8_2_OUTPUT() { }
static __INLINE__ uint32_t fastDigitalRead8_1() { return 0; }
static __INLINE__ uint32_t fastDigitalRead8_2() { return 0; }
static __INLINE__ void setPinMode(uint32_t pin, uint32_t val) { pinMode(pin, val); }
static __INLINE__ void fastDigitalWrite(uint32_t pin, boolean val)
{
if (val)
{
*digitalPinMap[pin].write_set = digitalPinMap[pin].port_bit;
}
else
{
*digitalPinMap[pin].write_clear = digitalPinMap[pin].port_bit;
}
}
static __INLINE__ uint32_t fastDigitalRead(uint32_t pin) { return (*digitalPinMap[pin].inp & digitalPinMap[pin].port_bit); }
struct strFastPin
{
uintX_t pin;
uint32_t mask;
volatile uint32_t *set;
volatile uint32_t *unset;
volatile uint32_t *read;
};
static __INLINE__ void fastpinSet(strFastPin &v, uint32_t value) { if (value) { *v.set = v.mask; } else { *v.unset = v.mask; } }
static __INLINE__ void fastpinSetHigh(strFastPin &v) { *v.set = v.mask; }
static __INLINE__ void fastpinSetLow(strFastPin &v) { *v.unset = v.mask; }
static __INLINE__ uint32_t fastpinRead(strFastPin &v) { return *v.read & v.mask; }
#define SHIELD_MSG "** NO SHIELD - DIB 8/16 bit interface pins 33-40(0-7) 51-44(8-15)"
static __INLINE__ void fastDigitalWrite8_1(uint32_t val8)
{
REG_PIOC_CODR = (0x000000FF << 1);
REG_PIOC_SODR = ((val8) << 1); // &(0x000000FF << 1);
}
static __INLINE__ void fastDigitalWrite8_2(uint32_t val8)
{
REG_PIOC_CODR = (0x000000FF << 12);
REG_PIOC_SODR = ((val8) << 12); // &(0x000000FF << 12);
}
static __INLINE__ void fastPinMode8_1_INPUT() { pinMode(33, INPUT); pinMode(34, INPUT); pinMode(35, INPUT); pinMode(36, INPUT); pinMode(37, INPUT); pinMode(38, INPUT); pinMode(39, INPUT); pinMode(40, INPUT); }
static __INLINE__ void fastPinMode8_2_INPUT() { pinMode(44, INPUT);pinMode(45, INPUT);pinMode(46, INPUT);pinMode(47, INPUT);pinMode(48, INPUT);pinMode(49, INPUT);pinMode(50, INPUT);pinMode(51, INPUT); }
static __INLINE__ void fastPinMode8_1_OUTPUT() { pinMode(33, OUTPUT); pinMode(34, OUTPUT); pinMode(35, OUTPUT); pinMode(36, OUTPUT); pinMode(37, OUTPUT); pinMode(38, OUTPUT); pinMode(39, OUTPUT); pinMode(40, OUTPUT); }
static __INLINE__ void fastPinMode8_2_OUTPUT() { pinMode(44, OUTPUT);pinMode(45, OUTPUT);pinMode(46, OUTPUT);pinMode(47, OUTPUT);pinMode(48, OUTPUT);pinMode(49, OUTPUT);pinMode(50, OUTPUT);pinMode(51, OUTPUT); }
static __INLINE__ uint32_t fastDigitalRead8_1(void) { return ((REG_PIOC_PDSR >> 1) & 0x000000FF); }
static __INLINE__ uint32_t fastDigitalRead8_2(void) { return ((REG_PIOC_PDSR >> 12) & 0x000000FF); }
#endif
static __INLINE__ void fastDigitalWriteLOW(uintX_t pin) { g_APinDescription[pin].pPort->PIO_CODR = g_APinDescription[pin].ulPin; }
static __INLINE__ void fastDigitalWriteHIGH(uintX_t pin) { g_APinDescription[pin].pPort->PIO_SODR = g_APinDescription[pin].ulPin; }
static __INLINE__ void setPinMode(uintX_t pin, uintX_t val) { pinMode(pin, val); }
static __INLINE__ void fastDigitalWrite(uintX_t pin, boolean val)
{
if (val)
{
g_APinDescription[pin].pPort->PIO_SODR = g_APinDescription[pin].ulPin; // set
}
else
{
g_APinDescription[pin].pPort->PIO_CODR = g_APinDescription[pin].ulPin; // unset
}
}
static __INLINE__ uintX_t fastDigitalRead(uintX_t pin)
{
return (g_APinDescription[pin].pPort->PIO_PDSR & g_APinDescription[pin].ulPin) ? HIGH : LOW;
}
struct strFastPin
{
uintX_t pin;
uint32_t mask;
WoReg *set;
WoReg *unset;
WoReg *read;
};
static __INLINE__ void fastpinSet(strFastPin &v, uint32_t value) { if (value) { *v.set = v.mask; } else { *v.unset = v.mask; } }
static __INLINE__ void fastpinSetHigh(strFastPin &v) { *v.set = v.mask; }
static __INLINE__ void fastpinSetLow(strFastPin &v) { *v.unset = v.mask; }
static __INLINE__ uint32_t fastpinRead(strFastPin &v) { return *v.read & v.mask; }
Port pin Teensy pin
PTC0 15
PTC1 22
PTC2 23
PTC3 9
PTC4 10
PTC5 13
PTC6 11
PTC7 12
PTD0 2
PTD1 14
PTD2 7
PTD3 8
PTD4 6
PTD5 20
PTD6 21
PTD7 5
Ahhhh... great! Thanks for the quick reply. I had been making a shield for the Due but will use it as a learning experience and make the same for the Teensy 3.5/3.6. Will have to figure out how to deal with the pins that are on solder pads. I'd want the Teensy board to be pluggable into the breakout so I can have several breakouts for testing and not need several MCU's. I assume soldering smd pins on the pads is an option if I can figure out the spacing.
One thing the breakout did was route the 8 bit ports into headers where it's easier to hookup. LMAO ... the pins look almost random