Any strange behaviour, crashing issues etc, post them here! Problems compiling the firmware should go in the General support section rather than here
#47334
Problem with the programmable outputs, I have firmware 202012 I wanted to use the programmable outputs using the pin6 of the arduino (since it is from the iac 2 and I am not using it), I need this output to work by rpm but there is no case that it turns on .. Not even in tunerstudio it appears that it works .. in firmware 202008 it works without problems ... to solve the problem quickly use the VVTI output to make it work ... but I have this output reserved for something else.
Thanks a lot
Attachments
(74.11 KiB) Downloaded 302 times
#50406
No input at all here?

I have been going through debugging the eeprom reading out what is being written in the locations specified in 202008, 202103 and 2021.04-dev.

My initial method was to read out the eeprom from the locations from storage.h after configuring outputs in tuner studio and comparing the eeprom data.

202008 config page is 13 and location is 2468-2596 also the .ini file for tuner studio config references page 13
Code: Select all
Storage.h
#define EEPROM_CONFIG13_START 2468
#define EEPROM_CONFIG13_END   2596
storage.ino
  case progOutsPage:
      /*---------------------------------------------------
      | Config page 13 (See storage.h for data layout)
      -----------------------------------------------------*/
      pnt_configPage = (byte *)&configPage13; //Create a pointer to Page 12 in memory
      //As there are no 3d tables in this page, all bytes can simply be read in
      for(int x=EEPROM_CONFIG13_START; x<EEPROM_CONFIG13_END; x++)
      {
        if( (writeCounter > EEPROM_MAX_WRITE_BLOCK) ) { break; } //This is a safety check to make sure we don't attempt to write too much to the EEPROM at a time.
        if(EEPROM.read(x) != *(pnt_configPage + byte(x - EEPROM_CONFIG13_START))) { EEPROM.write(x, *(pnt_configPage + byte(x - EEPROM_CONFIG13_START))); writeCounter++; }
      }
      if(writeCounter > EEPROM_MAX_WRITE_BLOCK) { eepromWritesPending = true; }
      else { eepromWritesPending = false; }
      break;

    default:
      break;
  }
this works and is settable, readout of eeprom
Attachments
202008 - eeprom read.png
202008 - eeprom read.png (12.08 KiB) Viewed 5912 times
#50407
202103 as follows
Code: Select all
storage.h
#define EEPROM_CONFIG13_START 2580
#define EEPROM_CONFIG13_END   2708
storage.ino
  case progOutsPage:
      /*---------------------------------------------------
      | Config page 13 (See storage.h for data layout)
      -----------------------------------------------------*/
      index = EEPROM_CONFIG13_START;
      writeCounter = write_range(index, (byte *)&configPage13, (byte *)&configPage13+sizeof(configPage13), writeCounter);
      eepromWritesPending = writeCounter > EEPROM_MAX_WRITE_BLOCK;
      break;
Changing setting affects nothing and will not show output activation
eeprom readout follows
Attachments
202103 - eepron readout.png
202103 - eepron readout.png (16.25 KiB) Viewed 5912 times
By neovin
#50408
Whoop, I have manage to work out a "fix" to enable programmable outs.

Bought forward and replaced some lines in utilities.ino from 202008
Code: Select all
void initialiseProgrammableIO()
{
  for (uint8_t y = 0; y < sizeof(configPage13.outputPin); y++)
  {
    if ( (configPage13.outputPin[y] > 0) && (configPage13.outputPin[y] < BOARD_MAX_DIGITAL_PINS) )
    {
      pinMode(configPage13.outputPin[y], OUTPUT);
      digitalWrite(configPage13.outputPin[y], (configPage13.outputInverted & (1U << y)));
    }
  }
}

void checkProgrammableIO()
{
  int16_t data, data2;
  bool firstCheck, secondCheck;

  for (uint8_t y = 0; y < sizeof(configPage13.outputPin); y++)
  {
    firstCheck = false;
    secondCheck = false;
    if ( configPage13.outputPin[y] > 0 ) //if outputPin == 0 it is disabled
    { 
      //byte theIndex = configPage13.firstDataIn[y];
      data = ProgrammableIOGetData(configPage13.firstDataIn[y]);
      data2 = configPage13.firstTarget[y];

      if ( (configPage13.operation[y].firstCompType == COMPARATOR_EQUAL) && (data == data2) ) { firstCheck = true; }
      else if ( (configPage13.operation[y].firstCompType == COMPARATOR_NOT_EQUAL) && (data != data2) ) { firstCheck = true; }
      else if ( (configPage13.operation[y].firstCompType == COMPARATOR_GREATER) && (data > data2) ) { firstCheck = true; }
      else if ( (configPage13.operation[y].firstCompType == COMPARATOR_GREATER_EQUAL) && (data >= data2) ) { firstCheck = true; }
      else if ( (configPage13.operation[y].firstCompType == COMPARATOR_LESS) && (data < data2) ) { firstCheck = true; }
      else if ( (configPage13.operation[y].firstCompType == COMPARATOR_LESS_EQUAL) && (data <= data2) ) { firstCheck = true; }

      if (configPage13.operation[y].bitwise != BITWISE_DISABLED)
      {
        if ( configPage13.secondDataIn[y] < LOG_ENTRY_SIZE ) //Failsafe check
        {
          data = ProgrammableIOGetData(configPage13.secondDataIn[y]);
          data2 = configPage13.secondTarget[y];
          
          if ( (configPage13.operation[y].secondCompType == COMPARATOR_EQUAL) && (data == data2) ) { secondCheck = true; }
          else if ( (configPage13.operation[y].secondCompType == COMPARATOR_NOT_EQUAL) && (data != data2) ) { secondCheck = true; }
          else if ( (configPage13.operation[y].secondCompType == COMPARATOR_GREATER) && (data > data2) ) { secondCheck = true; }
          else if ( (configPage13.operation[y].secondCompType == COMPARATOR_GREATER_EQUAL) && (data >= data2) ) { secondCheck = true; }
          else if ( (configPage13.operation[y].secondCompType == COMPARATOR_LESS) && (data < data2) ) { secondCheck = true; }
          else if ( (configPage13.operation[y].secondCompType == COMPARATOR_LESS_EQUAL) && (data <= data2) ) { secondCheck = true; }

          if (configPage13.operation[y].bitwise == BITWISE_AND) { firstCheck &= secondCheck; }
          if (configPage13.operation[y].bitwise == BITWISE_OR) { firstCheck |= secondCheck; }
          if (configPage13.operation[y].bitwise == BITWISE_XOR) { firstCheck ^= secondCheck; }
        }
      }
      

      if ( (firstCheck == true) && (configPage13.outputDelay[y] != 0) && (configPage13.outputDelay[y] < 255) )
      {
        if ( (ioDelay[y] >= configPage13.outputDelay[y]) )
        {
          if (configPage13.outputPin[y] <= 128) { digitalWrite(configPage13.outputPin[y], (configPage13.outputInverted & (1U << y)) ^ firstCheck); }
        }
        else { ioDelay[y]++; }
      }
      else
      {
        if ( configPage13.outputPin[y] <= 128 ) { digitalWrite(configPage13.outputPin[y], (configPage13.outputInverted & (1U << y)) ^ firstCheck); }
        if ( firstCheck == false ) { ioDelay[y] = 0; }
      }
      if ( firstCheck == true ) { BIT_SET(currentStatus.outputsStatus, y); }
      else { BIT_CLEAR(currentStatus.outputsStatus, y); }
    }
    else { BIT_CLEAR(currentStatus.outputsStatus, y); }
  }
}
#50411
Programmable outputs work fine as long as you understand the limitations.

You can use an output that is assigned to something else. Even if it's disabled. You need a completely unused pin.

There re other issues with some logic that doesn't work when done in certain ways but works in the opposite way.

All this info you have provided is of little use to anyone as you have not supposed either the tune you used nor a log when testing.
#50416
All testing was done with respective generic base tunes on speeduino 0.4.3c using pin6 as the output.

This works fine on version 202008 but anything after affects no change in tunerstudio.
For my testing I used the map sensor to apply differing analog values
Will post the modified firmware as well as current tune with working outputs this evening
This whole ordeal is to me able to use the built in extra lc and hc outputs to with whatever I need
#50420
Neo1 wrote: Wed May 19, 2021 9:58 am
This whole ordeal is to me able to use the built in extra lc and hc outputs to with whatever I need
That's easy....

Don't have them assigned in any way to any other function even if it's disabled and it will work.

Also as best I can tell pin 6 isn't assigned to anything (checking firmware now) so no idea why you are testing with it.

And no idea how you are testing anything as you have provide 0 details.

Perhaps step back and look at what you have posted and see if it even means anything because currently it doesn't as you have supplied 0 context.
#50422
Just checked the firmware.

Pin 6 is in use.

pinIdle2 = 6; //2 wire idle control

Unless you have changed this pin no to something else that isn't in use then you cannot use it for programmable IO.

And as you haven't provided any details one what you have been doing it can only be assumed you have NOT done this correctly.
#50474
theonewithin wrote: Wed May 19, 2021 10:31 am Just checked the firmware.

Pin 6 is in use.

pinIdle2 = 6; //2 wire idle control

Unless you have changed this pin no to something else that isn't in use then you cannot use it for programmable IO.

And as you haven't provided any details one what you have been doing it can only be assumed you have NOT done this correctly.
Thankyou for the variable and notepad++ for the search through all open docs.

I did not understand from the schematic as its unassigned there, went completely the wrong way round but i managed to bypass the check and get it to work on the bench that way.
Next is to try and add pin selection to the idle menu in ts, as a primer to add alternator control via pwm.
I intend to modify/duplicate IAC control tables to pwm the thing

Hi, I am trying to assign Signed values to the x-a[…]

Vr Conditioner Noise when cranking

New version 202305 don't fix the issue. Now after[…]

blitzbox

I've finally figured out why MAP and Lambda weren'[…]

Hello, I bring news!! Let me tell you that after […]

Still can't find what you're looking for?