Main Menu

My life, My coding

Started by Rx7man, May 27, 2015, 09:09:36 AM

Rx7man

They're easy to swap out if needed.. I'm actually not really planning on using it with this project.. yet... and definitely not looking to program through it, but it would be handy for a serial monitor

Meanwhile I'm tearing my hair out with this Visual Studio debugger... I don't know if its some hidden setting or not, but it doesn't break on an error at the line that caused the error.. so it is 10x harder to figure out  what line is acting up.
'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

hakcenter

Not just for being able to program the uno, but the at mode, and all the crap surrounding the unit.. I've had nothing but problems working with it.

Dropped a hc05 and everything cleared up. YMMV
TS2009 Deḇarim 8:2
"And you shall remember that יהוה your Elohim led you all the way these forty years in the wilderness, to humble you, prove you, to know what is in your heart, whether you guard His commands or not.

Rx7man

I'll keep that in mind when I get to working on it.. I also have some other wireless uits.. NFC24W I think it is?  Look just like the HC05/6 modules. 
I did also find some HC07 ones.. don't know if they're the best of both?

Still fighting VS.net.. on a different problem this time... events aren't working right.. grrrrr...
'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

Rx7man

YESSSSS!!!
I finally won against all odds.. it's not particularly pretty, but it will do the job of displaying the data in an easy to read manner.. still have a few things I want to add, but the proof of concept works, and though of course it's a bit tedious to set up, it's not difficult.. and I think I managed to do it in a pretty object oriented fashion...

Each group of graphs has a configuration structure which contains the main title, color gradient, minimum and maximum values allowed, division increments, decimal digits to display, a value multiplier, Min/max peaks with falloff delay, rate, and color and width

Each graph in the group has the value to set, a tag to match to the serial input, name, and what I called a "zero point", which can determine at which point the bar is drawn from the top down

The labels for the values and titles also automatically rotate if the size is too narrow to display them horizontally.. Also, the titles and labels follow the color of the graph, which makes it easy to see at a glance  which ones are different


Unfortunately I'm going to have to redo this all for the R-pi, as well as add code to control the box.. but this is a good start, and I dont' think I'll have to scrap all of this and start right from scratch.. This is quality code I can dare reuse!


'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

Rx7man

Well, the 6 speed swap is nearly complete.. was quite a job.. Depending on the interest I'll be doing a writeup on Cumminsforum.. I did document it pretty well.. Lots of little things you don't foresee.. Things like tcase shifter mounts being tranny-mounted on the NV4500, but body mounted on the later ones.. So you get the body mount and then find that the rods are different lengths, and you get the right length rod.. you put it together and find you go through all the gears in about 1" of motion.. the transfer case actuator arm is about 3 times longer on the new trucks.. so you get that.. and then find that the eustacheon on the transfer case knob reads in reverse, so there must be some differences internally on the later tcases... And then there's the stuff you do foresee.. like tranny mount relocation, reverse switch wires not being long enough, etc... Looks like my reverse switch wire is going to be DARNED close to my downpipe.
'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

Rx7man

Alright, I got the 6 speed in, also put the 3.55 gears in and shortened the driveshaft by 1/2"... LOVE this setup, so much quieter cruising and i'm sure i'll get much improved highway mileage, and I can afford  to drop down a gear when loaded and pull the hills in direct drive since I can now do 75mph in 5th.

Changed out my fuel filter, I'll see if that fixes my low pressure problem and gives me some more top end power.

Also finally programming the LCD screen.. I don't know how well it'll perform, but it's worth a shot.. LCD's seem SLOOW to refresh, and anything over 2 updates a second is useless
'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

Rx7man

well, calving season is under way, 11 calves so far, doing pretty well.. 12 to go.

Love the truck with the new gearing, being able to go 75mph in direct gear and having another one to go sure helps on the passing lanes.
Currently waiting on a pile of CAN transceivers so I can kinda redesign everything, probably will be using a DUE for the brains because of the 32 bit capability, then having a couple Pro-minis on the CAN bus, one for the dash/display/manual inputs, one in the engine bay reading analog sensors close to the source, one may be dedicated to thermocouple duty... then MAYBE I'll still think about using the R-Pi and sniffing the CAN bus for all the information and displaying it.. might take a while yet.

I got an itch yesterday to fiddle with something new, so I had some Sparkfun TLC5940 boards and some RGB LED's.. the board is a 16 channel 12bit PWM module which is chainable.. I bought 50 RGB LED's, so I used 5 of them, and for my purposes I had to rather rewrite the library.. the TLC is a sequential unit, so every time you push a new value in, the previous values for any channel get moved to the next channel.. great for doing sequential stuff, not so great for RGB or setting individual LED's... a few hours and I made some pretty nifty blinkies.. damn those LED's are bright!.. One little issue I came up with was that the green channel is a little weak and it shows when mixing colors, so I still fiddled a little to get that part good by 'trimming' the more dominant colors.. Works pretty good and it's easy to use now... Lavalamp effects, police flasher, misc color displays, fading, chasing colors.. I couldn't think of anything else interesting to do, though if I was epileptic I definitely wouldn't have been able to do this!
'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

Rx7man

I also FINALLY got the LCD screen in.. no cover or anything on it, just kinda glued to the dash.. I'll take a little trip with it and see how it works.. I'm waiting on an LCD that has some buttons on it to see if I like that better.. also waiting on some rotary encoder buttons and an FTDI interface for the Pro Minis, in which case I'll have one of those on the dash controlling the LCD, dash inputs, and blinkylights.
'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

Rx7man

After a few tweaks the LCD is working alright.. had a couple glitches with stuff getting written on the wrong line, especially when a negative number came along and messed up my alignment.
Second problem is that the LCD update takes 72ms, which is freaking slow, so I had to update the turbo position once in the middle of it to prevent the turbo from timing out.. a bandaid fix.
I'm going to rework the library entirely so that I don't have to make Log10 calls to figure out how many digits to show, as well as only updating the LCD physically when it's all done, which should save MASSIVE amounts of time, and probably make it possible to update it more frequently too...
'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

Rx7man

'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

hakcenter

You can check the common code under the logging output section to see how I handle digits, with string replacements, which saves a ton of computational time
TS2009 Deḇarim 8:2
"And you shall remember that יהוה your Elohim led you all the way these forty years in the wilderness, to humble you, prove you, to know what is in your heart, whether you guard His commands or not.

Rx7man

I think a lot of time is lost since it updates the LCD on every change.. cursor position change, etc.. each call takes quite a few cycles.. (probably at least 20 over i2c)
If I have a couple character arrays corresponding to each line, then set the cursor position once, and update the entire memory at once, even if my math, etc is unoptimized I should be better off.. Also, in my current code I set the position for each text tag seperately, I could already glob it all together and see how that changes the speed... I'll take a look at the common code if I get stuck :)
'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

hakcenter

Set a timer, refresh the entire string you send to the lcd on that, only do string replacements to update specific areas :) super fast
TS2009 Deḇarim 8:2
"And you shall remember that יהוה your Elohim led you all the way these forty years in the wilderness, to humble you, prove you, to know what is in your heart, whether you guard His commands or not.

Rx7man

that's kinda my idea.. refreshing individual parts of the screen is just way too slow.. it'll be a while until I get back to coding it.. got too much other stuff happening
'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

me78569

I think I am only updating like 6 positions on my screen now.  I set titles in the setup section of the code. 

Been a very long time since I have looked but I do remember taking my screen update time from ~80 ms to 24ms after that update.
2000 Dodge 2500 quad-cab 5.9 Cummins slt, homebuilt 47re revmax 3.5 messed with vb, Quad adr iquad, 4" tbe , pureflow 150 gph. he351ve in the works 100hp DFI inj