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
    It was a long time ago. I cannot remember. But you need Dmbasic V2.7B which supports CAN commands. mmbasic does not. Bit of a shit fight between mmbasic and dmbasic when it comes to supporting CAN commands.

    Try thias shortcut

    Directory Listing of /files/Hardware/Dontronics/Olimex/Download Files/
     
  2. Flying White Dutchman

    Flying White Dutchman Senior Member

    Joined:
    Dec 29, 2007
    4,374
    313
    0
    Vehicle:
    Other Non-Hybrid
    Model:
    N/A
    there is A canbus.hex on he root folder.. see if that one works.
     
  3. Flying White Dutchman

    Flying White Dutchman Senior Member

    Joined:
    Dec 29, 2007
    4,374
    313
    0
    Vehicle:
    Other Non-Hybrid
    Model:
    N/A
    ok this is not funny.... the canbus.hex file is uploaded but when i run the canview.bas code its empty....
    this canbus.hex firmware is not working with the caview.bas code.. can not read it aparently?

    i really need to now what firmware i need to load to make this work..

    when i now statr the device its DMbasic with nor firmware version and BUILD date : apr 12 2012 11:12:52
    based on mmbasic from geoff

    edit
    found a newer one
    DuinoMite/SOFTWARE/FIRMWARE at master · OLIMEX/DuinoMite · GitHub
    but no version info not in the hex file name nor when booting
    its build date jul 5 2012 15:42:48

    can anyone of you guys boot your device and see what build you got?

    when i run the canview.bas code on this one the screen blanks and then is back at the prompt.
     
  4. Flying White Dutchman

    Flying White Dutchman Senior Member

    Joined:
    Dec 29, 2007
    4,374
    313
    0
    Vehicle:
    Other Non-Hybrid
    Model:
    N/A
    ts frustrating to see t hat those design the firmware are not clear with version numbers.....
    i only need this 2.7b but can not find it anyware.. googled to.

    i have almost loaded al firmwares i could find dated 2012 and non are working or i get a blank pompt after the run or a opencan error that its a onknow command. ( i guess can commands not suuported in that firmware )

    as soon i find the working one i upload it here..!!!!

    EDIT
    you can also try to compile

    MPLAB IDE Archives


    you need
    MPLAB IDE X v1.10

    v1.11B upgrade

    i am downlaoding now
     
  5. lopezjm2001

    lopezjm2001 Senior Member

    Joined:
    Apr 14, 2009
    1,146
    407
    5
    Location:
    Sydney Australia
    Vehicle:
    Other Electric Vehicle
    Model:
    N/A
    Need to use "HIDbootloader" to flash the Duinomite Mega.
    Need to flash "DUINOMITE.hex" and
    Need to flash "DMBasic-2-16-2012.hex".

    It was a long time ago so I am not sure. It took me about a week for me to do this. Once the CANOPEN command works (you do not get an error) you know you have the right DM basic hex file.
     
  6. Flying White Dutchman

    Flying White Dutchman Senior Member

    Joined:
    Dec 29, 2007
    4,374
    313
    0
    Vehicle:
    Other Non-Hybrid
    Model:
    N/A
    so you need to upload 2 firmwares hex and hex?
    i am compiling now from the 2,7b source files project that can be downloaded, only funny is that the can.c and can.h where not in it so i put it in and but ofcourse i get compile errors.......

    i uploaded the firmware your told me 2-16-12 and on boot i got 2.7B now
    but when i load the canbiew.bas file ( i renamed it to a shorted one ) i get nothing just a new prompt again and when i loaad a canbus.bas test file i get the canbusopen error.....

    when there is no canbus connected wil canview.bas just return to a prompt?
     
  7. Flying White Dutchman

    Flying White Dutchman Senior Member

    Joined:
    Dec 29, 2007
    4,374
    313
    0
    Vehicle:
    Other Non-Hybrid
    Model:
    N/A
    this is rediculus...
    how hard can it be to just get the right firmware.... or is my duinomite mega broken ( yes in my case that would be the first thing to think about.. would not be the first time and useally happpens to me anyway )

    i used a sample file canbus.bas what just shows canbus data
    when i load the canview.bas file nothing happens i can load and then run but just get a prompt
    also when i do list then i get no problem to see? when loaded canview.bas ( this did work with the other firmware )

    i am running 2.7b now!! well thats what presented to me at startup
     
  8. Flying White Dutchman

    Flying White Dutchman Senior Member

    Joined:
    Dec 29, 2007
    4,374
    313
    0
    Vehicle:
    Other Non-Hybrid
    Model:
    N/A
    interesting note when i load a MMbasic and not a DMbasic i can run the program.. but when i load the DMbasic 2.7b or other DMbasic i can not run the canview.bas file
    when i reload the MMbasic (3,2c is what i am using) i can run the canview.bas file......but ofcourse canopen error then....

    maybe the latest version is written for MMbasic with the by JDH added can commands?
    but he can not upload it do to closed version of MMbasic instead of open DMbasic.

    thats wy canview.bas will run in MMbasic but still get the canbus error because these are not in place
    so please message me what i need to do to compile a version with the canbus commands
     
  9. Flying White Dutchman

    Flying White Dutchman Senior Member

    Joined:
    Dec 29, 2007
    4,374
    313
    0
    Vehicle:
    Other Non-Hybrid
    Model:
    N/A
    I read that only mmbasic supports code without line numbers and dmbasic still needs them!
    Your canview.bas code, lopez is without line numbers?
    So dmbasic 2.7b would never work with your latest code.....?


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

    lopezjm2001 Senior Member

    Joined:
    Apr 14, 2009
    1,146
    407
    5
    Location:
    Sydney Australia
    Vehicle:
    Other Electric Vehicle
    Model:
    N/A
    I have managed to get PID requests to work. The problem is that the request needs to be sent more than once. Maybe JDH2550 could explain why. This is the code. You need to keep pressing the "g" key on your keyboard and the responce will come. You have to send all 8 bytes of data. It would not work just sending the three data bytes. The response time seems a bit arbitrary and may have to do with making sure the Canbus is free when you send the PID request. But how do you check that the Canbus is free when you send the PID request? Maybe the program misses the return message whilst it is checking the inkey$. Maybe the can receive command is too late and misses the return message. Which case maybe we can run two basic files simultaneously, one to just send PID requests. I am now considering replacing my getcandata function with a PIDrequest function or maybe use both.

    Code:
    10 Cls
    20 Print "                          CARDUINOMITE"
    30 Print " "
    40 Print " "
    100 Print "        CANview program - shows 07EA CAN messages on screen"
    110 Print " "
    120 Rem declare variables for message reception
    130 Dim rxId : Dim rxType : Dim rxLen : Dim rxData(8) : Dim rxOk
    135 Dim txData(8) : Dim txok
    140 Rem set CAN baudrate to 500 kbps and connect to the CAN bus
    150 CANOPEN 500000
    160 Rem start the program loop
    170 Do
    180 txData(0) = 2
    190 txData(1) = 33
    195 txData(2) = 195
    196 txData(3) = 0
    197 txData(4) = 0
    198 txData(5) = 0
    199 txData(6) = 0
    200 txData(7) = 0
    210 If Inkey$ = "g" Then CANSEND &H7E2,0,8,txData(0),txOk Else GoTo 240
    220 If txok = 1 Then Print "SENT OK"
    230 If txok = 0 Then Print "DID NOT SEND"
    240 Rem
    250 Rem check if a message was received
    260 CANRCV rxId, rxType, rxLen, rxData(0), rxOk
    270 If rxOk = 1 Then
    280 Rem process message data
    300 If rxType = 0 Then type$ = "STD" Else type$ = "EXT"
    400 Rem display the message X07EA
    410 If rxId = &H7EA And rxData(0) = &H10 Then
    420 Print rxId "    "rxLen;"  "rxData(0);rxData(1);rxData(2);
    422 Print rxData(3);rxData(4);rxData(5);rxData(6);rxData(7)
    425 EndIf
    430 EndIf
    440 Loop
    470 CANCLOSE
    480 Cls
    490 Print "        CANPORT CLOSED"
    500 End
    
    See photo.

    So I think we should use a PIDrequest function like this one:

    Code:
    Function pidrequest
      Local nLoop
      Local rxId : Local rxType : Local rxLen : Local rxData(8) : Local rxOk
      Local d1 : Local d2
      Local txData(8) : Local txok
      d1=0 : d2=0
      nLoop = 0
      pidrequest = 0
      txData(3) = 0
      txData(4) = 0
      txData(5) = 0
      txData(6) = 0
      txData(7) = 0
      txData(0) = 2
      txData(1) = 33
      txData(2) = 195
      do
        CANSEND &H7E2,0,8,txData(0),txOk
        If txok = 1 Then
            canrcv rxId, rxType, rxLen, rxData(0), rxOk
            If txok = 0 Then Print "DID NOT SEND
            Print "SENT OK"
            If rxok = 1 Then Print "RECEIVED OK"
            If rxok =  0 Then Print "DID NOT RECEIVE"
            If (rxId = &H7EA) And (rxData(0) = &H10 and d1=0) then MG1t = rxData(1) : d1=1
            If (rxId = &H7EA) And (rxData(0) = &H10 and d2=0) then MG2t = rxData(2) : d2=1
        Endif
        if d1=1 And d2=1 then
            pidrequest = 1
            exit function
        Endif
        if nLoop > 8000 then exit function
        nLoop = nLoop + 1
    loop
    End Function
    
     

    Attached Files:

  11. lopezjm2001

    lopezjm2001 Senior Member

    Joined:
    Apr 14, 2009
    1,146
    407
    5
    Location:
    Sydney Australia
    Vehicle:
    Other Electric Vehicle
    Model:
    N/A
    That is correct. I am not allowed by law to distribute my version of DMbasic. In your case you have to add line numbers to my canview.bas program using a program like windows notepad. Either that or you somehow manage to compile the CAN commands with mmbasic source code. Good luck, you could also keep pestering Geoff from MMBasic - BASIC Interpreter Home Page and Frank from DMbasic. If you pester them enough they might give in and just do it. Frank from DMbasic has closed source rights to the CAN commands and Geoff from mmbasic does not. And they will not collaborate. So just keep pestering them. It is just a matter of waiting for mmbasic to come out with CAN commands. Just need to wait.

    Anyhow it sounds like your Duinomite Mega is now working.

    The post by jhd2550 the back shed forum below pretty much sums it up.

    JHD2550 - did you get legal advice, are you sure you are allowed to distribute instructions?

    FWD - You can ask JDH2550 for detailed instructions on merging source codes.
     
  12. lopezjm2001

    lopezjm2001 Senior Member

    Joined:
    Apr 14, 2009
    1,146
    407
    5
    Location:
    Sydney Australia
    Vehicle:
    Other Electric Vehicle
    Model:
    N/A
    Got the thumbs up on cost effectiveness for this project!!

    I have added some more PID values to my Canview_V4_BMS+_XXXXXXX.bas file. I have tested my program standalone with relay box (without Norm's Canview V4) and drove to work without any problem. The code keeps sending the PID 556 endvoltage every 40ms or so. The BMS+ endvoltage can be changed up or down in 5 volts steps by pressing the up or down arrow key on a keyboard. The PHEV/ORIG button also works. When in ORIG mode the endvoltage is 238V. When you go back to PHEV the BMS+ endvoltage is 195V. The BMS+ endvoltage has a range of 195v to 235v. The BMSplus code from Norm needs to match this range.
     
  13. Flying White Dutchman

    Flying White Dutchman Senior Member

    Joined:
    Dec 29, 2007
    4,374
    313
    0
    Vehicle:
    Other Non-Hybrid
    Model:
    N/A
    Wilt send it every 40 milisec?
    Is one time not enough?

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

    Flying White Dutchman Senior Member

    Joined:
    Dec 29, 2007
    4,374
    313
    0
    Vehicle:
    Other Non-Hybrid
    Model:
    N/A
    Would be nice if you pointed that out sooner then telling dm2.7b would work!
    Then i waited with buying something i can not use yet
    -Htc Tapatalk ( sorry for auto spell correct )
     
  15. lopezjm2001

    lopezjm2001 Senior Member

    Joined:
    Apr 14, 2009
    1,146
    407
    5
    Location:
    Sydney Australia
    Vehicle:
    Other Electric Vehicle
    Model:
    N/A
    I observed that the Canview V4 was sending the 556 PID about every 40ms. I guess that Norm did this in case a rogue corrupt message changes the BMSplus end voltage or even disables it. So sending the 556 PID periodically is a guarantee.
     
  16. lopezjm2001

    lopezjm2001 Senior Member

    Joined:
    Apr 14, 2009
    1,146
    407
    5
    Location:
    Sydney Australia
    Vehicle:
    Other Electric Vehicle
    Model:
    N/A
    And demy you the wonderful Duinomite learning experience. If you communicate with JDH2550 you can organize getting mmbasic with CAN commands. Maybe you missed that point.
     
  17. lopezjm2001

    lopezjm2001 Senior Member

    Joined:
    Apr 14, 2009
    1,146
    407
    5
    Location:
    Sydney Australia
    Vehicle:
    Other Electric Vehicle
    Model:
    N/A
    It appears that the 02 in the PID request 7E2 02 21 C3 is offset addressing. I get different values for 03, 04 and so on.
     
  18. lopezjm2001

    lopezjm2001 Senior Member

    Joined:
    Apr 14, 2009
    1,146
    407
    5
    Location:
    Sydney Australia
    Vehicle:
    Other Electric Vehicle
    Model:
    N/A
    Does anybody know what the commands are for clearing DTC for ICE ECU and HV ECU. I tried using the ones supplied by Vass but they did not work.

    EDITED: DTC clearing now working.
     
  19. Flying White Dutchman

    Flying White Dutchman Senior Member

    Joined:
    Dec 29, 2007
    4,374
    313
    0
    Vehicle:
    Other Non-Hybrid
    Model:
    N/A
    i got 2.7b running because when i boot it up it tells me 2.7B
    but when i write
    10 cls
    20 CANOPEN 500000
    and then run i get the unknow command!!

    i dont have it connected to canbus!! maybe thats what giving the error.
     
  20. NortTexSalv04Prius

    NortTexSalv04Prius Active Member

    Joined:
    Nov 14, 2009
    915
    115
    0
    Location:
    Texas
    Vehicle:
    2004 Prius
    Model:
    N/A
    Lopez
    Just a suggestion but Dave Jones from down under knows alot about his EEblog