Page 22 of 35 FirstFirst ... 12171819202122232425262732 ... LastLast
Results 316 to 330 of 511

Thread: Corvette CCM Reverse Engineering Anyone?

  1. #316
    Fuel Injected!
    Join Date
    Mar 2013
    Posts
    1,469
    Something I have been waiting for a long time. Definitely will build a test rig and get the opportunity of blackbox logging.

    Some help on the setup will be highly appreciated. I am in no hurry, a good winter project.

  2. #317
    Fuel Injected!
    Join Date
    Jul 2019
    Location
    Orange, CA
    Posts
    757
    Quote Originally Posted by spfautsch View Post
    So here's an arduino sketch (mega 2560 minimum required due to 2+ hardware serial ports) to log to an SD card in a Y-body. Representative logfiles included. As with my previous example sketch, this is a minimalist, down-and-dirty representation of functionality. I will probably not post a lot more about it unless there are users with interest, but wanted to put it up for the possible benefit of NomakeWan. At the very least it will demonstrate how to use a hardware timer / counter (timer 3 on the mega) to implement a delay between ALDL receive and microcontroller transmit.
    Just to make sure I know what's going on here, you have this line:

    Code:
    #define TCNT3_TICKS 28    // 62.5us each 24 = 1.5ms
    ...
    OCR3A = TCNT3_TICKS;   // set timer0 compare match register A
    ...
    TCCR3B = (1 << WGM32) | (1 << CS32) | (1 << CS30);
    If I'm understanding this correctly, isn't this actually 64 microseconds per tick, thus making 28 ticks 1.792 milliseconds? Check my work.

    System Clock: 16000000 Hz
    TCCR3B = 16000000 / 1024 = 15625 Hz
    1 tick / 15625 Hz = 64 microseconds/tick
    64 microseconds * 28 ticks = 1.792 milliseconds

    Is there an errata or something I'm missing? As you know, I've not addressed timers before, so I want to be sure.
    1990 Corvette (Manual)
    1994 Corvette (Automatic)
    1995 Corvette (Manual)

  3. #318
    Fuel Injected! spfautsch's Avatar
    Join Date
    Apr 2015
    Location
    Montgomery City, MO
    Age
    52
    Posts
    883
    Quote Originally Posted by NomakeWan View Post
    isn't this actually 64 microseconds per tick, thus making 28 ticks 1.792 milliseconds? Check my work.

    System Clock: 16000000 Hz
    TCCR3B = 16000000 / 1024 = 15625 Hz
    1 tick / 15625 Hz = 64 microseconds/tick
    64 microseconds * 28 ticks = 1.792 milliseconds
    Your math is correct. The 62.5 us period comment was copied and pasted from an example I found somewhere, and I never bothered to verify even though I have a 1024 prescaler in the diy-ltcc code that is showing the correct time period.

    The 1.792 ms / 28 ticks may need more fine-tuning. I found that when the controller was writing to a file without echoing a bunch of debugging noise to the console, this value had to be increased. In other words the time involved in sending to the console was creating a delay that has to be accounted for in order to get the fastest acquisition rate. Sd card write latency is another factor (though much smaller).

    Quote Originally Posted by kur4o View Post
    Something I have been waiting for a long time. Definitely will build a test rig and get the opportunity of blackbox logging.

    Some help on the setup will be highly appreciated. I am in no hurry, a good winter project.
    I'm sure it could be adapted to work with the PCM as bus master, but I don't see myself having the ambition to take this to that level. I have a date this winter with a d/a, a crap-ton of sandpaper, primer, paint, etc. I'll probably put a page up on my wordpress site for it and link to it from my .sig. but that might be as far as that goes.

  4. #319
    Fuel Injected!
    Join Date
    Nov 2017
    Location
    Californiacation
    Age
    57
    Posts
    811
    Wakaeman is on the right track, just don't forget about transport delay since it's analog. It's a tough environment and GM did spend a bunch of time to make sure it is halfway reliable for the generation of 30 yrs ago.
    -Carl

  5. #320
    Fuel Injected!
    Join Date
    Jul 2019
    Location
    Orange, CA
    Posts
    757
    Quote Originally Posted by spfautsch View Post
    Your math is correct. The 62.5 us period comment was copied and pasted from an example I found somewhere, and I never bothered to verify even though I have a 1024 prescaler in the diy-ltcc code that is showing the correct time period.

    The 1.792 ms / 28 ticks may need more fine-tuning. I found that when the controller was writing to a file without echoing a bunch of debugging noise to the console, this value had to be increased. In other words the time involved in sending to the console was creating a delay that has to be accounted for in order to get the fastest acquisition rate. Sd card write latency is another factor (though much smaller).
    Okay, cool. Glad I had read it right. So why would something creating an additional, not-accounted-for delay require increasing the existing delay? That's the only thing I'm confused about. That said I'm using 2ms already in my own code so, hey, close enough. The GM spec sheet suggests the rise/fall time is only 20 microseconds, but without an oscilloscope I can't really confirm what's going on in reality-land. It would be interesting to see if using your timer ISR set to 1 tick would be sufficient when the code isn't doing anything else during transmission. Though as another note, even though their waveform diagram shows 20 microseconds, and their SXR (discrete IC) shows 20 microseconds, the diagram using a non-SXR circuit specifies a minimum of 108.1 microseconds and a maximum of 147.1 microseconds. It's not explained in the text where this discrepancy is coming from.

    Point being, while 2ms works fine, it's likely actually cutting into the error-related buffer period of the transmission rather than merely accounting for the inherent electrical delays associated with the ALDL bus design. At the moment my car has no electrical power since I'm doing work on the alternator and some other stuff, but once it's back together enough to fire up the CCM again, I'll do some more tests.

    Quote Originally Posted by In-Tech View Post
    Wakaeman is on the right track, just don't forget about transport delay since it's analog. It's a tough environment and GM did spend a bunch of time to make sure it is halfway reliable for the generation of 30 yrs ago.
    Yeah, and if we were using GM's IC, this problem would be taken care of for us. I have a very, very strong feeling that that IC is actually what Torqhead is salvaging from those PCMs they get as core charges for adding CCM integration. That's why they give you a $100 discount if you decide you don't want CCM integration at all, but toss in a core charge if you do. Because without CCM integration there's no need for that chip at all. With it, their solution is clearly relying on transmission tech from the time rather than creating their own discrete circuit. Perhaps they don't know as much about the bus as we now do.
    1990 Corvette (Manual)
    1994 Corvette (Automatic)
    1995 Corvette (Manual)

  6. #321
    Fuel Injected! spfautsch's Avatar
    Join Date
    Apr 2015
    Location
    Montgomery City, MO
    Age
    52
    Posts
    883
    Quote Originally Posted by NomakeWan View Post
    So why would something creating an additional, not-accounted-for delay require increasing the existing delay? That's the only thing I'm confused about.
    Not the existing delay - with the ALDL and debugging being echoed to the serial console as well as capturing and writing diy-ltcc debugging, I was able to maintain semi-reliable comms with a OCR3A value as low as 18 (1.152ms). I worked up to the current 28 / 1.78ms after a good bit of trial and error.

    Quote Originally Posted by NomakeWan View Post
    That said I'm using 2ms already in my own code so, hey, close enough.
    I was only sharing the timer code in case you wanted to be able to do something else in those 2ms. Your application can probably live without it. Mine needs to service the diy-ltcc logging on uart2 as well as writing to the sd card over spi.

    Quote Originally Posted by NomakeWan View Post
    It would be interesting to see if using your timer ISR set to 1 tick would be sufficient when the code isn't doing anything else during transmission. Though as another note, even though their waveform diagram shows 20 microseconds, and their SXR (discrete IC) shows 20 microseconds, the diagram using a non-SXR circuit specifies a minimum of 108.1 microseconds and a maximum of 147.1 microseconds. It's not explained in the text where this discrepancy is coming from.
    I can experiment, but I think there may be additional unpublished timing requirements for the protocol - this is definitely not just a matter of the electrical characteristics of the bus. Even with > 2.0ms transmit delay I'm still seeing intermittent reply message "lethargy" for lack of a better term. In what testing I've been able to do I've seen the PCM message timeout (at the time ~200ms) exceeded immediately after going into closed loop - the last message in the log is literally the only one with the BLM Learn bit set. I'm not sure I haven't formatted the SD and lost this one, but I'm sure it happened.

    I'll keep posting updates since it seems to be valuable info for you. Yesterday was mostly spent moving stuff to and setting up my storage unit. I did manage to add debug logging of the logger itself to a file, as well as timezone rules and a callback to the RTC so file timestamps are correct. Hopefully today will be more productive on the timing and reliability side.

    I mistakenly ordered the wrong solid state relay, waiting for the correct one from DigiKey so the power-on latch circuit can be completed and system will be ready for final debugging. The idea is to power the logger on from the courtesy lamp circuit as well as the switched ignition, and then let the arduino hold the same relay on with a digital pin and then shut itself off after it sees that the CCM has gone to sleep. This satisfies my other need which is feedback that the CCM has shut the hell up after a drive cycle instead of sitting and draining my battery.

  7. #322
    Fuel Injected!
    Join Date
    Jul 2019
    Location
    Orange, CA
    Posts
    757
    Oh, no no, don't take my reply the wrong way; I was in no way being critical of your code or suggesting that my method was better or anything like that. I was just noticing that I had a larger delay than your code already, so we were pretty close to one another in terms of the existing "settle" delay. Nothing more, nothing less.

    Anyway it definitely sounds like I need to buy myself a 'scope in 2022. It's really getting to the point where I can't go much further in researching these sorts of old cars without one. I'm working on another unrelated project for the GT-R related to solenoid feedback that is also going to need a 'scope anyway, so yeah, I'm way overdue. Hopefully that'll both help try to figure out what's going on with 8192 ALDL, and maybe even what's so different about the '94 Vette's "dirty" bus versus my '95s "clean" one. More than worth it.

    As for your latching relay thing, I was thinking of handling it without one. I mean with a latching relay you can go to completely 0 power draw, I agree, but the power draw of an Arduino-based chip in full sleep is what, 10 microamps or something? Why not just set an interrupt for the RX pin going from low to high to wake it, and have the Arduino just go into full smash sleep mode after a certain time of the CCM dropping offline?
    1990 Corvette (Manual)
    1994 Corvette (Automatic)
    1995 Corvette (Manual)

  8. #323
    Fuel Injected! spfautsch's Avatar
    Join Date
    Apr 2015
    Location
    Montgomery City, MO
    Age
    52
    Posts
    883
    Quote Originally Posted by NomakeWan View Post
    Oh, no no, don't take my reply the wrong way; I was in no way being critical of your code
    Not taken that way at all. Just making sure we're on the same page. I wanted to push the timing envelope while servicing other devices in the main loop and that required a hardware timer.

    Quote Originally Posted by NomakeWan View Post
    As for your latching relay thing, I was thinking of handling it without one. I mean with a latching relay you can go to completely 0 power draw, I agree, but the power draw of an Arduino-based chip in full sleep is what, 10 microamps or something? Why not just set an interrupt for the RX pin going from low to high to wake it
    Tried that and it does work. But the SD card in particular, the miscellaneous smc leds and the dual voltage regulators on the mega board draw a lot - 75ma in idle mode according to my best meter with all but uart1 (ALDL) turned off. Not worth designing my own board so I'll just flip the breaker after the CCM goes to sleep. It adds some code and component complexity but the last thing I need is to trade convenience for more parasitic draw on the battery.

    As always life happened today so didn't make as much progress as I'd hoped to. Still need to resolve an occasional CCM timeout after killing the ignition (and power to the PCM).

  9. #324
    Fuel Injected!
    Join Date
    Jul 2019
    Location
    Orange, CA
    Posts
    757
    Have you tried shutting down all the ADC registers before dropping into sleep? Apparently just using

    Code:
    ADCSRA = 0;
    reduces power consumption by three orders of magnitude. It'd be like Sketch J here: http://www.gammon.com.au/power

    Apparently that sketch on a bog standard Arduino draws only 0.15 microamps while sleeping, which is two orders of magnitude less than I thought. Should work on the Mega.
    1990 Corvette (Manual)
    1994 Corvette (Automatic)
    1995 Corvette (Manual)

  10. #325
    Fuel Injected! spfautsch's Avatar
    Join Date
    Apr 2015
    Location
    Montgomery City, MO
    Age
    52
    Posts
    883
    Nick's examples were done using a 328p on a custom board without voltage regulators, leds, peripherals, etc.

    The mega boards have two voltage regulators, one of which I believe is linear and therefor very inefficient. According to this [link] the lowest power consumption it's capable of while using the on-board regulators is ~27 ma. That's with the adc turned off and processor in PWR_SAVE mode. Meh. Add on the logger shield and sd card and it uses even more power.

    Was able to clean up a few issues and it looks like latching relay will work as planned with the possible exception of key in + key on after the CCM has gone to sleep. But I don't generally sit in the car with the door closed without the key in the ignition.

  11. #326
    Fuel Injected!
    Join Date
    Jul 2019
    Location
    Orange, CA
    Posts
    757
    Ah, fair enough. Guess it's yet another thing for me to experiment with on my own. I enjoy that though so, hey!

    It took me a second to figure out why "key-in+key-on after CCM sleeps" would be a problem, then I remembered that the logger was being triggered from the courtesy lights. Considering the use case for this device, I highly doubt that will be an issue. An errata to make sure to spell out in documentation, sure, but I think anyone who would have one of these left plugged in is going to get in and out of their car for drive cycles.
    1990 Corvette (Manual)
    1994 Corvette (Automatic)
    1995 Corvette (Manual)

  12. #327
    Fuel Injected! spfautsch's Avatar
    Join Date
    Apr 2015
    Location
    Montgomery City, MO
    Age
    52
    Posts
    883
    SSRs showed up a few days ago and I have the completed system ready to go in the car. The "joys" of x-mas shopping with the wife took up today but I hope to get on it tomorrow.

    What is this "documentation" you speak of? ;-).

  13. #328
    Fuel Injected! spfautsch's Avatar
    Join Date
    Apr 2015
    Location
    Montgomery City, MO
    Age
    52
    Posts
    883
    Here's a very, very rough beta release.

    aldl_logger-0.9.4

    Project page here [click].

    Discovered that the analog 5v regulator on the mega wasn't quite up to the task of powering all the uarts and leds while writing to SD with 14v input so added a 7805 and powered the 5v rail directly instead of the Arduino's VIN.

    The latching power relay seems to work as well as could be expected. The only high-priority change I anticipate adding is a long-term timer to shut power off to Arduino after no CCM / PCM / datastream sync. Currently it closes the open files on the SD after logging data has been written and the CCM has stopped broadcasting. Sometimes this is as short as 5-10 seconds after closing a door without key in ignition.

    This is a very roughly crafted beta release. Almost everything needs to be fine tuned, but it seems to work as intended. Writes PCM data from the ALDL to a .eedata file, diy-ltcc logging to a .log file, and it's own debugging information to a plaintext .dbg file.

    kur4o if you're interested in something like this for the F body keep it in memory. There are a lot of design decisions I made with this that hinge around the CCM being bus master and having to silence it and then seamlessly hand master back after the PCM goes to sleep. It's certainly possible to make loads of conditionals to handle the differences, but it also might make more sense to fork a different firmware.

  14. #329
    Electronic Ignition!
    Join Date
    Apr 2019
    Age
    57
    Posts
    15
    i know this thread has been dormant for a while, but after a couple years of lurking and learning on this forum i finally think i can contribute something.

    I bought a 94 Corvette in Jacksonville FL and drove it home to Canton MI with absolutely zero issues. Then, like you do after a trip like that, I pulled that car apart as a donor for my mid-engine '65 Corvair project. I kept the entire electrical system from the C4, including the CCM. If one of you could use it to further the R&D, i'd be happy to send it your way, for $free, and i'll even cover shipping. PM me if you could make use of it.

    Donor was automatic with 2.59 rear. I've got a pic of the options sticker if that would help.

    Regards,
    Patrick
    Last edited by AngryCorvair; 07-29-2022 at 10:27 PM. Reason: adding info

  15. #330
    Fuel Injected! spfautsch's Avatar
    Join Date
    Apr 2015
    Location
    Montgomery City, MO
    Age
    52
    Posts
    883
    GASP! You drove a perfectly functional '94 1000 miles only to take a sawzall to it?

    Sure, I'd be thrilled to have a CCM out of a '94 for an eeprom dump. You covering shipping is out of the question though. PM forthcoming. My wife is going to kill me.

    It's ironic this would pop up today. Yesterday afternoon I pulled my '95 out of the storage unit after sitting for a little over six weeks and drove it to work today so the battery would get a decent charge. In the 7 months since the last post here about the datalogger, I had to refer back to my notes b/c I'd completely forgotten how to turn it off so the SD card could be safely inserted.

Similar Threads

  1. car bogs down when switching into reverse/D
    By CAMMED LT1 in forum GM EFI Systems
    Replies: 4
    Last Post: 09-27-2021, 12:34 AM
  2. 12212156 code reverse engineering project in Ghidra
    By dzidaV8 in forum OBDII Tuning
    Replies: 8
    Last Post: 01-13-2020, 11:04 AM
  3. Help!! 93 Lt1 6M Reverse lockout
    By noeysuarez in forum GM EFI Systems
    Replies: 3
    Last Post: 09-14-2017, 08:17 AM
  4. 4l60e reverse boost valve location and procedure
    By JTodd in forum Introductions
    Replies: 1
    Last Post: 04-19-2013, 01:20 AM
  5. T56 reverse lockout options with TBI PCM
    By CDeeZ in forum GM EFI Systems
    Replies: 1
    Last Post: 02-26-2013, 05:06 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •