Unoffical empeg BBS

Quick Links: Empeg FAQ | RioCar.Org | Hijack | BigDisk Builder | jEmplode | emphatic
Repairs: Repairs

Topic Options
#236557 - 05/10/2004 07:16 serial port
mdavey
enthusiast

Registered: 06/03/2003
Posts: 269
Loc: Wellingborough, UK



Edited by mdavey (05/10/2004 10:13)
_________________________
Michael
Ex-owner of stolen empeg #030102741

Top
#236558 - 05/10/2004 09:41 Re: serial port [Re: mdavey]
mdavey
enthusiast

Registered: 06/03/2003
Posts: 269
Loc: Wellingborough, UK
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?
_________________________
Michael
Ex-owner of stolen empeg #030102741

Top
#236559 - 05/10/2004 13:49 Re: serial port [Re: mdavey]
mdavey
enthusiast

Registered: 06/03/2003
Posts: 269
Loc: Wellingborough, UK
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?
_________________________
Michael
Ex-owner of stolen empeg #030102741

Top
#236560 - 05/10/2004 15:04 Re: serial port [Re: mdavey]
tfabris
carpal tunnel

Registered: 20/12/1999
Posts: 31597
Loc: Seattle, WA
Quote:
Which lines do the ariel, headlight sense, amp and mute use?

All car docking sled wiring is described here.
_________________________
Tony Fabris

Top
#236561 - 05/10/2004 16:32 Re: serial port [Re: tfabris]
mdavey
enthusiast

Registered: 06/03/2003
Posts: 269
Loc: Wellingborough, UK
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?
_________________________
Michael
Ex-owner of stolen empeg #030102741

Top
#236562 - 05/10/2004 16:43 Re: serial port [Re: mdavey]
mtempsch
pooh-bah

Registered: 02/06/2000
Posts: 1996
Loc: Gothenburg, Sweden
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...
_________________________
/Michael

Top
#236563 - 05/10/2004 16:54 Re: serial port [Re: mtempsch]
mdavey
enthusiast

Registered: 06/03/2003
Posts: 269
Loc: Wellingborough, UK
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)?


Edited by mdavey (05/10/2004 16:59)

Top
#236564 - 06/10/2004 19:08 Re: serial port [Re: mdavey]
mdavey
enthusiast

Registered: 06/03/2003
Posts: 269
Loc: Wellingborough, UK
I need to...? Anyone? Anyone?
_________________________
Michael
Ex-owner of stolen empeg #030102741

Top
#236565 - 11/10/2004 10:26 Re: serial port [Re: mdavey]
mdavey
enthusiast

Registered: 06/03/2003
Posts: 269
Loc: Wellingborough, UK
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
_________________________
Michael
Ex-owner of stolen empeg #030102741

Top
#236566 - 11/10/2004 13:37 Re: serial port [Re: mdavey]
StigOE
addict

Registered: 27/10/2002
Posts: 568
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

Top
#236567 - 11/10/2004 14:41 Re: serial port [Re: StigOE]
mdavey
enthusiast

Registered: 06/03/2003
Posts: 269
Loc: Wellingborough, UK
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.


Edited by mdavey (11/10/2004 14:51)
_________________________
Michael
Ex-owner of stolen empeg #030102741

Top
#236568 - 09/12/2004 20:47 Re: serial port [Re: mdavey]
mdavey
enthusiast

Registered: 06/03/2003
Posts: 269
Loc: Wellingborough, UK
A little bit of housekeeping...

With help from RobS, we have
likely pinouts for the rear serial port
_________________________
Michael
Ex-owner of stolen empeg #030102741

Top