serial port

Posted by: mdavey

serial port - 05/10/2004 07:16


Posted by: mdavey

Re: serial port - 05/10/2004 09:41

The answer was EmpTelnetd from Trevors' web site. Those who never saw the question will just have to guess what it was!

Hopefully my follow up question won't be so silly. I'm trying to make the DTR line high on the main Empeg serial port. I'm using this code:

Code:

if ((serial = open("/dev/ttyS1", O_RDWR | O_NOCTTY | O_NDELAY))<0) return -1;
ioctl(serial, TIOCMGET, &arg);
arg |= (TIOCM_DTR | TIOCM_RTS);
ioctl(serial, TIOCMSET, &arg);



The second ioctl returns error code -1 and sets errno to EINVAL (22 - Invalid Argument). The Empeg is in DC mode and I have selected "Apps Use Serial Port" in Hijack. When I telnet to the Empeg and restart the player, it says it is started with option "-s-". What am I missing?
Posted by: mdavey

Re: serial port - 05/10/2004 13:49

Hmm,

Could it be to do with this FAQ entry? Which lines do the ariel, headlight sense, amp and mute use?

If this is the case, does ttyS0 or ttyS2 have a DTR line burried inside the Empeg somewhere (I think not), or can I tickle some other pin somewhere in the Empeg that would (or could) cause the Empeg to fire a software interrupt every time the line status changes?
Posted by: tfabris

Re: serial port - 05/10/2004 15:04

Quote:
Which lines do the ariel, headlight sense, amp and mute use?

All car docking sled wiring is described here.
Posted by: mdavey

Re: serial port - 05/10/2004 16:32

Okay, a few more questions:

1. Is the amp line connected to DTR. I see it is connected to pin 4 on the serial, but does the Kernel think it is DTR?

2. Is the amp line high or low when the amp is powered up? ISTR it is low when powered up and high when off.

3. I am guessing that the Kernel considers switching these lines as its responsibility, that is why it is returning EINVAL. Correct?
Posted by: mtempsch

Re: serial port - 05/10/2004 16:43

With the empegs display on (ie amp should be turned on), the amp remote line is +12V. With the display off the line is 0V. Don't recall what logic the serial port status lines use...
Posted by: mdavey

Re: serial port - 05/10/2004 16:54

Okay, so I can't use any of the standard serial ports for my needs as ttyS0 and ttyS2 don't have any control signals (only TD and RD) and ttyS1's control singals are all in use for other things when in DC mode.

I notice that there is "tuner level" and "tuner signal" on pins 4 and 3 of the sled connector (pins 1 and 2 of the tuner connector) respectively.

Are these both inputs to the Empeg and is it possible to read either of these using ioctl? If so, what would the code look like (as in, what is the name of the device and what is the name of the request argument to ioctl)?
Posted by: mdavey

Re: serial port - 06/10/2004 19:08

I need to...? Anyone? Anyone?
Posted by: mdavey

Re: serial port - 11/10/2004 10:26

Okay,

I think that both tuner signal and tuner level go straight to the DSP, so no way to claim an IRQ on raising edge or falling edge on those pins.

Pin 4 of the serial connector on the back of the Empeg itself is momentarily high right at the beginning of the power up sequence, then falls to -5V and stays there.

The various pins (CTS - headlight sense, DCD - telephone mute, and ignition sense) can be read via GPLR. empeg_power.c shows how to do this.

Incedentally, it would appear that the RDS data is processed by the DSP and then made available to one of the GPIO pins - see empeg_rds.c

The source says that SerialDTR is GPIO23. I tried to make pin 4 of the serial connector on the back ot the Empeg go +5V by doing this: "GPSR=EMPEG_SERIALDTR" ...in hijack.c, just below the initialisation code for I2C fan. Didn't appear to have any effect. Also tried clearing the register (in case the output is inverted).

I can conclude that either GPIO23 isn't conencted to pin 4 or something else is changing it back again. I've grepped the source, but can't find anything that might be chaning it back. There was reference to both the debug LED and SIR (serial IR?) - so perhaps GPIO23 is used elsewhere and is not connected to pin4. If this is the case, what is raising pin4 at boot-up?

So, is there any way to:
a) set any of the pins on the on-board serial connector to +5V (or greater) in software
b) generate an interrupt on a raising or falling edge on either the tuner_level or tuner_signal line
Posted by: StigOE

Re: serial port - 11/10/2004 13:37

Quote:
Pin 4 of the serial connector on the back of the Empeg itself is momentarily high right at the beginning of the power up sequence, then falls to -5V and stays there.

It should go to +12V as that is the same as amplifier remote. I use it for powering a GPS receiver in the car (allthough I also hardwire-OR it with the ignition to power the GPS...).

Stig
Posted by: mdavey

Re: serial port - 11/10/2004 14:41

Quote:
It should go to +12V as that is the same as amplifier remote.


To clarify, this is a MK2a and I am talking about the serial port on the back of the Empeg, not the one on the sled. A quick probe with the multimeter shows:
a) Voltage between docking connector pins 2 and 13 reads 11.1V (this is on a 12V PSU)
b) Definitely no continuity between docking connector pin 2 and Empeg on-board serial connector pin 4 [edit:corrected] - which is what I would expect from other posts on this BBS.

I do only have one Empeg - it is entirely possible that my Empeg doesn't work the way it should - but much more likely it is just something I don't understand.
Posted by: mdavey

Re: serial port - 09/12/2004 20:47

A little bit of housekeeping...

With help from RobS, we have
likely pinouts for the rear serial port