Page 3 of 3 FirstFirst 123
Results 31 to 35 of 35

Thread: Code: Learning Disassembly Assembly

  1. #31
    Super Moderator
    Join Date
    Mar 2011
    Location
    Camden, MI
    Age
    35
    Posts
    3,026
    with the P4 processors, there is one vector for internal interrupts. at the vector location, there are a few paths that the code can take, depending on what caused the interrupt. some of them are for ALDL (when the receive data register is full or the transmit data register is empty) or to update the SCI controlled outputs or to deal with the 160Hz timer. it would appear that when both 4007 and 4008 bit 0 are set, that indicates that the 160Hz timer caused the interrupt. so the code loads $CD to the A register and then adds the value of the timer at 4006 to it, and then stored to 4006. this timer is continuously incremented and when the timer runs up to the new value, an interrupt is generated. $CD is equivalent to a period of 0.006256103515625mS since the timer counts at a rate of 32,768Hz.

    the 160Hz timer is used mainly to determine which code to execute in the loops that exist. most P4s tend to have 1 or 2 loop tables and you'll see the timer pulled immediately before looking up which code section it jumps to. the value will have an AND operation done to it to create a value that could be anything from 0 to 160 to being 0 to whatever number of possibly code locations it will jump to.

    and your understanding of how the loops work is correct. it's kind of a neat system but if something doesn't make it all the way through the first time, pretty good chance of it not making it through the next time since it will be roughly the same processing time required(with variables being other interrupts).

    ignition and injection are dealt with when the external interrupt code runs. one of the possible external interrupts are the 3X(or 2X or 4X) reference pulse. injection is pretty simple with MPFI, since nothing really needs timed, just when an interrupt happens, inject for x time. i haven't looked for the section of code for it, but i assume that there is a section of code that indicates the number of reference pulses before another injection event takes place. there is also the possibility that the reference period is used to estimate the amount of time between injection events need to happen and then an interrupt is generated there. with ignition, timing is critical so there are more registers to deal with it. the code turns a crank angle into crank time, so when a ref pulse happens and the code knows that the pulse happens 60* before TDC(for example), it takes the desired spark advance, turns it into "how long before the spark needs to happen", then subtracts time out for the dwell period, then creates "how long until EST circuit needs to go high to start dwell" and "how long to dwell to make plugs fire when desired".

    with the P4, there are still a lot of unknowns. with the P6, being a standard part(68HC11F1) everything stated in the pink book is accurate.

    yes, there is some prioritization when it comes to interrupts, the pink book describes them, though only some will apply to a P4.

    what runs on an interrupt: the absolute bare minimum that will do the function the interrupt needs to do. when an interrupt is being serviced, other interrupts are disabled and it takes away from processing time that could be used to execute other code. fat interrupt code will cause problems.
    1995 Chevrolet Monte Carlo LS 3100 + 4T60E


  2. #32
    Fuel Injected!
    Join Date
    Sep 2012
    Posts
    23
    What is the GM HUD? Some sort of code debugging hardware that plugs into the card edge connector? I see that $5000-$6fff and $0400-04ff addresses are for the HUD, if the HUD is not plugged in are these addresses usable? I seem to remember something about any write to a certain address space will cause a reset but can't remember the range.

    I also seem to remember that the 3x3 grid used for the BLM cells are stored by battery backed RAM. Where are these in the address space, is some RAM battery backed and others not? I could just be remembering all of this wrong too.

    Quote Originally Posted by RobertISaar View Post
    what runs on an interrupt: the absolute bare minimum that will do the function the interrupt needs to do. when an interrupt is being serviced, other interrupts are disabled and it takes away from processing time that could be used to execute other code. fat interrupt code will cause problems.
    That makes sense.
    Last edited by brian89gp; 08-22-2013 at 08:22 PM.

  3. #33
    Super Moderator
    Join Date
    Mar 2011
    Location
    Camden, MI
    Age
    35
    Posts
    3,026
    GM HUD = connected to edgecard connector, code tends to write a lot of values to it that would be useful to view while doing the initial calibration to a vehicle.

    5000-5FFF is HUD ROM, 400-4FF is HUD RAM.

    read OR write to the 6000-6FFF area will cause a reset, IIRC. i need to test this though. i was planning on using the area for basically "scratch" space to allow anything to be written in it that isn;t necessarily needed by the processor to operate the vehicle(like revision info, etc).

    if the HUD isn't plugged in and you have RAM or ROM mapped to the area, you can use it however you want.

    BLM cells..... depends. some only have a total of 3, while others are 16 or 16X2(CCP and non-CCP) or anything in between. i would ASSUME they would all be stored in the battery backed RAM, all of them that i have looked at seem to be.

    in a typical P4, 00-FF is battery backed and 100-1FF is not. however, there are special P4s out there, ones that map RAM all the way out to 3FF, those MIGHT have more battery backed RAM. there could be more P4s too. i seem to remember the 4.5/4.9 cadillacs having some out of the ordinary hardware.
    1995 Chevrolet Monte Carlo LS 3100 + 4T60E


  4. #34
    Fuel Injected!
    Join Date
    Sep 2012
    Posts
    23
    P4 vs P6? 8 vs 16 bit?

  5. #35
    Super Moderator
    Join Date
    Mar 2011
    Location
    Camden, MI
    Age
    35
    Posts
    3,026
    they're both 8 bit.

    in terms of guesswork, a lot less is needed with a P6.
    1995 Chevrolet Monte Carlo LS 3100 + 4T60E


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
  •