1. Attachments are working again! Check out this thread for more details and to report any other bugs.

My Duinomite Mega Canview V4 equivalent Project

Discussion in 'Prius PHEV Plug-In Modifications' started by lopezjm2001, Jul 19, 2012.

?
  1. Yes

    11 vote(s)
    100.0%
  2. Prefer to use Android Torque device

    0 vote(s)
    0.0%
  3. Prefer to use Scangauge

    0 vote(s)
    0.0%
  1. lopezjm2001

    lopezjm2001 Senior Member

    Joined:
    Apr 14, 2009
    1,146
    407
    5
    Location:
    Sydney Australia
    Vehicle:
    Other Electric Vehicle
    Model:
    N/A

    Canview_Pages.jpg
    Dunimite1.png
    Wiring the Duinomite mega to OBD2 plug.jpg
    OBD2 pinout.JPG
    obd2 pins.JPG
    Duinomite Mega CAN connections.JPG

    CANVIEW - Only works with Toyota Prius 2004 - 2009 (2nd Generation)

    I have recently started this project of making a equivalent replacement of my Canview V4 from CAN-view index using a Duinomite Mega to be used with a BMSplus. As many people already know Norm has stopped making the Canviews as there are better and cheaper alternatives like this one.

    It is just a matter of connecting an OBD2 plug to the three screws terminal block (green) of the CAN port (CAN high, CAN low, Ground(signal ground - SGND). And connect 12V supply to the power jack plug (12Vpositive or 12V+ and chassi ground - CGND). The inner part of the power jack plug is positive and the outer part is ground.

    It can also log data onto a miniSD card.

    DUINOMITE BASIC COMPUTER

    STEP BY STEP USING A COMPUTER WITH WINDOWS 7 (CANVIEW FOR DUMMIES)

    The Duinomite Mega is delivered with it's own version of basic called DMbasic which we no longer use. We need to install the latest version of MMbasic with CAN by Geoff Graham. We need to dowload two zip files from this website Geoff's Projects - The Colour Maximite.

    You also need to purchase a microSD card, keyboard using a PS2 plug and a miniUSB cable.

    microSDcard.jpg

    The microSD card just slides into the slot.

    DSC04894.jpg

    1. Download "Duinomite MMbasic firmware Version 4.3" (or whichever is the latest version at the time) and also download "Special version of V4.3 with CAN commands (controller area network)" from this website Geoff's Projects - The Colour Maximite. Save it to your desktop.

    MMbasic_web.JPG

    2. Using the WINzip program (or any other kind of ZIP program) to extract "MMBasic with CAN.ZIP" and save the file "Duinomite_MMBasic_V4.3 with CAN.hex" to your computer desktop.

    Duinomite_mmbasic_files.JPG

    3. Using the Winzip program unpack the zip file "Duinomite_MMBasic.ZIP" and save the file "BootLoader.exe" to your desktop.

    MMbasic with CAN files.JPG

    4. Now run the program "BootLoader.exe". Should look like this:

    BootLoader.JPG

    5. Connect the miniUSB cable from your computer to your Duinomite Mega. The Duinomite Mega is solely powered by the miniUSB cable. As just shown below:

    MiniUSB_cable.jpg

    6. Connect miniUSB cable from your computer to your Duinomite Mega. Press the black button on the side of the Duinomite Mega (there are two black buttons, so use the one closest to the USB plug) at the same time as you plug in the miniUSB cable. You should see the green LED and amber LED flashing. This indicates that the Duinomite Mega is ready for firmware download.

    BootLoader_2.JPG

    You can see this Youtube video which shows you how the green LED and the amber LED flash when it is ready to accept a new firmware download:


    7. Using your mouse click the button "Load Hex File". Now should look like this:

    Bootloader_3.JPG

    8. Using your mouse select the file "Duinomite_MMBasic_V4.3 with CAN". Select the button "Open". Should now see the following:

    BootLoader_4.JPG

    9. Using your mouse now press the button "Program Device". Now you should see the following:

    BootLoader_5.JPG

    10 . Now follow the instructions by restarting the device. This can be done by replugging the miniUSB cable.

    11. Download my latest ZIP file attached to this post and UNZIP it and save them to go into the microSD card root directory i.e. My latest ZIP file is attached in the first post of this thread. Note the numbers 29032013 is the date, so use the latest date. Read the instructions in the readme.txt file.

    The basic program "AUTORUN.BAS" will automatically run when the Duinomite Mega is booted or rebooted or when the Prius READY signal becomes true.

    You will need to buy a microSD card, PS2 keyboard and a VGA monitor. A size 7" screen monitor is a common used size VGA monitor to install into a car. The hardest part is wiring a OBD2 plug to the Duinomite Mega.

    Good luck!!

    UPDATE: The same procedure shown above is used to load the latest version of mmbasic 4.4.
     

    Attached Files:

    #1 lopezjm2001, Jul 19, 2012
    Last edited: Nov 27, 2015
  2. mrbigh

    mrbigh Prius Absolutum Dominium

    Joined:
    Sep 6, 2005
    3,686
    699
    2
    Location:
    Long Island, NY
    Vehicle:
    Other Electric Vehicle
    Good job, the only thing is that I got a neck pain after watching the promotional videoo_O
     
  3. NortTexSalv04Prius

    NortTexSalv04Prius Active Member

    Joined:
    Nov 14, 2009
    915
    114
    0
    Location:
    Texas
    Vehicle:
    2004 Prius
    Model:
    N/A
  4. Flying White Dutchman

    Flying White Dutchman Senior Member

    Joined:
    Dec 29, 2007
    4,374
    313
    0
    Vehicle:
    Other Non-Hybrid
    Model:
    N/A
    Can you already send canbus commands to the bms+ ? To go from phev to org mode or change the spoof voltage?

    -Htc Tapatalk ( sorry for auto spell correct )
     
  5. lopezjm2001

    lopezjm2001 Senior Member

    Joined:
    Apr 14, 2009
    1,146
    407
    5
    Location:
    Sydney Australia
    Vehicle:
    Other Electric Vehicle
    Model:
    N/A
    Yes, but I will be leaving out the manual part of just sending SoC which is too dangerous. I have tested the DMbasic code and the PHEV/ORIG button works. When you press the gas pedal hard the SoC goes to 99% and in ORIG mode it does not. I have a program problem in that you have to press the PHEV/ORIG button for too much time for it to toggle between PHEV and ORIG. I have asked JHD to look into it to see what he can do. My next step is to write DMbasic code to increase/decrease the end voltage. At the moment it is just set to 210v.

    I periodically update my Canview DMbasic file which I upload to my first post In this thread when I can. Still waiting for delivery of my arduino 4 relay module Four 4-Channel 5V Relay Module Expansion Board For Arduino PIC AVR ARM MCU DSP | eBay, I am also waiting on a OBD2 splitter cable which will allow me to use the Canview V4 and my Duinomite Mega together 30 cm OBD2 OBD-II 16 pin Splitter Extension Cable Male to Dual Female Y Cable | eBay
     
  6. Flying White Dutchman

    Flying White Dutchman Senior Member

    Joined:
    Dec 29, 2007
    4,374
    313
    0
    Vehicle:
    Other Non-Hybrid
    Model:
    N/A
    is it really because of the reading canbus message that are already there that this device displays them so slowly or just because its a slow unit?
    it would be nice to just connect a switch a a input of the board so it will depending on the switch go from ORIG to PHEV etc.
    if you then also control a relay with that ( for the contactors ) you have a full replacement ( for control that is ) of the canview and also one that you dont need a big touchscreen but just a toggle switch on your dash
    that would be nice.

    if you got the Emega with the ethernet port you probably could hook your car to your network at home and see on your pc or a website stuff like charge voltage and so on
     
  7. lopezjm2001

    lopezjm2001 Senior Member

    Joined:
    Apr 14, 2009
    1,146
    407
    5
    Location:
    Sydney Australia
    Vehicle:
    Other Electric Vehicle
    Model:
    N/A
    It updates the volts and amps quickly so I doubt that if the device is slow. However if it is the DMbasic program is slow then I may have to start using interrupts to speed it up. Unfortunately Toyota did not design their CaNbus system for monitoring so the PIDs have to be requested. Many PIDs are just never seen on the CANbus unless they are requested by a device plugged into the OBD2 port.
    At this time the CAN commands do not work with the eMEGA according to JHD.

    "De"-nginer | Page 5 | PriusChat

    The simplicity of this project enables anybody to make their own Code and customize it to the way they want to use it. Seriously any 12 y.o. Kid could write basic code for a Duinomite Mega and make it work.

    JHD has just managed to patch together the CAN commands with mmBasic 3.2C so there is some light over the horrizon.
     
  8. lopezjm2001

    lopezjm2001 Senior Member

    Joined:
    Apr 14, 2009
    1,146
    407
    5
    Location:
    Sydney Australia
    Vehicle:
    Other Electric Vehicle
    Model:
    N/A
    Just received delivery of my 4 relay module. I will be wiring it up to a DB15 female plug to make it compatible with my Canview V4. Makes it easier to swap over. Once I get my OBD2 splitter I hope that I will be able to get my Duinomite Mega to see the Canbus message sent by my clone Mongoose cable to switch on the HV battery fan to different speeds. Then I can incorporate this command into my DMbasic program. JDH has also fixed the F4 - PHEV/ORIG button bug so now it responds straight away.
     
  9. lopezjm2001

    lopezjm2001 Senior Member

    Joined:
    Apr 14, 2009
    1,146
    407
    5
    Location:
    Sydney Australia
    Vehicle:
    Other Electric Vehicle
    Model:
    N/A
  10. Flying White Dutchman

    Flying White Dutchman Senior Member

    Joined:
    Dec 29, 2007
    4,374
    313
    0
    Vehicle:
    Other Non-Hybrid
    Model:
    N/A
    This would be good for enginer setups.
    My oem does not get warm at all so no real need dit it
    But in wintertime i could warm the oem battery up to cabine temp.

    -Htc Tapatalk ( sorry for auto spell correct )
     
  11. Flying White Dutchman

    Flying White Dutchman Senior Member

    Joined:
    Dec 29, 2007
    4,374
    313
    0
    Vehicle:
    Other Non-Hybrid
    Model:
    N/A
    Lopez did you measure the watts this unit pulls of the 12 battery?
    Power consumption....

    -Htc Tapatalk ( sorry for auto spell correct )
     
  12. lopezjm2001

    lopezjm2001 Senior Member

    Joined:
    Apr 14, 2009
    1,146
    407
    5
    Location:
    Sydney Australia
    Vehicle:
    Other Electric Vehicle
    Model:
    N/A
    It is low priority on my to do list so I will do it eventually. I have just finished putting together my relay box together with cables and plugs. See photos. Still trying to get PID requests to work.
    I am thinking is the command to request MG1 temperature request (07 e2 02 21 ce) meant to be sent in extended frame format? HELP anybody.

     

    Attached Files:

  13. Flying White Dutchman

    Flying White Dutchman Senior Member

    Joined:
    Dec 29, 2007
    4,374
    313
    0
    Vehicle:
    Other Non-Hybrid
    Model:
    N/A
  14. lopezjm2001

    lopezjm2001 Senior Member

    Joined:
    Apr 14, 2009
    1,146
    407
    5
    Location:
    Sydney Australia
    Vehicle:
    Other Electric Vehicle
    Model:
    N/A
    Yes, basic uses toolchains which is slow but it is necessary so anybody could write their own simple code.
    You can write a faster program in C but fewer people have that ability. Any 12 y.o. Kid can write a basic program.
     
  15. Flying White Dutchman

    Flying White Dutchman Senior Member

    Joined:
    Dec 29, 2007
    4,374
    313
    0
    Vehicle:
    Other Non-Hybrid
    Model:
    N/A
    Yes any 12 can ;-) so get your canbus request working then :p any 12 year old can ;-)

    I think you need to be a bit above average at 12 to do this.

    Stil you older guys have troubles with it

    -Htc Tapatalk ( sorry for auto spell correct )
     
  16. lopezjm2001

    lopezjm2001 Senior Member

    Joined:
    Apr 14, 2009
    1,146
    407
    5
    Location:
    Sydney Australia
    Vehicle:
    Other Electric Vehicle
    Model:
    N/A
    Our expert programmer JDH2550 is working on it. If he cannot get PID requests to work successfully then nobody can.
     
  17. jdh2550

    jdh2550 Co-Founder, Current Motor Company

    Joined:
    Nov 16, 2010
    317
    249
    0
    Location:
    Ann Arbor
    Vehicle:
    2005 Prius
    Model:
    N/A
    That's jDh not jHd ;) and although I'm a veteran programmer I have a mental age slightly less than 12 y.o. - so who knows if I can get it working or not?

    I didn't notice this thread until today.

    From my understanding of the CAN bus implementation it's actually much faster to pull unsolicited IDs off of the bus (which is what you're doing now) rather than request PIDs (which is what you want to do to get info that isn't already broadcast). So, I don't think that's the speed issue. I'll have a look at your code.

    Here's my contribution to the DuinoMite Prius world:
    1) I've integrated CAN into MMBasic and it is going to be included in the official MMBasic 4.0 release. I have a beta build from Geoff to test.
    2) I haven't got PID requests working yet. Priidash and Torque both use an ELM based device which is a higher level CAN chip controlled by AT commands. They send an AT command and then the PID request and the ELM does the "magic". We have a simpler CAN interface and I haven't worked out the magic to make it work yet. However, in theory all I'll need to do is have the DM sniff while I have Torque send a request. Also, I've not actually tested the CANSEND command - so it might be that that's broken.
    3) I've created a version of the HSI display based on alexmol project (on this forum but I don't have the link to hand). I wrote it last night but I haven't even run any of it yet - so when I get that working I'll post it.
    4) I'll look at the latest CANVIEW bas file from jlo to see if I can speed it up

    BTW, an important thing to note is that not only is programming the DM to read CAN messages in BASIC a blast it's also by far the most economical hobbyist platform for CAN. An Arduino Mega is approx. equivalent in processing horespower and costs ~$60 then you have to add a CAN shield for another ~$40. The DM Mega is $40 and comes with CAN and VGA (and a whole host of other things). It's an amazing value. Kudos to the Olimex guys in Bulgaria.
     
  18. jdh2550

    jdh2550 Co-Founder, Current Motor Company

    Joined:
    Nov 16, 2010
    317
    249
    0
    Location:
    Ann Arbor
    Vehicle:
    2005 Prius
    Model:
    N/A
    Trouble is that's kind of misleading. Unless you want to implement a simple loop and counter it doesn't mean anything (sorry Olimex!). I mean just put a PRINT statement in there (which is a single BASIC instruction) and you'll see the performance plummet. Every BASIC command is going to have a very different processing time - and some are not entirely deterministic.

    So, the Olimex test shows you the minimum amount of overhead and can be used to compare their implementation of a trivial loop with another implementation (be it in compiled C, assembler or a different interpreter). However, there's no information in that post that will tell us if BASIC is quick enough to do what we want to do.

    However, all is not lost! We can look at moving time critical functions into C and calling them from within the BASIC program. This is not a bad approach to programming in general. Don't optimize until you know what needs optimizing and using multiple languages like this actually helps with modularization of the code.

    Just my 2 cents worth.
     
  19. lopezjm2001

    lopezjm2001 Senior Member

    Joined:
    Apr 14, 2009
    1,146
    407
    5
    Location:
    Sydney Australia
    Vehicle:
    Other Electric Vehicle
    Model:
    N/A
  20. lopezjm2001

    lopezjm2001 Senior Member

    Joined:
    Apr 14, 2009
    1,146
    407
    5
    Location:
    Sydney Australia
    Vehicle:
    Other Electric Vehicle
    Model:
    N/A
    I also have a ScangaugeII. When my obd2 splitter cable arrives I will be able to see what the Scangauge puts out on the Canbus. I could fool them by connecting the two devices together without actually connecting either to the Prius canbus by placing a resistor (60ohms I think) across the bus pins and then just log what the Scangauge puts out. Either way I can log what my Scangauge puts out on the Canbus as it sends PId requests.