CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to support@ccsinfo.com

Can someone please explain CMOS Communication

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
iso9001



Joined: 02 Dec 2003
Posts: 262

View user's profile Send private message

Can someone please explain CMOS Communication
PostPosted: Mon Dec 06, 2004 3:49 am     Reply with quote

Question

Last edited by iso9001 on Thu Feb 03, 2005 4:10 pm; edited 1 time in total
asmallri



Joined: 12 Aug 2004
Posts: 1634
Location: Perth, Australia

View user's profile Send private message Send e-mail Visit poster's website

PostPosted: Mon Dec 06, 2004 5:27 am     Reply with quote

CMOS == complementary metal oxide semiconductor and is a standard technology used to built devices such as PIC microcontrollers. If you look at the datasheet for a PIC you will see it is built using CMOS logic. Prior to the common adoption of CMOS telechnology, the most widely used digital logic was TTL (transistor-transistor logic). The actual voltage level when an input was judged to transition from a logic zero level to a logic 1 level varied significantly between these technologies. Simplistically, with CMOS logic an input voltage of <50% of the supply voltage is interpretted as a logic 0 and an input voltage of >50% of the supply voltage is interpretted as a logic 1. In the early days of CMOS logic at lot of effort was made to make CMOS devices that accepted (correctly interpreted) TTL input levels. A CMOS input is VERY HIGH impedance and as such a CMOS input presents virtually no load to a device driving it.

The MC33990 data sheets' reference to "interfaces directly to a 5V cmos microcontroller" means that no level conversion is required and the switching thresholds would be at approximately 2.5 volts as discussed above.

Quote:

How do I send data to it? (Timings and whatnot)


Now that's a funny question to be asking. It's like saying I have decided to buy a calculator. How do I know when to use it?
_________________
Regards, Andrew

http://www.brushelectronics.com/software
Home of Ethernet, SD card and Encrypted Serial Bootloaders for PICs!!
Mark



Joined: 07 Sep 2003
Posts: 2838
Location: Atlanta, GA

View user's profile Send private message Send e-mail

PostPosted: Mon Dec 06, 2004 7:16 am     Reply with quote

Quote:
How do I send data to it? (Timings and whatnot)


That's what the datasheet is for.
rwyoung



Joined: 12 Nov 2003
Posts: 563
Location: Lawrence, KS USA

View user's profile Send private message Send e-mail

Re: Can someone please explain CMOS Communication
PostPosted: Mon Dec 06, 2004 9:06 am     Reply with quote

iso9001 wrote:
Hello,

I'm thinking about using this a transeiver (MC33990) for a project I have coming up. It has a tx and rx pin and says it "interfaces directly to a 5V cmos microcontroller".

What the does that mean ?

How do I send data to it? (Timings and whatnot)
What am I looking for on the rx pin ?

This would be a lot easier w/ a clock pin.

Thanks in advance


Ok, before you get beat up too badly for this one, I have to ask why you want to use this part? Did you pick it yourself or was it thrust upon you? If you picked it yourself, why did you pick it, that is to ask, what is your ultimate goal.

If it was thrust upon you, maybe you need to ask for clarification.

This is a device for comunicating on the SAE J-1850 bus. It is a 1-wire bus. The TX pin is receiving data from the MICRO and trying to shove it out onto the bus wire. The RX pin is taking data from the bus and presenting it to the microcontroller. The RX and TX pins are "self-clocked" like good old RS232 data would be. However don't expect the UART in the PIC to be a zero-thought solution to the problem.

Motorola/Freescale is generally pretty good about having application notes for their parts. However in this case it looks a little sparse so I'd suggest you google around some more for information on both the chip and the J-1850 bus and its protocols.
_________________
Rob Young
The Screw-Up Fairy may just visit you but he has crashed on my couch for the last month!
iso9001



Joined: 02 Dec 2003
Posts: 262

View user's profile Send private message

PostPosted: Mon Dec 06, 2004 2:37 pm     Reply with quote

Ok. I understand the 5V and 2.5V deal. And I'm guessing that the UART built in can determine if its 2.5V cause ADC is not going to be fast enough here.

And no. Asking about timing is not a funny question. Since I cant find it in the data sheet, Its a GOOD question.

To get this interface to send out a 1, would I just output 5V to it and then let it determine if it needs to be active or passive, or must I determine this and then even if I want a 1 on the bus, output a logical 0 for a short pulse (that means 1 on the bus)

The datasheet IS sparse and the parts that are there kinda confused me since I was missing some basic info like the subject of the original post. I'll reread it now.

So... replies like: 'Thats what the datasheet is for' just really waste bandwidth, if you havn't looked at the sheet to see the answer isnt there or at least may be hiding.

If its just send in binary data then I'de assume there would need to be a buffer inside this thing to properly time the data going onto the bus. And at the same time, if all this thing is doing is conditioning the line for me, and the rx is in the same bit timing as the bus, then this really does me no good since I have already done that it hardware along using a push-pull transistor setup


Last edited by iso9001 on Thu Feb 03, 2005 4:16 pm; edited 1 time in total
Mark



Joined: 07 Sep 2003
Posts: 2838
Location: Atlanta, GA

View user's profile Send private message Send e-mail

PostPosted: Mon Dec 06, 2004 3:07 pm     Reply with quote

Quote:
And no. Asking about timing is not a funny question. Since I cant find it in the data sheet, Its a GOOD question.

and
Quote:
So... replies like: 'Thats what the datasheet is for' just really waste bandwidth,


Humm, now you say you looked at the datasheet but did you read it? I did a quick scan and found this.
Quote:

Receiver Protocol
The Class B communication scheme uses a variable pulse
width (VPW) protocol. The microcontroller provides the VPW
decoding function. Once the receiver detects a transition on Rx,
it starts an internal counter. The initial “start of frame” bit is a
logic [1] and lasts 200 µs. For subsequent bits, if there is a bus
transition before 96 µs, one logic state is inferred. If there is a
bus transition after 96 µs, the other logic state is inferred. The
“end of data” bit is a logic [0] and lasts 200 µs. If there is no
activity on the bus for 280 µs to 320 µs following a broadcast
message, multiple unit nodes may arbitrate for control of the
next message. During an arbitration, after the “start of frame” bit
has been transmitted, the secondary node transmitting the
most consecutive logic [0] bits will be granted sole transmission
access to the bus for that message.


You really need to read the datasheet. Its not our fault you can't understand it. Now about that waste of bandwidth you were talking about. It seems that if you were to actually read and understand the datasheet, you wouldn't be asking questions that can be found in there. Now if you haven't figured it out yet, the UART on the pic ain't going to do you a bit of good as rwyoung has told you.
Quote:
However don't expect the UART in the PIC to be a zero-thought solution to the problem.


Quote:
Ok. I understand the 5V and 2.5V deal. And I'm guessing that the UART built in can determine if its 2.5V cause ADC is not going to be fast enough here.
From this statement, I don't think you really do understand. From the datasheet:
Quote:
The 33990 operates directly from a vehicle's
12 V battery system and functions in a logic fashion as an I/O interface
between the microcontroller's 5.0 V CMOS logic level swings and the required
0 V to 7.0 V waveshaped signal swings of the bus.


The chip converts the signal to something the micro can read. From the datasheet:
Quote:

Rx Output Voltage Low
VBUS = 0 V, IRx = 1.6 mA
VRx(LOW)
min=0.01 typ=0.18 max=0.4V

Rx Output Voltage High
VBUS = 7.0 V, IRx = -200 µA
VRx(HIGH)
min=4.25 typ=4.48 max=4.75V


So your micro should see 4.48V or 4.25V at a minimum.

Quote:
If its just send in binary data then I'de assume there would need to be a buffer inside this thing to properly time the data going onto the bus. And at the same time, if all this thing is doing is conditioning the line for me, and the rx is in the same bit timing as the bus, then this really does me no good since I have already done that it hardware along using a push-pull transistor setup

Read the datasheet Razz It will do you know good.
rwyoung



Joined: 12 Nov 2003
Posts: 563
Location: Lawrence, KS USA

View user's profile Send private message Send e-mail

PostPosted: Mon Dec 06, 2004 3:59 pm     Reply with quote

iso9001 wrote:
If its just send in binary data then I'de assume there would need to be a buffer inside this thing to properly time the data going onto the bus. And at the same time, if all this thing is doing is conditioning the line for me, and the rx is in the same bit timing as the bus, then this really does me no good since I have already done that it hardware along using a push-pull transistor setup


Bingo! The moto chip is just doing the signal conditioning for you. The microcontroller is in charge of generating the PWM stuff. The chip is a fancier version of the push-pull transistor setup you have made for yourself. There look to be some bells and whistles for protecting the microcontroller from transients on the J1850 bus. And also some good stuff for helping keep the line impedance correct.

If it was me, I'd attach the RX pin to B0 as an interrupt and use B1 as the TX pin (I'm assuming the PIC16F877A here so adjust for yourself). You could also try using the CCP1 capture pin(s), especially for the RX pin. But I think an interrupt service routine that can reprogram its interrupt polarity would be fast enough for this bus. First time catch the rising edge then just before leaving the ISR set up to catch the next falling edge, etc.

A quick google of J1850 gave me this link and the Intel white paper looks very much like the last piece of information you may need:

http://www.intel.com/design/intarch/papers/j1850_wp.htm

Looks like you will also be responsible for handling bus contentions if you are going to be a "node" on the J1850 bus.
_________________
Rob Young
The Screw-Up Fairy may just visit you but he has crashed on my couch for the last month!
iso9001



Joined: 02 Dec 2003
Posts: 262

View user's profile Send private message

PostPosted: Mon Dec 06, 2004 4:07 pm     Reply with quote

Yea, I reread and I see that all this thing is doing is taking my 5V or 0V signal and conditioning it to what hte bus wants to see. I still need to do all the protocol work.

This ic is just to provide a link to the physical layer. Crap.

What I'm looking for is a J-1850 protocol IC. I could care less about this physical layer crap since I already worked it out in hardware myself.

The only ones I can find are built into other microcontrolers (motorolla series)

I guess I can continue to work in PIC if I create my own protocol implementation (which I half have now) the problem is reading signals in. I had horrible luck using ccp to capture pulse timing. I think it was because of the wave shaped pulses that come off the bus. It always reported erratic timings. Perhaps the output from thisdevice will be cleaner and I can measure pulses more effectivly ???


Last edited by iso9001 on Thu Feb 03, 2005 4:43 pm; edited 1 time in total
Mark



Joined: 07 Sep 2003
Posts: 2838
Location: Atlanta, GA

View user's profile Send private message Send e-mail

PostPosted: Mon Dec 06, 2004 4:14 pm     Reply with quote

Quote:
What I'm looking for is a J-1850 protocol IC. I could care less about this physical layer crap since I already worked it out in hardware myself.


Make one out of a pic and sell it Very Happy
iso9001



Joined: 02 Dec 2003
Posts: 262

View user's profile Send private message

PostPosted: Mon Dec 06, 2004 4:34 pm     Reply with quote

ELM already beat me to it.

Besides, that sounds like work. I do this for fun, If i wanted more work... I guess I'de work more.


I'm just sumpted since I find it crazy that no one has a J-1850 controller for use with any SPI/I2C/etc interface. How could no one have a need for that ?
rwyoung



Joined: 12 Nov 2003
Posts: 563
Location: Lawrence, KS USA

View user's profile Send private message Send e-mail

PostPosted: Mon Dec 06, 2004 5:20 pm     Reply with quote

iso9001 wrote:
ELM already beat me to it.

Besides, that sounds like work. I do this for fun, If i wanted more work... I guess I'de work more.


I'm just sumpted since I find it crazy that no one has a J-1850 controller for use with any SPI/I2C/etc interface. How could no one have a need for that ?


Perhaps these parts?

http://www2.okisemi.com/us/docs/ConnectivityICTables-1.html
_________________
Rob Young
The Screw-Up Fairy may just visit you but he has crashed on my couch for the last month!
Mark



Joined: 07 Sep 2003
Posts: 2838
Location: Atlanta, GA

View user's profile Send private message Send e-mail

PostPosted: Mon Dec 06, 2004 5:49 pm     Reply with quote

Here's another one

http://delphi.com/pdf/d/mic_dlc.pdf

and some general information
http://www.freescale.com/files/microcontrollers/doc/app_note/AN1731.pdf
http://www.avt-hq.com/devices.htm
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group