Unoffical empeg BBS

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

Topic Options
#90220 - 25/04/2002 03:17 Custom serial port baud rate
Shonky
pooh-bah

Registered: 12/01/2002
Posts: 2009
Loc: Brisbane, Australia
Can someone tell me how and where to set a custom baud rate in the kernel - there are so many references to baud rates etc in the source. Or should I be able to set a custom rate without kernel mods? It seems that either the player software or the kernel is ignoring my car_rate= line in config.ini.

I need to set a rate of around 1500 baud to talk to my Alpine CD changer.
_________________________
Christian
#40104192 120Gb (no longer in my E36 M3, won't fit the E46 M3)

Top
#90221 - 25/04/2002 13:37 Re: Custom serial port baud rate [Re: Shonky]
wfaulk
carpal tunnel

Registered: 25/12/2000
Posts: 16706
Loc: Raleigh, NC US
It might be that you're using 1500 as the value. I looked at this before, and I remember some references to specific bitrates in the serial driver. Try setting it to 1200 and see if it works then. (I realize that this might not solve your problem, but it might at least explain why it's not working.)
_________________________
Bitt Faulk

Top
#90222 - 25/04/2002 17:03 Re: Custom serial port baud rate [Re: wfaulk]
Shonky
pooh-bah

Registered: 12/01/2002
Posts: 2009
Loc: Brisbane, Australia
Hmmm.... Well I have hacked the kernel so that when I set a rate of 2400 in my application it actually sets it to 1500 in serial_sa1100.c. i.e. I'm not relying on config.ini at all anymore.

It seems to work in the sense that my PC at 1500 baud gets the data correctly, but the changer doesn't understand it whereas the changer understands the PC fine. I need to put it on a DSO and see if there's something obvious. I'm pretty sure I have it at 8N1 correctly etc.
_________________________
Christian
#40104192 120Gb (no longer in my E36 M3, won't fit the E46 M3)

Top
#90223 - 25/04/2002 17:09 Re: Custom serial port baud rate [Re: Shonky]
tfabris
carpal tunnel

Registered: 20/12/1999
Posts: 31600
Loc: Seattle, WA
Flow control maybe?
_________________________
Tony Fabris

Top
#90224 - 25/04/2002 17:27 Re: Custom serial port baud rate [Re: tfabris]
Shonky
pooh-bah

Registered: 12/01/2002
Posts: 2009
Loc: Brisbane, Australia
Don't think so. I have code to turn it off and my PC is receiving it OK with no flow control.
_________________________
Christian
#40104192 120Gb (no longer in my E36 M3, won't fit the E46 M3)

Top
#90225 - 26/04/2002 05:39 Re: Custom serial port baud rate [Re: Shonky]
TommyE
enthusiast

Registered: 08/06/1999
Posts: 356
Loc: NORWAY
Hmm, does the Alpine have a standard RS232 port??

If so, cool.

TommyE

Top
#90226 - 26/04/2002 13:40 Re: Custom serial port baud rate [Re: TommyE]
snoopstah
enthusiast

Registered: 07/01/2002
Posts: 339
Loc: Squamish, BC
I imagine not, otherwise he wouldn't need a custom baud rate (1200 and 2400 are 'standard' serial speeds). But pretty much anything *can* be controlled by serial if you're prepared to put time and effort into it.
_________________________
Empeg Mk2a 128G with amber lit buttons kit - #30102490

PhotoVancouver | Squamish, BC Webcam | Personal Website

Top
#90227 - 27/04/2002 20:12 Re: Custom serial port baud rate [Re: TommyE]
Shonky
pooh-bah

Registered: 12/01/2002
Posts: 2009
Loc: Brisbane, Australia
Definitely not standard RS232 or even standard serial really. It's a single wire open collector type data line. Also it's technically not even 1500 baud really. It sends 0s and 1s by different length on and off pulses. It just so happens that you can 'shonk' the same effect by talking at roughly 1500 baud and sending some special characters. For each 4 bits of data I actually send two bytes (ie 16 bits) of 1500 baud 8N1 data.
_________________________
Christian
#40104192 120Gb (no longer in my E36 M3, won't fit the E46 M3)

Top
#90228 - 27/04/2002 21:26 Re: Custom serial port baud rate [Re: Shonky]
Shonky
pooh-bah

Registered: 12/01/2002
Posts: 2009
Loc: Brisbane, Australia
OK well I seem to have the baud rate problem kludged with my kernel hack. Now can someone tell me what I should do to access the serial port? Do I have to disable the player software or something else so that the kernel messages etc go somewhere else.

What are others doing who are using the serial port?

The problem I have is that since the system is 1 wire, everything that you send you also immediately receive back. So I send some data get it echoed back by the 1 wire system, then the kernel/player echoes it back to the port which then echoes back via the 1 wire system. A vicious circle follows....


Edited by Shonky (27/04/2002 22:12)
_________________________
Christian
#40104192 120Gb (no longer in my E36 M3, won't fit the E46 M3)

Top
#90229 - 30/04/2002 01:46 Re: Custom serial port baud rate [Re: Shonky]
altman
carpal tunnel

Registered: 19/05/1999
Posts: 3457
Loc: Palo Alto, CA
Run the player with -s- to turn off the serial port.

If you're getting echo, you need to put the fd into raw mode - see cfmakeraw() and friends.

Hugo

Top