%META:TOPICINFO{author="blundar" date="1077237440" format="1.0" version="1.1"}%
The NEC UPD7004C is an ADC chip found in OBD0 MPFI ECUs.
Documentation on it was very hard to find. :)
This PDF talks about the UPD7004C on page 31-35. George found this PDF on a NEC ADC that is only 4 channel, but of the same family.
I emailed NEC and they got back to me within 10 hours!!! Talk about customer service! Download the uPD7004C datasheet here
l3st4rd says:
i got a description of the uPD7002. it has 3 internal registers(here 4000, 4001, 4002):
- 4000h is the control register
- 4001 and 4002 are the data registers.
a measure is started by sending one byte to the control register. it can operate in 8 and 12 bit mode. the control bits are:
- bit 0: } control bits for channel multiplexer
- bit 1: } 00 = channel 0, 01 = channel 1, 10 = channel 3...
- bit 2: no function (or possilby 3rd channel ctrl bit for 7004?)
- bit 3: 1 = 12bit mode, 0 = 8bit mode
- bit 4 to 7: no function
In practice, use of the chip is somewhat like what follows:
- the external interrupt 1 routine jumpes to 006Ch, where it reads the value from 4001h (A/D low byte).
- then it resets the A/D low byte by writing 0 to 4001h
- then it starts the next 8bit measure by sending 0 - 7 to 4000h(control register).
- the first seven times it takes the values from channel 0 to 6 and stores them at external ram 0000h - 0006h. *the next 8 times, it's called, it takes the value from channel 7 and stores it at external ram 0007h - 000Eh (this all assuming that internal mem 07Dh is a counter from 0 to 0Eh)
hope this helps,
daniel
Now that we have the datasheet, this can more definitively be settled.
Note to self: need to determine whether chip is being used in serial or parallel mode and make appropriate changes to the following table. Highly suspect parallel mode.
|function|short|pin|uPD7004C|pin|short|function
|Channel 4|CH4|1|uPD7004C|28|CH3|Channel 3
|Channel 5|CH5|2|uPD7004C|27|CH2|Channel 2
|Channel 6|CH4|3|uPD7004C|26|CH3|Channel 1
|Channel 7|CH5|4|uPD7004C|25|CH2|Channel 0
|Reference Voltage|VREF|5|uPD7004C|24|A.GND|Analog Ground
|Digital GND|D.GND|6|uPD7004C|23|A.VDD|Analog supply
| |DB7/SO|7|uPD7004C|22|_CS|Chip select
| DB6/SI | 8 | uPD7004C | 21 | _RD/SCI |
| |BD5/_SHIFT|9|uPD7004C|20|A0|control address input
| DB4/SCKO | 10 | uPD7004C | 19 | _WR/_STB |
| |DB3/SOEN|11|uPD7004C|18|MC|Mode select (high=parallel)
| |DB2/CODE|12|uPD7004C|17|CLK|Clock
| |DB1/DEV1|13|uPD7004C|16|EOC|End Of Converstion (Active low)
| |DB0/DEV0|14|uPD7004C|15|D.VDD|Digital Power suppply |