Serial output problems

  • 10 Replies
  • 377 Views
*

Offline Rx7man

  • Crazy guy
  • Hero Member
  • *****
  • 908
  • Jack of all trades
    • '94 Dodge dually
Serial output problems
« on: November 09, 2015, 08:26:40 AM »
Well, I have an issue with the serial output.. it seems as though it suddenly goes out of sync, and outputs gibberish,  I move a coupe things around and it goes away.. I thought the serial buffer in the arduino may be filling up, so I inserted delays, (millis and micros) and it didn't help.. I remove one or two serial prints and it'll go away, even if I add some others later.. very frustrating when you're trying to debug.  my baud rate is 115200
'94 dodge, Colt Cam, head worked, NV5600, 3.55's, SB clutch, Ford manual hubs w. hawk brakes, custom flatdeck, custom aluminum bumper, cab off restoration, totally new engine, Mahle pistons @19:1..HE351VE with 67mm turbine and 67x95mm compressor
440hp/1000 ft lb @ 2400 RPM

*

Online hakcenter

  • developer
  • Hero Member
  • *****
  • 623
    • 1998 12v Ram
Re: Serial output problems
« Reply #1 on: November 09, 2015, 08:36:49 AM »
What are you outputting

*

Offline Rx7man

  • Crazy guy
  • Hero Member
  • *****
  • 908
  • Jack of all trades
    • '94 Dodge dually
Re: Serial output problems
« Reply #2 on: November 09, 2015, 10:18:31 AM »
A few characters of text (variable name) and it's value

Like this
Code: [Select]
Serial.println("--------------------------");
if(JakeMode){Serial.println("JAKE ON");}
if(WarmupMode){Serial.println("WARMUP MODE");}
if(Running){Serial.println("RUNNING");}
else{Serial.println("STALLED");}
Serial.print("RT = ");
Serial.println(Runtime);

Serial.print("TB = ");
Serial.println(TargetBoost);
Serial.print("Position = ");
Serial.println(VgtRealPosition);
//}
//else{
Serial.print("Temp is ");
Serial.println(VgtTemp);
Serial.print("TSS = ");
Serial.println(TSS.Value);
Serial.print("RPM = ");

Serial.println(RPM.Value);
Serial.print("MAP = ");
Serial.println(MAP.Value);
Serial.print("EGP = ");
Serial.println(EGP.Value);
Serial.print("TPS = ");
Serial.println(TPS.Value);
Serial.print("AUX = ");
Serial.println(AUX);
Serial.print("Pot = ");
Serial.println(PPT);
Serial.print("DPR = ");
Serial.println(DPR);
Serial.print("EGPV = ");
Serial.println(EGPV);
Serial.print("Nozzle = ");
Serial.println(NozzleSize);

Serial.print("Normal mode position = ");
Serial.println(NormalPosition);
Serial.print("Jake mode position   = ");
Serial.println(JakePosition);
Serial.print("Start mode position  = ");
Serial.println(StartModePosition);

'94 dodge, Colt Cam, head worked, NV5600, 3.55's, SB clutch, Ford manual hubs w. hawk brakes, custom flatdeck, custom aluminum bumper, cab off restoration, totally new engine, Mahle pistons @19:1..HE351VE with 67mm turbine and 67x95mm compressor
440hp/1000 ft lb @ 2400 RPM

*

Online hakcenter

  • developer
  • Hero Member
  • *****
  • 623
    • 1998 12v Ram
Re: Serial output problems
« Reply #3 on: November 09, 2015, 02:50:32 PM »
Remove the variables and work backwards until you find the culprit.

I know when you get close to memory issues things get pretty wonky.

*

Offline Rx7man

  • Crazy guy
  • Hero Member
  • *****
  • 908
  • Jack of all trades
    • '94 Dodge dually
Re: Serial output problems
« Reply #4 on: November 09, 2015, 09:56:54 PM »
I think the memory must be the issue... probably to do with fragmentation, etc... it's a PITA but I'll find a way to deal with it... I plan on outputting to serial only when asked by the serial client..


BTW.. do you know what I'd need to change to run the lillbb on the Arduino Mega?  I put it on and it won't communicate... that would solve most of my problems.  The Mega has a big USB cable too, which would be more tolerant of being mashed around on the floor of the truck
'94 dodge, Colt Cam, head worked, NV5600, 3.55's, SB clutch, Ford manual hubs w. hawk brakes, custom flatdeck, custom aluminum bumper, cab off restoration, totally new engine, Mahle pistons @19:1..HE351VE with 67mm turbine and 67x95mm compressor
440hp/1000 ft lb @ 2400 RPM

*

Online hakcenter

  • developer
  • Hero Member
  • *****
  • 623
    • 1998 12v Ram
Re: Serial output problems
« Reply #5 on: November 10, 2015, 07:15:08 AM »
FreqMeasure uses pin 8 on the Uno and 49 on the Mega, you'll have to jump that if you want to use it.

For making the CANBUS compatible on the Mega check this thread post here : http://www.seeedstudio.com/forum/viewtopic.php?f=23&t=5172&start=10#p19723

13 - SCK
12 - MISO
11 - MOSI
10 - CS

cut and jump these respectively.

*

Offline Rx7man

  • Crazy guy
  • Hero Member
  • *****
  • 908
  • Jack of all trades
    • '94 Dodge dually
Re: Serial output problems
« Reply #6 on: November 10, 2015, 07:20:15 AM »
Cool, thanks.   I was thinking someone (Sparkfun? Seeed?) should make a conversion board
'94 dodge, Colt Cam, head worked, NV5600, 3.55's, SB clutch, Ford manual hubs w. hawk brakes, custom flatdeck, custom aluminum bumper, cab off restoration, totally new engine, Mahle pistons @19:1..HE351VE with 67mm turbine and 67x95mm compressor
440hp/1000 ft lb @ 2400 RPM

*

Online hakcenter

  • developer
  • Hero Member
  • *****
  • 623
    • 1998 12v Ram
Re: Serial output problems
« Reply #7 on: November 10, 2015, 07:31:27 AM »
Not sure honestly. I'm surprised they didn't keep the mega compatible and just add more pins ...

*

Offline Rx7man

  • Crazy guy
  • Hero Member
  • *****
  • 908
  • Jack of all trades
    • '94 Dodge dually
Re: Serial output problems
« Reply #8 on: November 10, 2015, 02:07:37 PM »
:banghead:  is about all I can say about it
'94 dodge, Colt Cam, head worked, NV5600, 3.55's, SB clutch, Ford manual hubs w. hawk brakes, custom flatdeck, custom aluminum bumper, cab off restoration, totally new engine, Mahle pistons @19:1..HE351VE with 67mm turbine and 67x95mm compressor
440hp/1000 ft lb @ 2400 RPM

*

Offline Rx7man

  • Crazy guy
  • Hero Member
  • *****
  • 908
  • Jack of all trades
    • '94 Dodge dually
Re: Serial output problems
« Reply #9 on: November 10, 2015, 09:22:03 PM »
Got it working on the Mega... pin 10 doesn't need to be cut or jumpered.  I had a Sparkfun Protoboard that I jumpered, and I still have the whole rest of the board to play with.. I clipped the pins on the proto board so I leave the lillbb alone.


this will help me a lot
'94 dodge, Colt Cam, head worked, NV5600, 3.55's, SB clutch, Ford manual hubs w. hawk brakes, custom flatdeck, custom aluminum bumper, cab off restoration, totally new engine, Mahle pistons @19:1..HE351VE with 67mm turbine and 67x95mm compressor
440hp/1000 ft lb @ 2400 RPM

*

Offline Rx7man

  • Crazy guy
  • Hero Member
  • *****
  • 908
  • Jack of all trades
    • '94 Dodge dually
Re: Serial output problems
« Reply #10 on: November 10, 2015, 09:23:40 PM »
Oh, I will probably be removing a couple pullup resistors on the digital inputs on the lillbb if I use them  as outputs.. TBD
'94 dodge, Colt Cam, head worked, NV5600, 3.55's, SB clutch, Ford manual hubs w. hawk brakes, custom flatdeck, custom aluminum bumper, cab off restoration, totally new engine, Mahle pistons @19:1..HE351VE with 67mm turbine and 67x95mm compressor
440hp/1000 ft lb @ 2400 RPM