Mosi/miso I know what it stands for but not what it does. Any help???? Is this how the SPI data is routed? Or is that done some other way? A ref to how this works would be fine. :thumbsup: |
Yes, SPI and MOSI/MISO are interchange kind of things. It is basically just a clock and data signals. A simple three wire serial bus. The ALDL is a two wire serial bus that uses two different clocks. The SPI uses the same clock. You load data into an "SPI data reg" and then set a bit in the "SPI send cmd/data reg". The ECM MCU then sends out the data to the selected device which is usually the A/Ds or the discrete I/O device. The discrete I/O is used as a chip select for other devices. The best ref I know of is the 68HC11 datasheet from Motorola. The SPI regs listed in the standard 68HC11 differ from the ECM MCU register set....different bit positions and addresses. |
Originally posted by junkcltr The SPI regs listed in the standard 68HC11 differ from the ECM MCU register set....different bit positions and addresses. Still working on it. 1 bit of good news, I was just handed a full Motorola development kit that a coworker bought some years back. Between that and my simulation program I'm hoping I can get these worked out on the std unit and then figure how the ECM is doing it. I know they are relocated to $4000-$400F. The "K" series was the only one that supported PWM outputs, the ECM is more closely resembling an "F" series from what I've read. The routines are vastly different because of opcodes that were used in the "K"s. The K has control words in the $0060 range as well. |
Thanks J, Is the CS line the 3rd wire and data goes on it? Or is it simply a select this chip? Is the data sheet not in the pink book? The bits being moved is what threw me. I could handle the re address. Finally just looked at every read/write in the 8D till it hit on a few cylinders. Nothing like drawing a map to a place you've never been..... Using a foreign language. |
Originally posted by Z69 Thanks J, Is the CS line the 3rd wire and data goes on it? Or is it simply a select this chip? Is the data sheet not in the pink book? The bits being moved is what threw me. I could handle the re address. Finally just looked at every read/write in the 8D till it hit on a few cylinders. Nothing like drawing a map to a place you've never been..... Using a foreign language. CS means chip select (sometimes it's negative logic ie set to 0 to select, 1 to deselect). You can have a whole bunch of chip selects going to different chips. MOSI - Master Out Slave In MISO - Yummy Japanese soup :) Clock - for the timings MOSI is the output, MISO is the input. When a transfer is run, it always goes both ways even though there might not be any data to send in a certain direction. Here are some good links: http://www.totalphase.com/support/articles/article03/ http://cnx.****.edu/content/m11993/latest/ http://www.atmel.com/dyn/resources/p...ts/doc2582.pdf I tried to find you an example diagram that shows what the lines do during the transfer, but I didn't have any luck. |
No, the CS is not the third wire. The three wires are: SCK = serial clock SDI = serial data in SDO = serial data out. In the $58 code I am commenting I have a few places where it talks about the SPI stuff and what is going on like A/D reads, optical VSS setup, etc. Basically, you write a value at 0x4002 which does a chip select by controlling the MCU pins (this has nothing to do with the SPI). Then you fill the SPI reg 0x4000 with the data destined for the chip you just chip selected. Then you set the "send SPI data" bit (bit_7 referenced to zero) at 0x4001. The data is then sent to the SPI port and at the same time data is recieved in register 0x4000. Keep that in mind, when you transmit SPI data, you also receive SPI data at the same time. I might be able to show this more clearly with a snapshot of some of the commented $58 code doing this with pin numbers, device numbers, register numbers, etc. A complete example is usually easier to follow. Yeah, the non-standard reg/memory map is confusing. I had always planned on exploring it further....just never got around to it yet. I do not have a pink book and have never read one. I use the datasheet from Motorola I downloaded years ago. Something called 68HC11collateral.pdf or something like that. I also downloaded the instruction set pdf that gives the instruction CPU cycles & flag settings from the Motorola site. The Motorola docs are very good. J |
Thanks, Now I need to go figure out how $4003 is used. And the whole 3FFC reg still has us a little confused. Some of it's obvious. Some isn't. With the re-enforement you guys gave I'll see if more of it makes sense now. |
If you look at page 1 of Ludis' 730 schematic, you will see that the MCU has a bunch of pins on the left side. The way I see it is that the direction of the pins is set via reg 0x4003. The $8D code sets them all to '1' (all outputs). When you write to reg 0x4002, then that sets the value of each pin either high (1) or low (0). The 0x3FFC is a parallel bus thing (not SPI). Look at page one again and over on the right is chip U2. It has PWM3FCC, etc. stuff on it. The SES light is located at address 0x3FFC, bit_1. I haven't played with that stuff on the bench. I need to write a couple of little test code pieces to see which bit does what. |
From what I see in $8D, 3FFC b1 = SES ? (referenced somewhere I found) 3FFC b2 = A/C Clutch 3FFC b3 = SES LIGHT "E7" pin This is where the light IS wired to. 3FFC b4 = ??? 3FFC b5 = Alternating Fuel ? (maybe this is the "Out3 or 4" that switches the PWM 7 into action on Q2) don't find anything on the rest of that word except that the "init" sends a double word there. So 3FFC and 3FFD are being setup. ; Init CPU 0xFB12 = 1111 1011 0001 0010 (b3 OFF is change from the previous loading of the initialization value) I believe that is the "blink" on the SES when you first power up the ecm. Loading $FF into $4003 sets the direction of $4002 to output. |
A little example from the BBZB: Code: LC849: DEX ; decrement reg_x (reg_x--) |
All times are GMT -5. The time now is 07:51 AM. |
© 2024 MH Sub I, LLC dba Internet Brands