Author Topic: Serial output problems  (Read 1253 times)

Offline Rx7man

  • Crazy guy
  • Hero Member
  • *****
  • Posts: 1079
  • Jack of all trades
    • got 4 cummins
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 dually,  67/67 HE351VE, NV5600, ~600hp
'93 ECLB 47RH, new toy truck, H pump project, 1000hp goal, 300K miles
93 XCLB auto, bone stock, 350K miles
93 XCLB 5spd, bone stock, 100K miles


Offline hakcenter

  • developer
  • Hero Member
  • *****
  • Posts: 770
    • 1998 12v Ram
Reply #1 on: November 09, 2015, 08:36:49 AM
What are you outputting

AMP 2 Corinthians 8:21
For we take thought beforehand and aim to be honest and absolutely above suspicion, not only in the sight of the Lord but also in the sight of men.



Offline Rx7man

  • Crazy guy
  • Hero Member
  • *****
  • Posts: 1079
  • Jack of all trades
    • got 4 cummins
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 dually,  67/67 HE351VE, NV5600, ~600hp
'93 ECLB 47RH, new toy truck, H pump project, 1000hp goal, 300K miles
93 XCLB auto, bone stock, 350K miles
93 XCLB 5spd, bone stock, 100K miles


Offline hakcenter

  • developer
  • Hero Member
  • *****
  • Posts: 770
    • 1998 12v Ram
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.

AMP 2 Corinthians 8:21
For we take thought beforehand and aim to be honest and absolutely above suspicion, not only in the sight of the Lord but also in the sight of men.



Offline Rx7man

  • Crazy guy
  • Hero Member
  • *****
  • Posts: 1079
  • Jack of all trades
    • got 4 cummins
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 dually,  67/67 HE351VE, NV5600, ~600hp
'93 ECLB 47RH, new toy truck, H pump project, 1000hp goal, 300K miles
93 XCLB auto, bone stock, 350K miles
93 XCLB 5spd, bone stock, 100K miles


Offline hakcenter

  • developer
  • Hero Member
  • *****
  • Posts: 770
    • 1998 12v Ram
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.

AMP 2 Corinthians 8:21
For we take thought beforehand and aim to be honest and absolutely above suspicion, not only in the sight of the Lord but also in the sight of men.



Offline Rx7man

  • Crazy guy
  • Hero Member
  • *****
  • Posts: 1079
  • Jack of all trades
    • got 4 cummins
Reply #6 on: November 10, 2015, 07:20:15 AM
Cool, thanks.   I was thinking someone (Sparkfun? Seeed?) should make a conversion board

'94 dually,  67/67 HE351VE, NV5600, ~600hp
'93 ECLB 47RH, new toy truck, H pump project, 1000hp goal, 300K miles
93 XCLB auto, bone stock, 350K miles
93 XCLB 5spd, bone stock, 100K miles


Offline hakcenter

  • developer
  • Hero Member
  • *****
  • Posts: 770
    • 1998 12v Ram
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 ...

AMP 2 Corinthians 8:21
For we take thought beforehand and aim to be honest and absolutely above suspicion, not only in the sight of the Lord but also in the sight of men.



Offline Rx7man

  • Crazy guy
  • Hero Member
  • *****
  • Posts: 1079
  • Jack of all trades
    • got 4 cummins
Reply #8 on: November 10, 2015, 02:07:37 PM
:banghead:  is about all I can say about it

'94 dually,  67/67 HE351VE, NV5600, ~600hp
'93 ECLB 47RH, new toy truck, H pump project, 1000hp goal, 300K miles
93 XCLB auto, bone stock, 350K miles
93 XCLB 5spd, bone stock, 100K miles


Offline Rx7man

  • Crazy guy
  • Hero Member
  • *****
  • Posts: 1079
  • Jack of all trades
    • got 4 cummins
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 dually,  67/67 HE351VE, NV5600, ~600hp
'93 ECLB 47RH, new toy truck, H pump project, 1000hp goal, 300K miles
93 XCLB auto, bone stock, 350K miles
93 XCLB 5spd, bone stock, 100K miles


Offline Rx7man

  • Crazy guy
  • Hero Member
  • *****
  • Posts: 1079
  • Jack of all trades
    • got 4 cummins
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 dually,  67/67 HE351VE, NV5600, ~600hp
'93 ECLB 47RH, new toy truck, H pump project, 1000hp goal, 300K miles
93 XCLB auto, bone stock, 350K miles
93 XCLB 5spd, bone stock, 100K miles