Search results

  1. E

    Limiting signed numbers to some value

    True, thanks for the reminder. Had slipped out of my head totally. Edmunds
  2. E

    Limiting signed numbers to some value

    Dear all, I have been fiddling with this for a few evenings, but had nothing to report. Tonight, I did a fresh attempt and got everything to work as expected. The problem so far [also with my own initial attempt] was I was trying to re-use variables. There were places where this was OK and...
  3. E

    Limiting signed numbers to some value

    Dear @Aries , Not there yet either :). I have successfully ported your code on top of mine, figured out how it works and while it tracks current_pos, which could be used to know that no more Movement commands should be accepted, the MAX operators only deal with immediate inputs, not the...
  4. E

    Limiting signed numbers to some value

    Dear @hippy, I got your code working on top of mine (i.e. in the vehicle) and what it seems to be doing is limiting the steering response per loop to what the limit is. Not quite there yet, but closing in :). Thank you for your input, Edmunds
  5. E

    Limiting signed numbers to some value

    I added a few numbers to @hippy's input data and made a table of what the position and outputs need to be with limits set at -200 and +200 Input Position Output 0 0 0 'all zero for start -350 -200 -200...
  6. E

    Limiting signed numbers to some value

    Looks promising :). Have not tried it yet, will try to do this tonight, too. Thank you for your time, Edmunds
  7. E

    Limiting signed numbers to some value

    That is a good summary, I think with exception of this Above is done by P(I)D algorithm and while it might not look like much, is reasonably tuned for the chassis I'm working with through many painful iterations. I would like to avoid touching it, so I want to stick addition and limiting on...
  8. E

    Limiting signed numbers to some value

    I replaced all the macroses with code for now, so now the main loop is pretty understandable and should compile with MagLine function removed. Symbol No_magnet = bit30 'No magnet [1], magnet present [0] Symbol counter0 = w17 'b34:b33; Just a counter Symbol ELine = w15...
  9. E

    Limiting signed numbers to some value

    The inputs are decent controlled values, coming out of a PID algorithm, overflow risks are being controlled. 0 is $0000, sorry, my bad. Over $8000 are negative and counting backwards exactly as you say. Thank you for your input, Edmunds
  10. E

    Limiting signed numbers to some value

    Dear @hippy, Thank you once again for showing the way with how to feed some string of values to the function for testing. I'm now playing with the code and I can see this will not give up so easily. What you are doing now, is, you are capping the value of steer to not go over the limit on a per...
  11. E

    Limiting signed numbers to some value

    Great :). Thank you, @hippy. Edmunds
  12. E

    Limiting signed numbers to some value

    Dear all, I have a problem I have attempted to address a few times now with limited success. I think I even tried to ask this forum once or at least seriously considered it before :) - I will try to be more clear about what I'm trying to do this time. There is a signed word variable...
  13. E

    1Hz oscilator

    Dear all, Once again, thank you for all the replies. The solution I have designed into a PCB that is being produced at some place China as we speak, is based on TCA6507 - 'LOW-VOLTAGE 7-BIT I2C AND SMBus LED DRIVER WITH INTENSITY CONTROL AND SHUTDOWN'. The device measures just 2.00mm x 1.40mm...
  14. E

    1Hz oscilator

    Hippy, is timer0 available for us through PokeSFRs? I have sort of neglected it, because it is not used for PWM or counting functions when I was at timers, but it seems, with a 255 prescaler, in 16bit mode I could generate interrupt every 0.5s on overflow to toggle a pin. If access to interrupt...
  15. E

    1Hz oscilator

    You are right, sorry, I misread the data sheet. Thank you, Edmunds
  16. E

    1Hz oscilator

    I2C as such did work and reasonably well. I have had issues with a hanging bus on some vehicles, but this could be due to hardware issues and it could also be possible to work around this in software. I have been running from multi-picaxe solution, because of complexity of maintaining several...
  17. E

    1Hz oscilator

    Alan, I have not quite figured out if and how I could use this as I would like to get an external pulsed signal and as far as I understand, I can adjust pulse length, but I need an external trigger for every pulse. This also takes at least three picaxe pins and blocks one more (comparator+)...
  18. E

    1Hz oscilator

    Hippy, Thanks for your interest. There are 10 LEDs on the rear PCB, 10 LEDs on a trailer PCB and 6 to 10 LEDs on the front PCB (there is also a TOF I2C distance sensor ir IR receiver in front to name the most important items). While some of the LEDs come in pairs, this is still many wires...
  19. E

    1Hz oscilator

    Thanks for all the replies! My favourite is, of course, cutting off what you don't need of an IC. However, that would not be very production or 'assembly in China' friendly :). The accuracy need is very mild. The totality of the problem is I have blinkers (as in 'turn indicators' and LED, 5mA...
Top