Go Down

Topic: Help! Compiler seems to  have died ?? (Read 1 time) previous topic - next topic

CrossRoads

Ever since this evening, I have not been able to compile under -0019, when I start the compiler I get this string of error messages:

Exception in thread "Thread-62" java.lang.StackOverflowError
     at com.oroinc.text.regex.Perl5Matcher._match(Perl5Matcher.java

I have not changed my PC set up. Code compiled last night, got my breadboard wired up now, need to recompile for some hw changes made, am stuck now.  Can't compile, can't autoformat.

Here's my code, I can't tell if its something I did:

/*
Goal for this program - grab serial xmissions from PC's USB port, send out the time parts to MAX6951 for display on eight 7-segment displays.
MAX6951 & Displays are wired per MAX6951 datasheet. 5V Power is from Duemilanove.  Colon is 2 LEDs in series with 390R from +5V to D3

Looking for these bytes
- Byte with MSBs = 0000-0111


Using SPI for interfacing to MAX6951

- pin 13      SCK      SPI clock      
- pin 12      MISO      SPI master in, slave out
- pin 11      MOSI      SPI master out, slave in
- pin 10      SS      SPI slave select

The default SPI configuation is as follows:

- SPI Master enabled
- MSB of the data byte transmitted first
- SPI mode 0 (CPOL = 0, CPHA = 0)
- SPI clock frequency = system clock / 4


*/
#include <SPI.h>  // bring in SPI Library

// SPI uses hardware Chip Select vs having device address

#define DECODE_ADDRESS 0x01 // 0x07, all 8 on
#define INTENSITY_ADDRESS 0x02 // 0x07 to start, half intensity
#define SCANLIMIT_ADDRESS 0x03 // 0x07, all 8 on
#define CONFIG_ADDRESS 0x04
// 0000 0001 => 0 shutdown, 1 = normal mode, no fooling with blink modes & stuff
// 0000 0010 = not used
// 0000 0100 => 0  slow blink, 1 = fast blink
// 0000 1000 => 0 = global blink disabled (Plane 1 data ignored), 1  global blink enabled Plane 1 data used)
// 0001 0000 => 0 = blink unaffected during I2C acknowledge
// 0010 0000 => 0 = data unaffected during I2C ack, 1 = data cleared
// 0100 0000 => not used
// 1000 0000 => blank phase - blink status is read back

// for this use: 0000 0101 => normal operation, fast blink
#define DISPLAYTEST_ADDRESS 0x07 // 0x01, on, 0x00 off
#define DIGIT0_ADDRESS 0x20 // write Plane 0
#define DIGIT1_ADDRESS 0x21 // write Plane 0
#define DIGIT2_ADDRESS 0x22 // write Plane 0
#define DIGIT3_ADDRESS 0x23 // write Plane 0
#define DIGIT4_ADDRESS 0x24 // write Plane 0
#define DIGIT5_ADDRESS 0x25 // write Plane 0
#define DIGIT6_ADDRESS 0x26 // write Plane 0
#define DIGIT7_ADDRESS 0x27 // write Plane 0

unsigned int incomingByte = 0; // variable to store the 5 bytes that come in, a byte every 5 ms (200 Hz rate)

int maskupperbyte = 0;
int masklowerbyte = 0;

int Minutes_Tens;
int Colon;
int Minutes_Ones;
int Seconds_Tens;
int Seconds_Ones;
int numberToDisplay;

int ColonLED=3;
int SS=10;

void setup()
{

  // define pins used - 13,12,11,10 defined by SPI
 pinMode(ColonLED, OUTPUT);
 pinMode(SS, OUTPUT);
 

 // start up SPI
 SPI.begin(); // nothing in () because we are the master

 //start serial so can communicate via USB
 Serial.begin(57600); // open the serial port
 // Need 4800 for Firefly operation.
 // PC COMx uses 57600 for downloading via USB.
 Serial.flush();
 
 //  write config register  
 digitalWrite(SS,LOW);  // take the SS pin low to select the chip:
 SPI.transfer(CONFIG_ADDRESS);  // select the Address,
 SPI.transfer(0x05);      // select the data
 digitalWrite(SS,HIGH);   // take the SS pin high to de-select the chip:
 Serial.println("config register");

 //  write intensity register
 digitalWrite(SS,LOW);  // take the SS pin low to select the chip:
 SPI.transfer(INTENSITY_ADDRESS);  // select the Address,
 SPI.transfer(0x0E);      // select the data
 digitalWrite(SS,HIGH);   // take the SS pin high to de-select the chip:
 Serial.println(intensity register");

 // write scanlimit register
 digitalWrite(SS,LOW);  // take the SS pin low to select the chip:
 SPI.transfer(SCANLIMIT_ADDRESS);  // select the Address,
 SPI.transfer(0xFF);      // select the data
 digitalWrite(SS,HIGH);   // take the SS pin high to de-select the chip:
 Serial.println("scanlimit register");

 // write decode register
 digitalWrite(SS,LOW);  // take the SS pin low to select the chip:
 SPI.transfer(DECODE_ADDRESS);  // select the Address,
 SPI.transfer(0xFF);      // select the data
 digitalWrite(SS,HIGH);   // take the SS pin high to de-select the chip:
 Serial.println("decode register");

 //display test
 digitalWrite(SS,LOW);  // take the SS pin low to select the chip:
 SPI.transfer(DISPLAYTEST_ADDRESS);  // select the Address,
 SPI.transfer(0x01);      // select the data
 digitalWrite(SS,HIGH);   // take the SS pin high to de-select the chip:
 Serial.println("display test on");
 delay (1000);

 digitalWrite(SS,LOW);  // take the SS pin low to select the chip:
 SPI.transfer(DISPLAYTEST_ADDRESS);  // select the Address,
 SPI.transfer(0x00);      // select the data
 digitalWrite(SS,HIGH);   // take the SS pin high to de-select the chip:
 Serial.println("display test off");

} // end of void setup

void loop()
{
 if (Serial.available() > 0) {
// read the incoming byte:
   incomingByte = Serial.read();

   // search for a message - interestingly, will not work correctly using Arduino
   // serial monitor function to send bytes out - need to use program like RS232 Monitor,
   // better simulates the actual device that will be sending us data.
   // Wonder if due to val being declared as unsigned int?

   maskupperbyte = incomingByte & 0xF0; // looking for 1xxx and 0000-0011 in real application
   masklowerbyte = incomingByte & 0x0F; // looking for 0000-1010 in real application

   // MSB=0+000 -> data has weapon 00-01-10, Colon bit, Ten-Minute bit
   if (maskupperbyte == 0x00)
   {
     // write digit0 register
     digitalWrite(SS,LOW);  // take the SS pin low to select the chip:
     SPI.transfer(DIGIT0_ADDRESS);  // select the Address,
     SPI.transfer(masklowerbyte);      // select the data
     digitalWrite(SS,HIGH);   // take the SS pin high to de-select the chip:
   } // end of maskupperbyte = 00

// repeat this 7 more times to write all 8 digits out

} end if available
} end void
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

Coding Badly

Code: [Select]
//  write intensity register
digitalWrite(SS,LOW);  // take the SS pin low to select the chip:
SPI.transfer(INTENSITY_ADDRESS);  // select the Address,
SPI.transfer(0x0E);      // select the data
digitalWrite(SS,HIGH);   // take the SS pin high to de-select the chip:
Serial.println([glow]"[/glow]intensity register");  // [glow]<<<<<<[/glow]


Code: [Select]
} [glow]// [/glow]end if available
} [glow]// [/glow]end void

CrossRoads

Awesome! Never would have thought 2 little things like that would cause such an issue!  I put this missing " & //'s back in, and compiling is completing again.  Thanks!

Robert
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

Go Up