Arduino 1.6.0 - any plans to support it?

Status
Not open for further replies.
LC tests (using IRQ 4 for SWI)
Hub
Read passed, Read 2048 sectors (1024K) in 4624ms
direct
Read passed, Read 2048 sectors (1024K) in 2054ms


Worked with only having to set the SWI IRQ :cool:

Now, you need IRQ 29 tested... easy enough...

The answer is, yes, IRQ_SOFTWARE works.
;)
 
Yeah, I'm really ok with "5V" on the silkscreen. It's on the top side near the VIN pin, and on the bottom on the 17 output.
 
Hi,

back to the 9bit serial:

in serial3.c - functon serial3_putchar()

Code:
void serial3_putchar(uint32_t c)
{
	uint32_t head;

	if (!(SIM_SCGC4 & SIM_SCGC4_UART2)) return;
	if (transmit_pin) *transmit_pin = 1;
	head = tx_buffer_head;
	if (++head >= TX_BUFFER_SIZE) head = 0;
	while (tx_buffer_tail == head) {
		int priority = nvic_execution_priority();
		if (priority <= IRQ_PRIORITY) {
			if ((UART2_S1 & UART_S1_TDRE)) {
				uint32_t tail = tx_buffer_tail;
	[B][COLOR="#FF0000"]			if (++tail >= TX_BUFFER_SIZE) tail = 0;
				UART2_D = tx_buffer[tail];[/COLOR][/B]
				tx_buffer_tail = tail;
			}
		} else if (priority >= 256) {
			yield(); // wait
		}
	}
	tx_buffer[head] = c;
	transmitting = 1;
	tx_buffer_head = head;
	UART2_C2 = C2_TX_ACTIVE;
}

compared with serial2_putchar()

Code:
void serial2_putchar(uint32_t c)
{
	uint32_t head, n;

	if (!(SIM_SCGC4 & SIM_SCGC4_UART1)) return;
	if (transmit_pin) *transmit_pin = 1;
	head = tx_buffer_head;
	if (++head >= TX_BUFFER_SIZE) head = 0;
	while (tx_buffer_tail == head) {
		int priority = nvic_execution_priority();
		if (priority <= IRQ_PRIORITY) {
			if ((UART1_S1 & UART_S1_TDRE)) {
				uint32_t tail = tx_buffer_tail;
	[B][COLOR="#FF0000"]			if (++tail >= TX_BUFFER_SIZE) tail = 0;
				n = tx_buffer[tail];
				if (use9Bits) UART1_C3 = (UART1_C3 & ~0x40) | ((n & 0x100) >> 2);
				UART1_D = n;
[/COLOR][/B]				tx_buffer_tail = tail;
			}
		} else if (priority >= 256) {
			yield(); // wait
		}
	}
	tx_buffer[head] = c;
	transmitting = 1;
	tx_buffer_head = head;
	UART1_C2 = C2_TX_ACTIVE;
}

I think in serial3_putchar the 9bit support is missing.

regards

gecko
 
Arrrrgggg.... I thought I fixed that.

Please post the code and I'll give it a try here. Looks like "beta8" might be coming sooner rather than later!

Error line 150 :
T_FFT_SINEWAVE_edit.ino.ino: In function 'void loop()':
Error compiling.

View attachment T_FFT_SINEWAVE_edit.ino.ino

Took me a long time to find - I like two char index vars 'ii' .vs. 'i' [you can't search well for 'i'] so I changed and this one bit me [last one after fixing 10 other things MANUALLY].
 
Last edited:
regarding 1.6 with 1.21 beta7, still trying to sort through ethernet issues. compiles (with plenty of warnings) for T2 but not LC or 3.x, so i assume its back to the same old issue of int sizes re ARM. Using the artnetReceive sketch as a test, output for error is:

/Users/admin/Documents/Arduino/libraries/Ethernet/utility/socket.cpp:295:35: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
W5100.read_data(s,(uint8_t*)ptr,head,2);
^
/Users/admin/Documents/Arduino/libraries/Ethernet/utility/socket.cpp:300:36: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
W5100.read_data(s,(uint8_t*) ptr,buf,data_len);
^
/Users/admin/Documents/Arduino/libraries/Ethernet/utility/socket.cpp: In function 'uint16_t igmpsend(SOCKET, const uint8_t*, uint16_t)':
/Users/admin/Documents/Arduino/libraries/Ethernet/utility/socket.cpp:316:11: warning: variable 'status' set but not used [-Wunused-but-set-variable]
uint8_t status=0;
^
/Users/admin/Documents/Arduino/libraries/Ethernet/utility/w5100.cpp: In member function 'void W5100Class::recv_data_processing(SOCKET, uint8_t*, uint16_t, uint8_t)':
/Users/admin/Documents/Arduino/libraries/Ethernet/utility/w5100.cpp:101:27: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
read_data(s, (uint8_t *)ptr, data, len);
Same errors other UDP sketches
 
tried v1.6 with audio library and teensyduino beta 7. Did not work with audio mixer very well. VERY bad performance compared to last version. I am not sure what happened, code did not change, but I can not play as many sound effects at the same time. Seems to only reliably mix 2 wav files, any more and it goes crazy... but last version could mix 3, sometimes 4 without issue. Everything else seemed to work OK (neopixel, timers, serial)
 
Here is the code that fails when running multiple sound effects You can change the name of the files as needed, and change the 'rate' or time between sound files to see what happens. 100ms is my goal.

I also used RAW files, but can easily replace all the RAW words with WAV to switch to wav format.

Code:
// Simple WAV file player example
//
// Requires the audio shield:
//   http://www.pjrc.com/store/teensy3_audio.html
//
// Data files to put on your SD card can be downloaded here:
//   http://www.pjrc.com/teensy/td_libs_AudioDataFiles.html
//
// This example code is in the public domain.

#include <Audio.h>
#include <Wire.h>
#include <SPI.h>
#include <SD.h>

//////////////////////////////////////////////////////////////////////////
//////////////////////// Audio Setup ///////////////////////////
AudioPlaySdRaw           raw4;       //channel 4 playback
AudioPlaySdRaw           raw3;       //channel 4 playback
AudioPlaySdRaw           raw2;       //channel 4 playback
AudioPlaySdRaw           raw1;       //channel 4 playback
AudioMixer4              mixer1;         //combines up to 4 channels, can play even more if needed by more mixers
AudioOutputI2S           i2s;           //I2S type playback (opposed to I2C etc)
AudioConnection          patchCord1(raw1, 0, mixer1, 0);
AudioConnection          patchCord2(raw2, 0, mixer1, 1);
AudioConnection          patchCord3(raw3, 0, mixer1, 2);
AudioConnection          patchCord4(raw4, 0, mixer1, 3);
AudioConnection          patchCord5(mixer1, 0, i2s, 0);
AudioControlSGTL5000     sgtl5000;     //audio codec chip
//////////////////////////////////////////////////////////////////////////
byte count;
int rate = 100;

void setup() {
  Serial.begin(9600);
  // Audio connections require memory to work.  For more
  // detailed information, see the MemoryAndCpuUsage example
  AudioMemory(15);

  sgtl5000.enable();
  sgtl5000.volume(0.5);
 
  SPI.setMOSI(7);
  SPI.setSCK(14);
  if (!(SD.begin(10))) {
    // stop here, but print a message repetitively
    while (1) {
      Serial.println("Unable to access the SD card");
      delay(500);
    }
  }
  //f1= SD.open("R01.LTP");
  //Serial.println(f1);
}

void playFile(const char *filename)
{
  //Serial.print("Playing file: ");
  //Serial.println(filename);

  // Start playing the file.  This sketch continues to
  // run while the file plays.
  count++;
  if (count > 4)
  {
    count = 1;
  }
  Serial.print("c");
  Serial.print(count);
  Serial.print(" ");
  switch (count)
  {
    case 1:
      //raw1.stop();
      raw1.play(filename);
      break;
    case 2:
      //raw2.stop();
      raw2.play(filename);
      break;
    case 3:
      //raw3.stop();
      raw3.play(filename);
      break;
    case 4:
     // raw4.stop();
      raw4.play(filename);
      break;
    default:
      delay(2000);
      break;
  }
  //Serial.print(AudioProcessorUsage());
  Serial.print("maxCPU: ");
  Serial.print(AudioProcessorUsageMax());
  Serial.print("    ");
  Serial.print("Memory: ");
  //Serial.print(AudioMemoryUsage());
 //Serial.print(",");
  Serial.println(AudioMemoryUsageMax());
  // A brief delay for the library read WAV info
  //delay(50);

  // Simply wait for the file to finish playing.
  //while ()//playRaw.isPlaying()) {
  // uncomment these lines if you audio shield
  // has the optional volume pot soldered
  //float vol = analogRead(15);
  //vol = vol / 1024;
  // sgtl5000_1.volume(vol);
  //}
}


void loop() {
  playFile("R01.LTP");
  delay(rate);
  playFile("A26.LTP");
  delay(rate);
  playFile("V38.LTP");
  delay(rate);
  playFile("H10.LTP");
  delay(rate);
}
 
M
so, a complete fresh start by deleting any traces of old IDE and ethernet files, reload with 1.6 and beta7, and swapped ethernet folder for the one manitou has available: https://github.com/manitou48/teensy3
and seems to be compiling again.
I've mentioned the same in the Artnet thread. The Ethernt library manitou posted is very only and from a distant past before Paul integrated the W5200 auto detect into the Ethernet library. I've used it myselffor a while. It most certainly does not have support for the SPI transactions so may not play very well with other libraries.
 
Hey Headroom, thanks for the comment RE: SPI transactions. Was was just pleased to get it back up and running in any form right now, so old faithfuls come into play. Not sure if it is my system finding old ethernet lib or what was the case, but compile errors with 1.6 and 1.21 beta7 for ethernet were in evidence, so went back a step to the manitou lib. Still have not chased down what is happening with the standard lib.
 
Note: the new version now allows me to uncomment the higher clock rates, which is great. But I have now noticed when I switch to Teency 3.1, it will default to 168mhz, which on my last test failed. Wonder if there should be some default clock speed, that is chosen when you choose Teensy 3.1
 
I noticed that too. Also, the previously selected speed is not remembered. For example if I select teensy 3.1 and set the speed to 96. Then change the board to LC, speed becomes 48. Change board to 3.1 and the speed becomes 168. It looks as if the fastest possible speed is always selected.
 
Arduino 1.6.0 changes how build setting changes are detected. When you switch boards, it resets the custom menus to their first (default) option.
 
Reordering the lines to put the desired 'one on top'.

I also edited boards to add -o1 with the '1' beside what you are calling 96mhz optimized after reading what you wrote above. FFT w/sinewave app shows less CPU usage. So far just doing the FFT with fixed sample times and with no other work so I can't gauge net performance and free CPU time.

Did 120mhz and my USB still works and the above perf test runs more faster.
 
Can you send me those 4 files, so I can test with the same data?

Maybe use dropbox if they're too big to post here in zip files...

I just did some more investigating. It seems that the issue goes away when there are only a small number of files on the SD card. My SD card has about 750 wav files on it. When you have a lot of files, for some reason, at high rate of playback, say opening a file every 100ms, there becomes a lot of problems... Squeek on file open, some files wont play/mix, otherwise it depends on the file or order on the card... Seems to go away completely with say less than 20 files on the card... not really a solution for me.

I did create a thread about file indexing, perhaps if I can have someone help open by indexing the problems would be resolved.

No idea why the problem gets worse in v 1.6 though.
 
My SD card has about 750 wav files on it. When you have a lot of files, for some reason, at high rate of playback, say opening a file every 100ms, there becomes a lot of problems... Squeek on file open, some files wont play/mix, otherwise it depends on the file or order on the card... Seems to go away completely with say less than 20 files on the card... not really a solution for me.

Oh, that makes sense. The play object is opening the file each time. The Arduino SD library probably has to read all the directory sectors leading up to that file, which can be a LOT of data if you have hundreds of files and especially if many of them have long names.

Perhaps a future version should have a way to keep the file open and simply seek back to the beginning. More investigation into that the SD library really does is also needed. All things to look into for the next version.....

I've filed this as an issue, so it won't be forgotten when I work on the audio lib again later this year.

https://github.com/PaulStoffregen/Audio/issues/109
 
Oh, that makes sense. The play object is opening the file each time. The Arduino SD library probably has to read all the directory sectors leading up to that file, which can be a LOT of data if you have hundreds of files and especially if many of them have long names.

Perhaps a future version should have a way to keep the file open and simply seek back to the beginning. More investigation into that the SD library really does is also needed. All things to look into for the next version.....

I've filed this as an issue, so it won't be forgotten when I work on the audio lib again later this year.

https://github.com/PaulStoffregen/Audio/issues/109

Sooner the better if you could. We plan to release a product using the library in the coming months if we can hammer out the bugs.
 
I got this series of compile error using ILI93341_t3

error: 'SPI0' was not declared in this scope
 
Status
Not open for further replies.
Back
Top