Arduino 1.6.0 - any plans to support it?

Status
Not open for further replies.
Error ID is [still] intermittent.

I downloaded and installed beta-8 and my error in msg#131 still fails to ID or locate the error. Making the same change to same 'line' in the 'evolved' sketch identifies the error and drops the IDE on the affected line so it is contextual. [win7x64]

[edit] I did find this temp\console file that does show the error that doesn't make it to the IDE: View attachment stderr.txt

Interestingly I changed CPU to 96Mhz OPT and it worked to locate the error, went back to other 96Mhz and it compiled. Closed that IDE and did OPEN on sketch and it failed with this file called 'stderr - Copy' - it shows the same error four times? View attachment stderr - Copy.txt. Again going to 96Mhz Optimized had it compile and shows the error. Repeated the above and went to 96 OPT first and the error failed to show - did the switch and still failed.

Paul - does this 'opps' mean there are new bits for Beta-8 coming?
 
Last edited:
I looked at ILI9341_t3 for a while this evening, and I'm afraid Teensy-LC is never going to achieve the awesome performance Teensy 3.1 can. The FIFO on LC is only for data. On 3.1, the FIFO carries data and chip selects, which is the trick ILI9341_t3 uses to keep maximum rate SPI flowing.

The FIFO still might help for long data writes, but it's never going to be anything near what Teensy 3.1 can do.
 
RE #156 - at least renaming the file should be a workaround. I saved a backup ino and it made the ino.ino out of it and that may have started it, luckily I saved it with the bad name.

RE #157 - Normally CS is just for device switching? [I only understand this in the vaguest way so far] - But the ILI9341 tricks it out for faster attention? Is that what interferes with SD card usage (or other devices)? I suppose that means more interrupts after the data bursts to attend to CS. That just makes it less than ideal - but perfectly functional and the same on both LC SPI ports? My primary Teensy 3.1 use won't have a display - but SPI nRF24 - but hoped to have an LC as my remote debug terminal with SPI for each of ILI9341 and an nRF24 - is that functionally possible when I get my LC or will it take work to get there? Would the Teensy 3.1 software SPI work similarly in effect with CS needing attention? It looks like I came across a similar query in this thread: Multiple SPI bus - but it hasn't evolved much.
 
Hi Paul,

I have also done some playing with the faster ili9341 driver and trying to enable the fifo, and as I mentioned, some of the register status values were not clear. Can detect when there is room in the queue, and when the output queue is empty and nearly empty, but was unclear if the empty was just for the fifo or had it shifted out the last bits of the last byte to output....

defragster - The issue, is timing when the CS and the DC(Data/Command) IO pins are changed as related to the data lines (Clk, MISO, MOSI). Example suppose you wish to set a pixel, the code for this turns in to:
Code:
ILI9341_t3::drawPixel(int16_t x, int16_t y, uint16_t color) {
	writecommand_cont(ILI9341_CASET); // Column addr set
	writedata16_cont(x);   // XSTART
	writedata16_cont(x);   // XEND
	writecommand_cont(ILI9341_PASET); // Row addr set
	writedata16_cont(y);   // YSTART
	writedata16_cont(y);   // YEND
	writecommand_cont(ILI9341_RAMWR);
	writedata16_last(color);
}
I won't go into the full details about above, except: each time you go from command to data or data to command, the DC line changes, likewise the _cont says to continue holding the CS line and last says we will release CS after the write. Also 16 is a write of 16 bits versus 8 bits (On the 3.1, each one of these writes translate to one entry in the fifo queue, which encodes both the CS and the DC changes as part of the queue entry. The only waiting is after we add an item to the queue, we wait until the queue is not full... With this the system is doing all of the work for changing the DC and CS pins at the right time.

Now with the LC, we have to wait until the output queue is completely empty (last bit output) and then do the change of the DC and/or CS pins through digitalWrite() or hopefully faster equivalent.
will assume queue empty when I try to output: ILI9341_CASET command as probably previous command cleared queue. So we set CS and DC, push it on the queue, then we go to write the X values out, DC changes, so we have to wait until queue is empty, then clear DC and push the 16 bits of X twice (start and end), then we need to wait until those bytes are output, set DC, push PASET, wait, clear DC, push 4 bytes for Y...

So in the above: we probably have to wait for the queue to empty at least 6 times, where we change DC and/or CS. Each time we do this, there will be a gap of time when SPI pins are not outputting something.

However I still think there can be some pretty big wins. For example in things like fill rect. The code to do this is more or less identical to the draw pixel, except we output two different X's and Y's instead of the same ones twice and then after the ILI9341_CASET, we call: writedata16_cont(color); (w*h -1) times then writedata16_last(color); So would have the same number of IO pin state changes. So again things like: fill screen, fill rect, horizontal line, vertical line, write rect, text with background color specified, ... All should be pretty fast. However things that draw random lines, text with transparency ... Will not gain much speed over standard ILI9341 driver.

Hope that makes sense?

Paul: in the ST7735 driver I have this done like:
Code:
void Adafruit_ST7735::writecommand(uint8_t c)
{
  *rsport &= ~rspinmask;
  *csport &= ~cspinmask;
  //Serial.print("C ");
  spiwrite(c);
  *csport |= cspinmask;
}
Which I personally don't like, as *csport & ~cspinmask is a two step process. Read the current state of N pins (8), change the state of 1 of them and write it back. Now if something like an interrupt changes the state of one of the 8 pins after I did the read but before the write, this code would stomp on it... I am pretty sure I can change this to keep two registers (set/clear) and do this atomic?

Edit: I think this is off topic and create a new thread as this is not specific to Arduino 1.6 and probably deserves it's own thread:
https://forum.pjrc.com/threads/27981-ILI9241_t3-support-for-Teensy-LC?p=67013#post67013
 
Last edited:
I'm a beginner regarding the Teensy and Arduino IDE, so please excuse me if this has an obvious fix. I'm trying to automate some testing which currently requires a human sitting behind a computer entering the appropriate commands (which, will eventually be auto-typed by the teensy, when this project is complete). However, with the Arduino IDE 1.6.0, and latest Teensy 1.21 beta8; I get the error below for every instance of usb_keyboard_press(). Which, in a program with many usb_keyboard_press()'s, causes the black Error Console at the bottom to fill with errors when the code is verified (making it difficult to find other errors). No errors are reported with the same code in Arduino IDE 1.0.6 and Teensy 1.20.

Sample code to produce the results are:

void setup() {
#include <usb_keyboard.h>
usb_keyboard_press(KEY_B,0);
usb_keyboard_press(KEY_C,0);

}

void loop() {
}

And the error that occurs in the error console:

usb_keyboard_press-test.ino: In function 'void setup()':
usb_keyboard_press-test.ino:4:27: warning: large integer implicitly truncated to unsigned type [-Woverflow]
usb_keyboard_press-test.ino:5:27: warning: large integer implicitly truncated to unsigned type [-Woverflow]

There's a very good chance this is my mistake and not a bug, but I've googled it, and searched PJRC forums and cannot find anything similar.
 
On win7x64/beta8 I got this twice today punching 'button' - never saw it before but I am doing new code (9DOF USB spew .vs. FFT spew):

[edit] Figured Out: Multiple IDE sketch windows open [or same IDE with compile error]. If compile 'rebuilding all' then the TEMP\xxx.HEX is removed, and TeensyDuino gives this error 'not readable' message when the file is missing. @Paul:: The message might read 'Not Found', or perhaps TeensyDuino could make a local copy to re-program the 'last sketch'.

File Error: Unable to program because the file is not readable
T_FileNotReadable.png

Pushed again and it repeated. [edit] ... but scanning verbose window I see the event was captured - perhaps just a TEMP file was removed? Verbose TeensyD here: View attachment T_FileNotReadable.txt

Note: Unrelated to this but: I've been having fine performance with TeensyD auto reset on code uploading. Yesterday I did try a new USB3 Hub and Windows of course wants 'new drivers' - and again moving the hub to a USB2 port. This relates to what @pensive noted in LC thread. In the process windows 'orphaned' a COM port that did stop the auto upload requiring 'button'. That went away after I rebooted and all is well so far - only oddity is noted above.
 
Last edited:
I'm a beginner regarding the Teensy and Arduino IDE, so please excuse me if this has an obvious fix. I'm trying to automate some testing which currently requires a human sitting behind a computer entering the appropriate commands (which, will be auto-typed by the teensy, when this project is complete). However, with the Arduino IDE 1.6.0, and latest Teensyduino 1.21 beta8; I get this error for every instance of usb_keyboard_press(). Which, in a program with many usb_keyboard_press()'s, causes the black Error Console at the bottom to fill with errors when the code is verified (making it difficult to find other errors). No errors are reported with the same code in Arduino IDE 1.0.6 and Teensyduino 1.20.

Sample code to produce the results are:

void setup() {
#include <usb_keyboard.h>
usb_keyboard_press(KEY_B,0);
usb_keyboard_press(KEY_C,0);

}

void loop() {
}

And the errors that occurs in the error console:

usb_keyboard_press-test.ino: In function 'void setup()':
usb_keyboard_press-test.ino:4:27: warning: large integer implicitly truncated to unsigned type [-Woverflow]
usb_keyboard_press-test.ino:5:27: warning: large integer implicitly truncated to unsigned type [-Woverflow]

There's a very good chance this is my mistake and not a bug, but I've googled, and searched PJRC forums and cannot find anything similar.
 
I haven't used this but looking at the code for usb_keyboard.c, KEY_B is a 16-bit keycode but usb_keyboard_press is expecting an 8-bit key and an 8-bit modifier

It should be coded like this:
Code:
usb_keyboard_press(keycode_to_key(KEY_B),keycode_to_modifier(KEY_B));

You could code it as a macro to save some typing:
Code:
#define KEYPRESS(k) usb_keyboard_press(keycode_to_key(k),keycode_to_modifier(k))

Pete
 
Thank you for the prompt response! Unfortunately, when I try it (see code below), I get a different set of error messages. I reviewed usbkeyboard.h and usb_keyboard.c as well, but couldn't come up with a solution.

Code:
void setup() {
#include <usb_keyboard.h>
  usb_keyboard_press(keycode_to_key(KEY_B),keycode_to_modifier(KEY_B));
}

void loop() {
}

usb_keyboard_press-test.ino: In function 'void setup()':
usb_keyboard_press-test.ino:5:40: error: 'keycode_to_key' was not declared in this scope
usb_keyboard_press-test.ino:5:67: error: 'keycode_to_modifier' was not declared in this scope
Error compiling.

( I wonder what changed from Arduino 1.0.6 / Teensyduino 1.20 to Arduino 1.6.0 Teensyduino 1.21 beta8; it used to work without errors).
 
Last edited:
BUTTON - Program not Reset

@Paul: I've made various notes but have an evolved take on the button not yet finding a 'spec'. I don't know if this is new to 1.21 behavior (since I started on 1.21) - it is part of the control and programmability of the Teensy.

When plugging the Teensy into a non PC USB port the button doesn't offer direct 'reset' functionality, but still goes into program mode. These would be a USB battery pack or an Android Phone for instance, but the same behavior happens on a PC with TeensyDuino not running. I haven't tried this powered other than USB - but I have @onehorse battery units that wouldn't use that to provide power.

On 'Button' press the Teensy stops execution and exits as CDC/Normal USB device and goes into 'Program' mode and appears as an alternate USB device awaiting TeensyDuino commands.

Until the Teensy is dis/reconnected it tends to stay in this mode without some confusing (to the user and MiniTan) series of button clicks where the Teensy reboots and goes into run not program mode. It is the 'desired' reset that can result from the various button clicks that has me confused.

I haven't been here for the history of this and not found it documented to have it work so a 'warm' reset can be performed directly through the button - not an intended function?

Obviously you can't break or compromise the 'program' state. Would it be possible to extend it so a 'long press' does a reboot/restart? [assuming the MiniTan is powered and aware of the button?] A short after a long press could immediately go back to program.

On my phone that I can use as a serial Monitor the button takes the known USB offline and returns as a type unknown to my monitor app. Until I replug, or push the button enough to seemingly confuse the MiniTan 'program' behavior the device stays 'offline'. I could send a reboot command from my phone, but that wouldn't help on the stand alone usb battery with now power switch, or if my sketch is hung. Perhaps this is more a debug/development concern, but in an installation where programming isn't desired - it may also be hard to cycle power, or a warm reset might be desirable.

With that in mind looking at the 3.1 card with the underside reset, I don't see that the LC has external reset shown on the card - so a power cycle or software reset are the only options.
 
@Smiley - sorry about that. I didn't test it.
I think the correct pair of functions you can use are usb_keyboard_press_keycode(KEYB) and usb_keyboard_release_keycode(KEYB).

Pete
 
the button doesn't offer direct 'reset' functionality, but still goes into program mode.

Obviously I need to improve the documentation... pinout card, on-screen message, webpages, other stuff? (any ideas???)

The button is only for entering programming mode. It's never meant to restart your application. Every Teensy has a button so you can recover if you ever load a program that disables the USB port or crashes in a way that can't respond to the auto-reboot request on the USB port.
 
On 'Button' press the Teensy stops execution and exits as CDC/Normal USB device and goes into 'Program' mode and appears as an alternate USB device awaiting TeensyDuino commands.

Yes, that is the expected behaviour for the program button.

You seem to want a reset button. Teensy 3.0 had a reset pin where one could be added. On Teensy 3.1 the little-used reset pin was substituted by the much more useful DAC/ADC pin (and LC has the same at this position). There is still a test point with the reset signal, see the end of this page
http://www.pjrc.com/teensy/teensy31.html

I guess you could solder a button onto that test point. Although briefly interrupting power achieves the same result.
 
People have a pre-conceived definition of what a "reset" button does. So many gadgets have such.
Versus a "reprogram" button.
 
Any web updates to put current LC/3.1 info to the forefront would be a good use of time - when you find some. Many special case and up front details relate to 8051 (on the top line) and Teensy 2, many Teensy 3 links just go to the add to the barren cart page. For instance: It was only reading about ILI9341 that the forum led me to the store to buy it, finding it from pjrc.com is tough.

To be honest I read more of the tutorials last night than in past weeks - I just jumped right in - for better and worse. The system is so inviting and intriguing - creating a uniform entry path that could temper and guide that. And yet I worked for weeks before soldering anything.

Maybe make up a 'Tutorial 0' page - "Welcome to your Teensy".
0.1 Here is the important stuff on the card, (maybe a link for each color/pin family )
0.1.1 You have to know and respect the card to keep the magic smoke inside
0.2 Here is the important stuff not on the card, (dynamic behavior - what's normal, what to expect )
0.3 The Teensy is so awesome and can do most of what you can imagine - so start "Http://.../HERE_RTFM"

If you are deprecating the Teensy2 - then reworking the website to put the T3/LC as primary focus to capture and explain it.

The forum is a great font of info - but the search seems to find the first word and highlight the second. Is there a way you could get a search service to help?
Your site is probably too big for a free Master.Com search but I ran into this place by a lady who mail order sells cookie cutters she buys in bulk.

Expect none of that is news. The Teensy is awesome, and easy to work with - a uniform more searchable Wiki of info would be ideal to navigate to the details to minimize false assumptions/perceptions and answering the same questions.

If I hadn't found that Button 'reset' behavior I would not have focused on it - but it is easier to click the button 5 or 10 times for a reset than unplug and re-plug micro USB. If a half second/long press could harness that the world would be a better place. And as noted I know the 3.1 is underside reset pin able, but the LC isn't.
 
Yes, the entire website is in need of a LOT of work. Realistically, that's a huge project which isn't going to happen quickly. Several small, incremental updates of course will.

After Teensy-LC is released, and after doing a few dozen little but really important things that have piled up over the last couple months, I'm probably going to turn my attention to debug. In deciding what to do, and what to not do (or delay for a long time), I believe getting real but low-cost debug on future Teensy is probably the best direction that can benefit the most people.

But in the very short term, some way to improve on-screen messages or other info people actually see (nobody really reads documentation) about the pushbutton needs to happen. I just don't know how to get that message across.
 
Paul - I put in a pull request using instructions in other thread, which I think worked for Adafruit_ST7735.

This allows it to compile for Teensy 3.1 (3.0) - fixed names of SPI0 variables due to Beta 8

This also added support for Teensy LC - including SPI1

Kurt
 
Downloaded Linux 64 and verified that programs that use the Adafruit_ST7735 library do not compile for Teensy 3.1...
As mentioned in #172 I issued a pull request that should fix that as well as add Teensy LC support

Verified ILI9341_T3 was updated so programs do compile for 3.1...
 
Status
Not open for further replies.
Back
Top