Megajolt LCD display
Moderators: JeffC, rdoherty, stieg, brentp
-
- Posts: 133
- Joined: Tue Jun 08, 2010 7:06 pm
-
- Posts: 704
- Joined: Sun Sep 07, 2008 1:54 pm
- Location: Fareham, GB
Its just a demo screen at the moment funky, how i would like to set it out. I'm still learning how to display measurements onto the screen but i'm gettin there slowly. Everyday is a learning day.
1310 A-series Mini, lightened and built myself. V4 board and loving it
Rasputin22 - The Mini Forum
Rasputin22 - MK1 Golf Forum
Megajolt repair for the UK available
Rasputin22 - The Mini Forum
Rasputin22 - MK1 Golf Forum
Megajolt repair for the UK available
-
- Posts: 152
- Joined: Wed Jan 02, 2008 12:52 pm
- Location: Melbourne, Australia
Nice Progress there Ryan (iirc).
Very fast refresh rates on LCD's can produce some weird effects.. The Liquid Crystal cant change state fast enough (especially at Low Temperature. wait till you see what your LCD moves like after being parked outside overnight The liquid thickens up and moves slowly).
I saw a Demo (showoff graphics) once that deliberately used the effect to get some very interesting displays. The Demoscene guys love finding ways to make hardware do wacky stuff.. Have you ever seen an Oscilloscope do this ? http://www.youtube.com/watch?v=s1eNjUgaB-g
Have you got the Megajolt query code working yet ? You will probably need to do some funky state-machine type stuff if you want to keep your display updating smoothly while waiting for the serial data string to come in from the jolt. It depends on how the rest of your code times. You can check out or use the code from the Nixie Tach if you want to see what I mean.
Very fast refresh rates on LCD's can produce some weird effects.. The Liquid Crystal cant change state fast enough (especially at Low Temperature. wait till you see what your LCD moves like after being parked outside overnight The liquid thickens up and moves slowly).
I saw a Demo (showoff graphics) once that deliberately used the effect to get some very interesting displays. The Demoscene guys love finding ways to make hardware do wacky stuff.. Have you ever seen an Oscilloscope do this ? http://www.youtube.com/watch?v=s1eNjUgaB-g
Have you got the Megajolt query code working yet ? You will probably need to do some funky state-machine type stuff if you want to keep your display updating smoothly while waiting for the serial data string to come in from the jolt. It depends on how the rest of your code times. You can check out or use the code from the Nixie Tach if you want to see what I mean.
-
- Posts: 704
- Joined: Sun Sep 07, 2008 1:54 pm
- Location: Fareham, GB
Spockie, you remember correctly, lol.
The video is really cool with the silly scope. Didn't know you could do those kind of things with a scope. I think some people have too much time on their hands, lol.
I don't currently have a megajolt unit to play with at the moment as its in my car in the workshop so i will have to take it out next time i'm there (not very often at the moment). I was thinking of running a loop on one of the outputs to supply the megajolt with a PIP signal, variable by a pot, and a couple more pots to emulate TPS and aux in.
I have been playing around with your code, trying to understand a bit at a time (get it, lol), and working out what would be relevant. One thing i need to fully understand is the use of some of the other code available i haven't really touched on yet. I have not really used any 'If', 'else' or some other functions yet but i'm sure they are straight forward when i have used them a couple of times.
Brent,
That would be a great help thanks. Did you get my email from my work address??
The video is really cool with the silly scope. Didn't know you could do those kind of things with a scope. I think some people have too much time on their hands, lol.
I don't currently have a megajolt unit to play with at the moment as its in my car in the workshop so i will have to take it out next time i'm there (not very often at the moment). I was thinking of running a loop on one of the outputs to supply the megajolt with a PIP signal, variable by a pot, and a couple more pots to emulate TPS and aux in.
I have been playing around with your code, trying to understand a bit at a time (get it, lol), and working out what would be relevant. One thing i need to fully understand is the use of some of the other code available i haven't really touched on yet. I have not really used any 'If', 'else' or some other functions yet but i'm sure they are straight forward when i have used them a couple of times.
Brent,
That would be a great help thanks. Did you get my email from my work address??
1310 A-series Mini, lightened and built myself. V4 board and loving it
Rasputin22 - The Mini Forum
Rasputin22 - MK1 Golf Forum
Megajolt repair for the UK available
Rasputin22 - The Mini Forum
Rasputin22 - MK1 Golf Forum
Megajolt repair for the UK available
-
- Posts: 152
- Joined: Wed Jan 02, 2008 12:52 pm
- Location: Melbourne, Australia
This is the relevant part of the NixieTach Arduino code to disassemble and seperate the response string received from the megajolt (in megajolt_rx_string), and calculate the human-readable RPM and store it in megajolt_rpm_word.
It also seperates out all the other flags and current bins etc and stores them in seperate variables too.. but the area between the //*******'s is the RPM relevant bit. (sorry to jump in there Brent, but I thought Arduino code rather than generic would be more helpful to Ryan )
*edits, getting forums to display tabbed code nicely takes lots of fiddling !
It also seperates out all the other flags and current bins etc and stores them in seperate variables too.. but the area between the //*******'s is the RPM relevant bit. (sorry to jump in there Brent, but I thought Arduino code rather than generic would be more helpful to Ryan )
Code: Select all
// disassemble megajolt status response string
megajolt_advance = megajolt_rx_string[0]; // get the current advance amount
//**********
megajolt_rpm_hi = megajolt_rx_string[1]; // get the current rpm ticks - hi byte
megajolt_rpm_low = megajolt_rx_string[2]; // get the current rpm ticks - low byte
megajolt_rpm_ticks = megajolt_rpm_hi << 8; // bit shift the high byte up to top 8 bits
megajolt_rpm_ticks = megajolt_rpm_ticks + megajolt_rpm_low; // add low byte for rpm word
/* We do the calculation like this ...
raw RPM count = microseconds elapsed between EDIS PIP signals
RPM = 60 * (1/((rpmTicks/1,000,000)*cylinder))
cylinder = 2 for 4 cylinders, cylinder = 3 for 6 cyls, cylinder = 4 for 8 cyls
rpmTicks = 16 bit value- High Byte:Low Byte
The below calculations are done without the /1,000,000 step referred to above
to keep the intermediate values as integers (no decimal points)
since the Arduino floating point calculations are not accurate.
*/
rpm_calc = megajolt_rpm_ticks; // was /1000000 - leave as is to keep integer
rpm_calc = rpm_calc * 2; // no change required to this part
rpm_calc = 1000000 / rpm_calc; // was 1/x, but now 1,000,000/x to cancel above shift
rpm_calc = rpm_calc * 60; // change RPS to RPM
megajolt_rpm_word = rpm_calc; // and store it in the right int variable
//***********
megajolt_rpm_bin = megajolt_rx_string[3] & B11110000; // mask low 4 bits to remove load bin
megajolt_rpm_bin = megajolt_rpm_bin >> 4; // shift rpm bin down4 into lower bits
megajolt_load_bin = megajolt_rx_string[3] & B00001111; // mask upper 4 bits remove rpm bin
megajolt_load = megajolt_rx_string[4]; // get the current load kpa/tps (%?)
megajolt_flags = megajolt_rx_string[5]; // cxsruuuu, c=conf 0/1, x=reserved
// s=shft, r=revlimit, uuuu = user 1-4
megajolt_aux = megajolt_rx_string[6]; // Auxillary Input (Scaled)
megajolt_advcor_bin = megajolt_rx_string[7]; // Advance Correction Bin #
megajolt_adv_cor = megajolt_rx_string[8]; // Advance correction (degrees, signed)
Last edited by Spockie-Tech on Thu Sep 30, 2010 3:28 am, edited 3 times in total.
-
- Posts: 133
- Joined: Tue Jun 08, 2010 7:06 pm
Bumpage for old time's sake... how did you get on with this Ryan?
I decided to go down a similar route to scooterputer, but with a few changes. Waiting on my touch screen to arrive, but then I'm in no rush whatsoever... making a start in Ernest on getting my engine back together from Saturday, if I EVER get my head back from porting and boring... onwards and upwards and all that jazz
I decided to go down a similar route to scooterputer, but with a few changes. Waiting on my touch screen to arrive, but then I'm in no rush whatsoever... making a start in Ernest on getting my engine back together from Saturday, if I EVER get my head back from porting and boring... onwards and upwards and all that jazz
-
- Posts: 704
- Joined: Sun Sep 07, 2008 1:54 pm
- Location: Fareham, GB
Hey Funky,
I have kind of stalled a bit to be honest on most of my projects at the moment. I'm not getting too much done at the moment as the misses is due in a couple of months and my work is getting busier and busier, boo.
Plus I dont have a working jolted car to play with at the moment. Which has reminded me of a project I wanted to do of programming an arduino to emulate a PIP signal and fool the jolt into thinking it was connected to an EDIS so it could tested and played around with in the comfort of my living/toy room.
Maybe I need to order another arduino???
I have kind of stalled a bit to be honest on most of my projects at the moment. I'm not getting too much done at the moment as the misses is due in a couple of months and my work is getting busier and busier, boo.
Plus I dont have a working jolted car to play with at the moment. Which has reminded me of a project I wanted to do of programming an arduino to emulate a PIP signal and fool the jolt into thinking it was connected to an EDIS so it could tested and played around with in the comfort of my living/toy room.
Maybe I need to order another arduino???
1310 A-series Mini, lightened and built myself. V4 board and loving it
Rasputin22 - The Mini Forum
Rasputin22 - MK1 Golf Forum
Megajolt repair for the UK available
Rasputin22 - The Mini Forum
Rasputin22 - MK1 Golf Forum
Megajolt repair for the UK available
Don't bother about the arduino - whilst it would be easy enough to do you can just buy a jimstim - set the dip switches to 36-1 trigger pattern and VR-simulation.
That said I've just got myself _another_ arduino (a mega this time) as all my others are tied up on other projects so a simulator on that would be quite fun.
That said I've just got myself _another_ arduino (a mega this time) as all my others are tied up on other projects so a simulator on that would be quite fun.
Official Megajolt distributor for UK and Europe.
Complete Megajolt packages, EDIS kits, Trigger wheels and everything else you need for your megajolt install
www.trigger-wheels.com
Complete Megajolt packages, EDIS kits, Trigger wheels and everything else you need for your megajolt install
www.trigger-wheels.com
-
- Posts: 133
- Joined: Tue Jun 08, 2010 7:06 pm
Might also be cheaper to get a picoduino or 5, lol.NITROPIXIE wrote:Maybe I need to order another arduino???
Mind you, the whole Arduino platform has developed somewhat in recent months, they're a lot more on offer, including off the shelf Mega chipped boards.
I'm still messing about with a few bits n bobs, but like you, most personal stuff took a back seat in the run up to Christmas. Still, new year, low work now, so more time to fiddle.
I decided that I should really splash out on the TouchShield Slide for what I want to do... considering it is going to be my complete front end for everything. We're going minimal baby
-
- Posts: 152
- Joined: Wed Jan 02, 2008 12:52 pm
- Location: Melbourne, Australia
Woo.. Necromancer Thread Revival !
I made a fair bit of progress on several fronts before moving house caused my 13 year-old workshop to have to be disassembled, boxed, moved and is only now (9 months later) approaching its former hackability level.. (As in tools, parts bins, workbenches, test gear, computers etc being setup in a fashion where I can spend more time workin on stuff rather than *looking* for it was stashed.
Another guy "Downunder" here in Melbourne with me is presently working his way towards getting his arduino talking to his Megajolt and Im giving him a few pointers along the way, so Im easing back into it.
One of the spin-offs that is about 2/3 ready (well, thats about where I got to before I moved house) is an Arduino based "ELM327 Emulator". WTF use is that ?
Well, with the proliferation of tablets, phones and all the Android powered funky display devices (especially the OLED Samsung devices that are nice and readable even in bright light), - There are now some pretty cool OBD (On Board Diagnostics) applications available with customiseable gauges, layouts, multi screens, logs, alerts etc. I particularly like the Android App called "Torque" by Ian Hawkins
Generally you buy an OBD-->Bluetooth or OBD-->USB adapter from ebay (if you dont mind taking a chance on a cheapy "might work" type) for $20-$30, or you go to a reputable seller of quality devices, spend $50-$150 and get one thats much more likely to. These are usually called ELM327 convertors since they are based on a chip of that part #
This plugs into the cars OBD port, which talks to the on board fuel injection computer and lets you get all sorts of techie parameters like fuel trims, rpm, temps, whether the rear left indicator bulb is blown and all sorts (hundreds) of parameters that you can then feed to your phone/tablet/laptop via bluetooth or USB and display.
The problem of course for us Megajolters, is chances are your car *was* made before 1996, and so doesnt have an OBD port, and thus my "emulator" project.
The idea is it will be able to either 1. query another ECU (like a Megajolt or Mgeasquirt), for whatever information it can provide (Map. TPS, Advance, RPM etc), *and* 2. Have sensors connected directly to it (provided you have the electronics skill to do some basic sensor signal conditioning to make a 0-5v output) and then reformat that and feed it to the display device running and OBD , just as if your car *did* have an OBD port.
Then you can mount your tablet/phone/whatever and hey presto, a fully customisable, skinnable, dashboard (that is probably also a GPS, Accelerometer, Phone, Wifi etc).
This project is now back on the front burner, and I have the arduino's powered up, sitting right next to me on the desk at the moment.
Unfortunately, At the rate the day job is presently eating time, it will probably still be a few weeks, possibly a month or two before anything of "semi-release-quality" hits the net,
but if anyone who knows some basic Microcontroller-skills wants to prod-me along, I'm happy to share the big chunks of code Ive already written (reverse engineering the ELM327 protocol).
A small setback was that I found the basic 328-based arduino couldnt run a 38.4Kbaud link to the MJ *and* a 115KBaud Bluetooth link at the same time, so I had to move on up to a gruntier "Mega" version. (Im using Seeduino Megas, but any of the Mega-series will work).
This dual hardware UART (MEga) requirement only applies if you want to do the ECU->Arduino->Bluetooth->Phone trick - If you just want your Arduino to talk with the MJ and run an LCD or 7-segments or lights or whatever, the standard 328 Arduinos are fine for that.
I dont have time to teach basic-electronics and Arduino programming from scratch to everybody Im sorry, so if you have no idea on how to calculate a current-limit resistor or level-shift an RS232 stream without me explaining it cookbook-fashion, then I would suggest you google about and find your local "Hacker space" where you will quite likely find an Electronics+rev-head hacker who will happily assist you in these things.
But I will assist where I can and answer specific questions, post code etc. And in a few weeks/months, all things going well, the Nixie-Tach will have made it into stage-2 and I'll make another video/post or something.
I made a fair bit of progress on several fronts before moving house caused my 13 year-old workshop to have to be disassembled, boxed, moved and is only now (9 months later) approaching its former hackability level.. (As in tools, parts bins, workbenches, test gear, computers etc being setup in a fashion where I can spend more time workin on stuff rather than *looking* for it was stashed.
Another guy "Downunder" here in Melbourne with me is presently working his way towards getting his arduino talking to his Megajolt and Im giving him a few pointers along the way, so Im easing back into it.
One of the spin-offs that is about 2/3 ready (well, thats about where I got to before I moved house) is an Arduino based "ELM327 Emulator". WTF use is that ?
Well, with the proliferation of tablets, phones and all the Android powered funky display devices (especially the OLED Samsung devices that are nice and readable even in bright light), - There are now some pretty cool OBD (On Board Diagnostics) applications available with customiseable gauges, layouts, multi screens, logs, alerts etc. I particularly like the Android App called "Torque" by Ian Hawkins
Generally you buy an OBD-->Bluetooth or OBD-->USB adapter from ebay (if you dont mind taking a chance on a cheapy "might work" type) for $20-$30, or you go to a reputable seller of quality devices, spend $50-$150 and get one thats much more likely to. These are usually called ELM327 convertors since they are based on a chip of that part #
This plugs into the cars OBD port, which talks to the on board fuel injection computer and lets you get all sorts of techie parameters like fuel trims, rpm, temps, whether the rear left indicator bulb is blown and all sorts (hundreds) of parameters that you can then feed to your phone/tablet/laptop via bluetooth or USB and display.
The problem of course for us Megajolters, is chances are your car *was* made before 1996, and so doesnt have an OBD port, and thus my "emulator" project.
The idea is it will be able to either 1. query another ECU (like a Megajolt or Mgeasquirt), for whatever information it can provide (Map. TPS, Advance, RPM etc), *and* 2. Have sensors connected directly to it (provided you have the electronics skill to do some basic sensor signal conditioning to make a 0-5v output) and then reformat that and feed it to the display device running and OBD , just as if your car *did* have an OBD port.
Then you can mount your tablet/phone/whatever and hey presto, a fully customisable, skinnable, dashboard (that is probably also a GPS, Accelerometer, Phone, Wifi etc).
This project is now back on the front burner, and I have the arduino's powered up, sitting right next to me on the desk at the moment.
Unfortunately, At the rate the day job is presently eating time, it will probably still be a few weeks, possibly a month or two before anything of "semi-release-quality" hits the net,
but if anyone who knows some basic Microcontroller-skills wants to prod-me along, I'm happy to share the big chunks of code Ive already written (reverse engineering the ELM327 protocol).
A small setback was that I found the basic 328-based arduino couldnt run a 38.4Kbaud link to the MJ *and* a 115KBaud Bluetooth link at the same time, so I had to move on up to a gruntier "Mega" version. (Im using Seeduino Megas, but any of the Mega-series will work).
This dual hardware UART (MEga) requirement only applies if you want to do the ECU->Arduino->Bluetooth->Phone trick - If you just want your Arduino to talk with the MJ and run an LCD or 7-segments or lights or whatever, the standard 328 Arduinos are fine for that.
I dont have time to teach basic-electronics and Arduino programming from scratch to everybody Im sorry, so if you have no idea on how to calculate a current-limit resistor or level-shift an RS232 stream without me explaining it cookbook-fashion, then I would suggest you google about and find your local "Hacker space" where you will quite likely find an Electronics+rev-head hacker who will happily assist you in these things.
But I will assist where I can and answer specific questions, post code etc. And in a few weeks/months, all things going well, the Nixie-Tach will have made it into stage-2 and I'll make another video/post or something.