NE64 SERIAL COMM PORT (SCI)

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

NE64 SERIAL COMM PORT (SCI)

4,235 Views
Zircon
Contributor I
Hello.
 
My problem is with regard to the MC9S12NE64.
 
I need to receive/read from another device and transmit it other the ethernet to other NE64. The data has a width of 8-bits. Its PCM data from a SLIC. The SLIC pumps out this data at frequency of 256kHz.
I need to read this 8-bit data into the NE64. I tryed using the SCI (serial port, not spi) at the highest baud rate (1562500 baud, using PE).
 
I set the data width to 8bit but cant set the stop bit to 0. Is there any way i can set the stop bit to 0? Because, this stop bit messes up the data totally and i wont be able to send out 8bits back thru the ethernet to other SLIC.
 
Can you please show me a way to receive(or send) just 8bits (without parity or stop bits) using the SCI or even any other way?
 
Please advise. Most appreciated.
 
 
Labels (1)
0 Kudos
12 Replies

1,054 Views
nguyentien
Contributor II

Hi
I have a project similar
Im looking for a MCU/DSP have 5/6 UART,  4 PCM, 1 USB to interface with 4 GSM module and mother board
Can evryone suggest me a right MCU/DSP part?
Thanks

0 Kudos

1,054 Views
azhar_iiee
Contributor I
HI :
  i read your problem.i have same problem that i cant get proper PCM data from SI3210.can you tell how you fixed it
0 Kudos

1,054 Views
Lundin
Senior Contributor IV
You want 8 bits, no start/stop. You have a clock.
Why can't you use SPI then?
0 Kudos

1,054 Views
Zircon
Contributor I
 
Lundin,
 
I could use SPI but the problem is that i am already using the spi to control the slic and the NE64 only has one spi port.
 
any other suggestions?
 
Thanks
0 Kudos

1,054 Views
StephenRussell
Contributor I
There are two possibilities for using the SPI:
 
You could multiplex the two uses by using separate GPIO bits for selection.  As you probably don't need to do change anything when the SLIC part is streaming PCM data at you, this probably could be made to work.
 
The other possibility is to use GPIO pins and a "bit banging" program to operate the control SPI and dedicate the hardware SPI to reading the PCM stream.
 
 
0 Kudos

1,054 Views
Zircon
Contributor I
Steve Russell ,

Please have look at the two images found:
http://picasaweb.google.com/yeminah/PCM

The PCM data starts on the rising edge of the FSYNC (8kHz) and
ends on the falling edge of FSYNC. I am positive (rechecked in
datasheet) that the SLIC doenst allow any SPI interface for
the PCM part.

What do you suggest will be the best option out, considering the
limitations of the NE64. ?

Regards.
Zircon
0 Kudos

1,054 Views
bigmac
Specialist III
Hello,
 
It does appear that SPI could be used for the 8-bit PCM signal, with a few provisos.  I assume that the clock generator circuit also synchronously generates the the FSYNC signal, and that this is the "long" variant, as you seem to have indicated.
 
  1. Because the serial clock is generated externally, the SPI of the MCU would need to operate as a slave.
  2. The FSYNC signal would need to be inverted, to provide the active low /SS signal required by the SPI.
  3. With the clock rate used, each data transaction will take 25 percent of the total time - with a higher clock rate the percentage would be lower.  Prior to each FSYNC pulse, you would need to load the DRX byte to the SPI data register, and at the completion of FSYNC, you would read the DTX byte from the SLIC.  This is a case where you might consider using interrupts for the SPI.
The main difficulty with also sharing the SPI module for the control data, is that the SPI module would need to operate as a master in this instance.  Since this would likely involve external routing of the clock and /SS signals - an additional hardware complexity - the simplest arrangement is probably to "bit bang" the control SPI functions, as has been previously suggested by others.
 
Regards,
Mac
 
0 Kudos

1,054 Views
StephenRussell
Contributor I
Zircon,
 
Thanks for the further info.
 
I read the datasheet for the SLIC part, and was impressed by how little they said about the "PCM Highway".
 
I then searched the web, and found a 10 page application not from AMD:
titled "Mysteries of the PCM Highway"
 
Which tells a great deal about the "PCM Highway".
 
The "PCM Highway" is certainly not standard SPI or SCI.
 
It is clearly designed as a way of multiplexing many SLIC parts as part of a switching system.  The AMD applications seems to make sense with the SLIC datasheet.
 
It might be possible to fool the SPI interface into reading and writing one or more SLIC parts, but it won't be simple.  Since the clock comes from the SLIC electronics, the SPI interface on the MCU would have to be configured as a slave.  (I don't remember which devices and mask sets are involved, but some HCS-12 parts have confusing errata associated with SPI slave configuration.)
 
It would probably be simpler if you had some external hardware to translate from the PCM clock and FSYNC signal to SPI control signals. 
 
I don't understand how much freedom you have in configuring this system, but I'd suggest at least the extra hardware, and probably an MCU with 2 SPI interfaces, which won't cost much more.
 
I'd also see if there are less complicated SLIC chips available with friendlyier MCU interfaces.
 
Please tell us more about what your project requirements are.
 
 
0 Kudos

1,054 Views
Zircon
Contributor I
Steve Russell ,
 
Thanks for the indepth research.
 
See, I have to design a VoIP telephone system.

I have to design a VoIP telephone system. Basically interface (thru slic) a normal telephone with an data existing network. Therefore, users should be able to make normal telephone conversations using the data network.

Here is more info on the project:

I am using a microcontroller (MCU) from Freescale, which has a built-in Ethernet port capability to do the data processing and to send data over the Ethernet. I am also using a SLIC (Si3210 ProSLIC from Silabs) to interface with the telephone, this SLIC encodes the voice to PCM samples continuously (as long the the conversation is active). This PCM data has to be captured into the MCU (MC9S12NE64) and stored. I need to send this PCM data via the ethernet interface of the MC9S12NE64 using UDP.

I need to send this pcm data (caller) and receive the other pcm data (from the called party) simultaneously via the ethernet. Hence, enabling a full duplex conversation just like on a telephone line.

The IP address of the destination is dependent on the phone number which was dialled,- for demo purposes, i am just going to use one phone number, i.e. 1024 = 192.168.2.1 - this phone number is decoded from the telephone via the SLIC.  Therefore, when the user dials 1024, the mcu tells the SLIC to start coding the PCM, this coded pcm must be captured  and must be send over the ethernet (udp protocol). The called party's mcu must receive the udp (pcm) data and send it over to the slic to be decoded and later play it over the telephone. <SCRIPT></SCRIPT>

It would have to nice if the mcu i am currently using (NE64) had two SPI like you suggested, but i dont know if is wise buying another mcu now as i am nearing my deadline.

The other thing is that i am using the spi (the only) to contro the slic, i use it to continously check  if the phone is offhook or onhook.

You referred to hardware to get the data in PCM format, do you actually get in ICs that do that ? Any other of reading pcm data in perphaps?

Please advise

Regards

Zircon

0 Kudos

1,054 Views
StephenRussell
Contributor I
Zircon,
 
The Stop and Start bits are the way that serial communication port send timing and synchronizing information.  You can't have standard serial communication without them.
 
There are two problems which they solve:
 
One is indicating that a character is being sent.  The channel idles at asserted.  When the channel becomes de-asserted, that indicates that a character is starting (the start bit ).  The start bit and the data bits that follow it are sent at the specified baud rate.
 
The other is to allow for the fact that the clock on the sending end will not be quite the same frequency as the clock on the receiving end.  Sending a stop bit that is always de-asserted allows the receiver to check that is in synch with the transmitter, and gives time for the end with the slower clock time to catch up.
 
There are other ways to deal with these problems, but mechanical teleprinters started using this method in the early 1900's and in the 1960's the computer industry started using mechanical teleprinters as terminals because they were (relatively) reliable, inexpensive, and already able to work through a phone line.
 
Could you tell us more about this 256 KHz bit stream?
 
Can you get a 256 KHz clock signal from the source?
 
How are you supposed to synchronize your receiver with it?
 
 
0 Kudos

1,054 Views
Zircon
Contributor I
Steve Russell ,
 
Thanks for your reply. Here is more info on my project.--
 
I have to design  a VoIP telephone system. I am using  the NE64 and si3210 proSLIC from Silabs (are you familiar with this?). So, this SLIC digitizes the voices and pumps it out as PCM data at a rate of 256kHz. This the lowest rate that it can operate at.
 
Could you tell us more about this 256 KHz bit stream?
This is a 8-bit data stream at a rate of 256kHz.  I can also set the SLIC to output the data in a 16-bit stream.  
 
Can you get a 256 KHz clock signal from the source?
I am using a external clock circuit to provide the SLIC with 256kHz (PCLK). There is also another 8kHz (FYNC) clock provided to the SLIC by the same ext clock. So, yes I can get the clock from the source, if this is what you meant.
 
How are you supposed to synchronize your receiver (mcu) with it?
I am not really sure on how to do this. could you please suggest something.
 
If you need any more info, please mention,
 
Thanks
 
0 Kudos

1,054 Views
StephenRussell
Contributor I
Zircon,
 
It sounds like you could use the SPI interface. 
 
You could use the 256 KHz clock as the SPI clock.
 
There would still be a problem in synchronizing the bit steam with the 8 bit bytes in the PCM data stream.
 
If you just have a serial PCM bit stream with a clock, you don't have any clue as to where one sample ends and the next one begins.  This problem would be present for any user of the SLIC and is probably addressed in some detail of the SLIC part.
 
It sounds like the SLIC may have been designed for an SPI interface.  Look closely at the datasheet to see what clues the SLIC gives about where the byte boundaries are.  See if the SLIC manufacturer has any application notes on how to use the part.
 
 
0 Kudos