Honda CR-Z Hybrid Car Forums banner
41 - 58 of 58 Posts

·
IMA Enthusiast
Joined
·
1,259 Posts
Discussion Starter · #41 · (Edited)
Interesting those vital Ignition hold relays should not be clicking quickly randomly continuously.

Mark them then pull them out and swap them round, maybe swap them for any spares on your lithium pack.

Check your main IMA multi connector on that new pack for pin corrosion.
Plug and unplug it and use electrical contact cleaner if you have some.

As your car is a JDM CVT there may be subtle wiring differences we are completely unaware of.
We are also completely in the dark about the condition of the Nimh pack/electronics you bought.
 

·
Registered
Joined
·
48 Posts
We are also completely in the dark about the condition of the Nimh pack/electronics you bought.
In my first check through HDS it looks balanced and apparently in good condition from exterior atleast.

Mark them then pull them out and swap them round, maybe swap them for any spares on your lithium pack.

Check your main IMA multi connector on that new pack for pin corrosion.
Plug and unplug it and use electrical contact cleaner if you have some.
Sure, I ll do both and report Back,
 

·
IMA Enthusiast
Joined
·
1,259 Posts
Discussion Starter · #43 ·
OK we know this works and we can get rid of the IMA/CEL lights, but I still have a few gremlins at my end and I have simply run out of time for now.
So I have put car back to OEM Lithium for Holiday abroad next week. I'm super busy and need to test it over the next few days to make sure it is all OK.
Might take a spare IMA fan as well to Belgium. LOL

I am tinkering with a little CAN IMA light remover gadget based on those MCP2515 CAN boards I showed in an earlier video.
 

·
IMA Enthusiast
Joined
·
1,259 Posts
Discussion Starter · #44 · (Edited)
CAN Fooler.

So here are some details for the IMA and CEL fooler device.
Hopefully with the Nimh into a Lithium car swap it should get rid of the lights.
Disclaimer!!! With all mods this is all 100% at your own risk.

Rectangle Font Parallel Slope Pattern



This gadget sits on the H/L FCAN lines so can be hacked in at the back or plugged into the OBDII port.
I'm not detailing every bit of it, you have to build it yourself on stripboard/proto board from my notes videos etc.

I used a PIC16F1825 for this as I had some kicking about. They are <$2 to buy.

This was mated to a bargain CAN board from AliExpress again <$2

I could supply a built gadget but the cost would be a lot higher than self build...

You will need a cheap PIC programmer to upload the firmware code to the 16F1825 device.

The OBDII port can supply 12v power, so if you go this way you will need a simple voltage regulator to drop that to 5V for these boards.
Note the OBDII port is powered all the time so the device would sit consuming a tiny amount of power, probably less than 10ma.
Add a switch if you want.

If you hack it into the IMA pack wiring or even inside the MCM itself (which is what I would do) you can easily pick up 5V you need to simplify things.
The device would then sleep properly and only be powered when the car is on as well.

Mode of operation.

The gadget sits on the FCAN line sending out a 4 byte $1E2 packet with rotating check byte every 20ms.
This packet is sent by the MCM in an OEM Lithium car, but is not sent by an Nimh MCM, so it has to be replaced or we get the errors.
The data we are sending is fixed and seems to work ok in my limited testing.
Feedback welcome as usual. We can easily tweak what it is sending.

Our PIC16F1825 running at 32mhz on the internal oscillator for a reduced component count is programmed to send out data to the MCP2515 using hardware SPI data transfer at a leisurely 500khz clock speed.
The actual CAN transmission is done by the crystal controlled MCP2515 so accuracy and stability should not be an issue.

The zipped source with notes and compiled code are attached to this post. (Rename from pdf to zip and extract)

The PIC only needs three wires connected to the MCP2515

PIC16F1825 >>>>>. MCP2515 (Pins as labelled on CAN board)

Pin 8 SDO >>>>>> SI
Pin 10 SCK >>>>>> SCK
Pin 13 CS >>>>>>> CS

Both need a shared +5V power and ground.

Good luck. (y)


Note. The video/schematic now matches the uploaded code in the attached file.

@Uzair Mir are you going to make one of these?
Is your car still working ok?

EDIT 03/05/2022 Slight update to firmware.
 

Attachments

·
Registered
Joined
·
48 Posts
@Uzair Mir are you going to make one of these?
amm No @PeterPerkins, i wasn't thinking to make one of these because From the looks of it, it appeared as a bit too complicated for me 😔, Im just a simple Game artist who with a bit of research, can make some sense of software engineering related things but this electrical engineering stuff seems to be going over the top of me.

But now that you have asked, Im intrigued to do some research into it too. After all, How difficult could it be. I have next couple of days free, So Im going to do some research into this and if I found those two chips locally, I will definitely try this just to document for the community at least


Is your car still working ok?
and yes, car is running perfectly fine apart from the IMA error. Yesterday, i had to remove the 12v battery connection to rearrange the phase wires so i can put the top cover back on the battery pack. and when I connected everything back, it again went into the force tick over regen mode with all the bars showing empty for 10 mins which had me worried for a while. but after 8-10 mins of charging all the bars came back and everything went to normal.

also the Noise I was hearing earlier was also just a false alarm. It wasn't coming from relays, instead it was coming from ducts/fan. So yesterday, I reopen the duct to fit it properly on the pack and this piece of wire cover came out of it. i think it was this piece Circulating the air system and when hit the fan makes those fast clicking noise and then go back into the ducts with air pressure.
Insect Arthropod Caterpillar millipedes Bottle

Havent heard the noise since its removed.
 

·
IMA Enthusiast
Joined
·
1,259 Posts
Discussion Starter · #46 · (Edited)
LOL re loose plastic piece!! :p You had me quite worried with the clicking relays!

Yes if you disconnect the 12V battery for any reason in a Nimh MCM car it forgets/resets the SOC and it has to force charge to work it out.

Note. I slightly altered the firmware in above post for more reliability.
 

·
Registered
Joined
·
48 Posts
Hey @PeterPerkins, So I did some study and ordered most of the stuff to Program the device (CAN Board is on the way), The only thing I could not find anywhere is the PIC16F1825 microchip. I want to ask Can I use another 8bit DIP Microchip similar to PIC16F?
Say something like this?
Arduino Modules Components :: Semiconductor Components & ICs :: Microcontroller :: PIC16F688 16F688 14 PIN PIC Microcontroller - Buy Quality Electronics | Hallroad Lahore

I Know the pin location will be different and i might have to make my own pin connection based on the data, but is the HEX Code compatible with other chips too?? anything particular I should be looking for in the chip for it to work?
 

Attachments

·
IMA Enthusiast
Joined
·
1,259 Posts
Discussion Starter · #48 · (Edited)
Swapping PICS can be done but.....

The 16F688 does not have an SPI module, so the SPI would have to be bit bang serial out.
I don't have an 16F688 so cannot test the code on one.

The 16F1825 code as is will certainly not work so that would require time and effort and $ to change for another PIC.

You mentioned a 16F676 in your PM, this might work but again the code will have to be modified as it does not have an SPI module.

What PICS can you actually get easily/cheaply at the moment? Give me a few options.
If we are bit banging then you don't need an SPI module in the PIC.

The other alternative is I send you a built unit.
What is your address in Pakistan?


On hand I have the following PICS.
I suggest you get one of these and I will modify the code to run on one using BITBANGING techniques.

8 PIN
12F683/675 (675 would need a little more code tweaking)
12F1822
12F1840

14 PIN
16F684
16F1825

You can also get nice cheap little PIC12F675 developer boards for $5.
 

·
IMA Enthusiast
Joined
·
1,259 Posts
Discussion Starter · #49 · (Edited)
OK I have written some very simple non SPI module BITBANG code which should work on the 8 pin pic 12F683.


Code:
'------- Honda CRZ NIMH into Lithium using MCP2515 CAN Board MCM Install -------
'--- This FCAN code hopefully removes the IMA and CEL Lights after the swap ----
'---------- Picbasic Pro Compiler version PIC12F683 - 130522 - V01 -------------
'-------------- Note this software requires the MPASM assembler ----------------
' This install is based on my video https://www.youtube.com/watch?v=oB_fFPRXLEE
'-------------------------------------------------------------------------------
'
'***************************** PIC 12F683 Pinouts ******************************
'
'                                    Top
'                                   __ __
'(+ Supply Vdd)              +Ve -1|  ^  |8- -Ve            (- Supply GND Vss)
'(SDO Data Out)              GP5 -2|  6  |7- GP0                     (ICSPDAT)
'(SCK Clock Out)             GP4 -3|  8  |6- GP1                     (ICSPCLK)
'(MCLR)                      GP3 -4|  3  |5- GP2              (CS Control Out)
'                                   -----
'
'******************** MCP 2515 CAN CONTROLLER Pinouts **************************
'
'                                    Top
'                                   __ __
'                         TXCAN -01|  ^  |18- +Vdd                  
'                         RXCAN -02|  M  |17- RESET
'                    CLKOUT/SOF -03|  C  |16- CS from PIC (Control)
'                        TX0RTS -04|  P  |15- SDO
'                        TX1RTS -05|  2  |14- SDI from PIC (Data)
'                        TX2RTS -06|  5  |13- SCK from PIC (Clock)
'                          OSC2 -07|  1  |12- INT
'                          OSC1 -08|  5  |11- RX0BF
'                      Gnd/-Vss -09|     |10- RX1BF
'                                   -----
'
'***** PIC12F683 ICSP In circuit serial Programming Pinouts 5 Pin Sil 0.1" *****

'1) MCLR
'2) +5V
'3) GND
'4) Data (PGD)
'5) Clock (PGC)

'******************************** Pcb Specs ************************************

'Board Supply Voltage 5.00V
'CPU Speed 8mhz with internal resonator
'Average Board Supply Current at 5v <10ma      

'*******************************************************************************
'********************** Program Size 395 out of 2048 Words *********************
'*******************************************************************************

#config
__config _FCMEN_OFF & _IESO_OFF & _BOD_OFF & _CPD_OFF & _CP_OFF & _MCLRE_OFF & _PWRTE_OFF & _WDT_OFF & _INTOSCIO
#ENDCONFIG

DEFINE OSC 8            'Set PicBasic Pro processor speed to 8 Mhz (Must match oscillator value)
OSCCON = %01110000        'Sets internal Osc to 8 Mhz (Default) and stable
CMCON0 = %00000111         'Comparators off
TRISIO = %00000000         'Set All Outputs
ANSEL  = %00000000      'All digital
ADCON0 = %00000000        'ADC Off

'------------------ Pins used for I/O and designations -------------------------

'ICSPDAT    VAR GPIO.0    'ICSPDAT
'ICSPCLK    VAR GPIO.1    'ICSPCLK
CS          VAR GPIO.2    'CS Control Out
'MCLR         VAR GPIO.3    'MCLR
SCK         VAR GPIO.4    'SCK Clock Out
SDO         VAR GPIO.5    'SDO Data Out

'===============================================================================
'                   MCP2515 Register Mapping                        
'===============================================================================

CNF3            CON    $28
TXB0CTRL        CON    $30
TXB0SIDH        CON    $31
TXB0D0          CON    $36
               
'===============================================================================
' '                 MCP2515 CAN SPI commands                              
'===============================================================================
'
CAN_RST          CON    $C0
MCPWRT           CON    $02

'===============================================================================
'                    SOFTWARE VARIABLES and ALIASES
'===============================================================================    

CS_1E2 var byte [4]        '0-3 Checksum Data Array for $1E2 CAN packet
CS_Count var byte          'Checksum Counter 0-3  

CAN_DATA VAR BYTE[3]       '0-2 CAN Data Array

CAN_LENGTH con 3           'CAN Length (0-3) = 4
CAN_ID_H con %00111100     '%00111100    '$1E2 CAN ID
CAN_ID_L con %01000000     '%01000000

CAN_COUNT VAR BYTE         'Data Loop Counter

'*******************************************************************************
'****************************** Main Program ***********************************
'*******************************************************************************

Start:                   'Main Program Start

    Clear              'Clear All Variables
   
    CS = 1             'Idle MCP2515 Control Line High
    SCK = 0            'Idle MCP2515 Clock Line Low

    '$1E2 Packet 20ms   All Good Data  
    CAN_DATA[0] = $50   'Load data into array
    CAN_DATA[1] = $55   'Load data into array
    CAN_DATA[2] = $F0   'Load data into array    
   
    '$1E2 Packet 20ms   Checksum Data
    CS_1E2[0] = $09     'Load data into array      
    CS_1E2[1] = $18     'Load data into array    
    CS_1E2[2] = $27     'Load data into array    
    CS_1E2[3] = $36     'Load data into array
   
    pause 10            'Wait for things to settle
   

'==============================================================================
'                   INITIALIZE MCP2515
'==============================================================================

    CS = 0                          'Start Comms with MCP2515
    SHIFTOUT SDO,SCK,1,[CAN_RST]    'Send Data
    CS = 1                          'Stop Comms                        
    pauseus 100                     'Pause 100us after reset for OSC Settle

    CS = 0                          'Start Comms with MCP2515
    SHIFTOUT SDO,SCK,1,[MCPWRT,$2F,$80] 'Send Data
    CS = 1                          'Stop Comms      
    pauseus 1

    CS = 0                          'Start Comms with MCP2515
    SHIFTOUT SDO,SCK,1,[MCPWRT,CNF3,$02,$90,$00]    'Send Data
    CS = 1                          'Stop Comms    
    pauseus 1

    CS = 0                          'Start Comms with MCP2515
    SHIFTOUT SDO,SCK,1,[MCPWRT,$2F,$00] 'Send Data
    CS = 1                          'Stop Comms  
    pauseus 1  

    CS = 0                        'Start Comms with MCP2515  
    SHIFTOUT SDO,SCK,1,[MCPWRT,TXB0SIDH,CAN_ID_H,CAN_ID_L,0,0,4] 'Send Data
    CS = 1                      'Stop Comms          
    pauseus 1
   
   
'******************************* Main Program Loop *****************************              


MainLoop:                'Start of Main Program Loop

'The first databyte register in the TX buffer is located right after the message
'length register so we can use the sequential write feature and just keep going
'with the actual data.      


    CS = 0                        'Start Comms with MCP2515
    SHIFTOUT SDO,SCK,1,[MCPWRT,TXB0D0] 'Send Data

    FOR CAN_COUNT = 0 to CAN_LENGTH     'Iterate thru the array and transfer
   
    if CAN_COUNT = 3 then               'Is it the last byte in the packet?
    SHIFTOUT SDO,SCK,1,[CS_1E2[CS_Count]] 'Send Data

    CS_Count = CS_Count + 1       'Increment byte counter
   
    If CS_Count = 4 then CS_Count = 0    'If 4 then reset to 0

    else
    SHIFTOUT SDO,SCK,1,[CAN_DATA[CAN_COUNT]] 'Send Data
       
    endif          
             
    NEXT CAN_COUNT              'Next byte
    CS = 1                        'Stop Comms
   
    pauseus 1

' Now the the message is sent.
   
    CS = 0                        'Start Comms with MCP2515
    SHIFTOUT SDO,SCK,1,[MCPWRT,TXB0CTRL,11] 'Send Data
    CS = 1                      'Stop Comms

    pause 19                    'Wait 19ms

    goto MainLoop               'Do it again

'*******************************************************************************
 

·
Registered
Joined
·
48 Posts
The other alternative is I send you a built unit.
What is your address in Pakistan?
Hey Thank you soo much for this peter. Really appreciate it. Im from Lahore, Pakistan but I dont actually need this device as I dont mind the IMA light as much and car is running perfectly fine with that. Im Just curious to see if others can also make it to work by themselves with the data available here, thats why doing it myself.

What PICS can you actually get easily/cheaply at the moment?
The most easiest way for me to get stuff here is AliExpress as I can use my debit card easily there. our bank payment system does not work anywhere else afaik. So im trying to go for AliExpress route for now. For that, Mostly PICs I found on AliExpress are all SOIC packages. few I found IN DIP package have I/P written next to their name. Any idea what this mean and if these will work?

Rectangle Electronic instrument Font Line Audio equipment


Pic16F1825

Circuit component Rectangle Font Electronic component Passive circuit component


Pic16F684

14 PIN
16F684
16F1825
Also I see a 16F684 in stock on one of our local websites too, talked to Vendor and he says he has it in stock.
I will go to his shop in few hours to see if he really has it and if I get it, I will let you know.
 

·
IMA Enthusiast
Joined
·
1,259 Posts
Discussion Starter · #53 · (Edited)
16F1825 code will not work in a 16F684.

However this new code attached should. ;) (Rename pdf to zip)
I have just adapted it for the 16F684.
It simulates correctly in 'Proteus' but I have not tested it on a physical chip.

Rectangle Font Parallel Screenshot Slope


You need PIC pins 8,9,10 (bottom three pins on the right hand side) for the signals to the CAN board.

Remember SDO out from the PIC goes to SDI in on the CAN board.

+5V power top left.
Gnd top right.


Code:
'**************************** Pic 16F684 Pinouts *******************************
'***** PIC 16F684  FLASH 2048 (words) SRAM 128 (bytes) EEPROM 256 (bytes) ******
'
'                                    Top
'                                  ___^___
'                       +Vdd 5V -01|  1  |14- Gnd/Vss               
'                  Spare Out A5 -02|  6  |13- A0 Out Spare + IcspDat (PGD)
'                  Spare Out A4 -03|  F  |12- A1 Out Spare + IcspClk (PGC)
'                  (Mclr) In A3 -04|  6  |11- A2 Out Spare
'                  Spare Out C5 -05|  8  |10- C0 Out (CS Control to MCP2515)
'                  Spare Out C4 -06|  4  |09- C1 Out (SCK Clock to MCP2515)
'                  Spare Out C3 -07|     |08- C2 Out (SDO Data to MCP2515)
'                                   -----

Good luck!
 

Attachments

·
Registered
Joined
·
48 Posts
Remember SDO out from the PIC goes to SDI in on the CAN board.
Hey @PeterPerkins , I recieved my MCP2515 CAN Board today. Earlier I was able to copy the HEX Code onto the PIC16F684 successfully and I am now goin to make the connections on the Veru Board. Im Just a bit confused about this SDO to SDI pin. (SDI is not written on any pin on the CAN Board). Can you please translate which PIN is SDI on CAN Board (SO or SI)?

Pin 10 RC0 >>>>>> CS
Pin 9 RC1 >>>>>> SCK
Pin 8 RC2 >>>>>>> ??

Does this chart looks Right to you for final connections?
Rectangle Slope Parallel Font Schematic
 

·
IMA Enthusiast
Joined
·
1,259 Posts
Discussion Starter · #57 · (Edited)
SO = SDO = OUT
SI = SDI = IN

SDO from PIC goes to SDI (SI) on CAN board.
You need to change your connection.


You also have pins 1 and 14 labelled incorrectly.

Pin 1 is +5V = VCC or VDD
Pin14 is GND = VSS
 

·
Registered
Joined
·
48 Posts
SO = SDO = OUT
SI = SDI = IN

SDO from PIC goes to SDI (SI) on CAN board.
You need to change your connection
ah Right, got it. Thank you soo much,


You also have pins 1 and 14 labelled incorrectly.

Pin 1 is +5V = VCC or VDD
Pin14 is GND = VSS
Thanks for pointing this out too, I always confuse names for both of these terminals So I remember them as positive and negative in my mind 😋.but i ll fix it. Thank you 😊
 
41 - 58 of 58 Posts
Top