Recent Posts

Pages: [1] 2 3 ... 10
1
General Discussion / Re: Starting a new build
« Last post by Rx7man on April 18, 2018, 10:43:09 PM »
I'd start tossing in some serial prints in there and see what's going on..  Also pay attention to HEX and DECimal values with your message ID's

I'd start with putting one in the interrupt, then each CASE statement.. is it actually getting in there?

Also, it would make the program flow look smoother if instead of setting a flag that the copy is done, just go right to parsing that data out.   Also, global variables tend to be frowned upon when not absolutely necessary.. Pass directly to the function..
2
General Discussion / Re: Starting a new build
« Last post by Chewy1576 on April 18, 2018, 09:15:19 PM »
Here's my first attempt, no workie....

Code: [Select]
void MCP2515_ISR()
{
  data_rcvd = true;
}

void C_CANBUS()
{
  data_rcvd = false;
 
  if (CAN.available() == true)
    {
      rcv_data = CAN.read();
    };
 
  data_ready = true;
}

void copydata()
{
  data_ready = false;
  switch(rcv_data.id)
    {
      case turbo_speed_ID:
        memcpy(rcv_data.data,turbo_speed.b,4);
        break;

      case vane_pos_ID:
        memcpy(rcv_data.data,vane_pos.b,4);
        break;

      case boost_pressure_ID:
        memcpy(rcv_data.data,boost_pressure.b,4);
        break;

      case egt_ID:
        memcpy(rcv_data.data,egt.b,4);
        break;
    }
}

void loop()
{
  if (data_rcvd = true)
  {
    C_CANBUS();
  }

  if (data_ready = true)
  {
    copydata();
  }

  D_LCDWrite();

}
3
General Discussion / Re: Starting a new build
« Last post by Chewy1576 on April 18, 2018, 09:36:40 AM »
I'll try to give it a shot tonight. Thanks!!!
4
General Discussion / Re: Starting a new build
« Last post by Rx7man on April 18, 2018, 07:33:22 AM »
I'd start with setting up a bunch of #DEFINE statements that set up the messageID and what they're for, then use a CASE statement.. Can't remember the exact syntax for it, I think this is right?

Code: [Select]
#Define RPM_MID 345543 //I'm just using random numbers here
#Define EGT_MID 23432
#define TSS_MID 645555
.
.
.
.
.

void MessageHandler(CAN Message){
fourbyte value = GetFourbyteFromMessage(Message);

Select Message.ID{
   Case RPM_MID:
    RPM = value;
    break;
  Case EGT_MID;
    TSS = value;
    break;
  Case TSS_MID:
    TSS = value;
    break;
}
}

fourbyte GetFourbyteFromMessage(CAN Message){
//do your memcopy here, or just do it byte by byte
return value;
}

5
General Discussion / Re: Starting a new build
« Last post by Chewy1576 on April 17, 2018, 09:58:19 PM »
In the software, using if statements looking for the  specific message ID, then doing a memcpy into the fourbyte array. I started looking into masks and filters too, but haven’t gotten very far.
6
General Discussion / Re: Starting a new build
« Last post by Rx7man on April 17, 2018, 07:55:14 PM »
Are you trying to do it in hardware (the MCP chip has some mailboxes, filters, etc) or in software?
7
General Discussion / Re: Starting a new build
« Last post by Chewy1576 on April 17, 2018, 07:10:24 PM »
I haven't really had much time to work on this, but I've been trying to set up the message filtering on the LCD side and it's kicking my butt! It's receiving all of the messages, but I'm having trouble figuring out how to grab specific messages and copying the data into the variables for display on the LCD.
8
General Discussion / Re: Adding notch to turbo shaft for VR sensor pickup
« Last post by Rx7man on April 12, 2018, 09:59:28 AM »
It's as good as mine looks!  Yeah, it'll take a bit to spool it.. In your application you might be better off with a stock wheel and housing.. time will tell :)
9
General Discussion / Re: Adding notch to turbo shaft for VR sensor pickup
« Last post by 606lyfe on April 12, 2018, 09:11:23 AM »

Notch is in, marked out from your measurements and went at with a tiny diamond dusted disc.

I wouldn't call it precision machine work, but hey it works.

Turbo shaft speed sensor now working.

Happy days.

Need to get on tuning up the turbo rpm curves - my little 3.0 6pot doesn't flow quite as much exhaust gas as a cummins

10
Installation / Re: Lil BB 2.0
« Last post by Rx7man on April 11, 2018, 09:13:28 PM »
Is there any chance I could email you?
His email link is in his profile :)
Pages: [1] 2 3 ... 10