Forums

Help with LPC2106

Started by shunt_2000 January 25, 2008
Hi,

I am a newbie to the board but I have tried my best to find the answer
to my question before posting for help.

I am using a QuickStart LPC2106 board with a 14.7456 crystal. I want
to be able to accept data from the PC on UART0 and command a PTZ
camera using UART1. UART0 is working just great. The camera requires
9600 bps and I am configuring PINSEL0 with the following code:

//initialize uart #1: 9600 baud, 8N1
initUart1(B9600((CRYSTAL_FREQUENCY * PLL_FACTOR) / VPBDIV_FACTOR),
UART_8N1, UART_FIFO_16);

I am sending two packets to zoom the camera in and out using P0.8 and
P0.9. I verified the code works from the PC using Rx, Tx, and ground.

If I hook UART1 up to Br@y's terminal application, I just get garbage.
UART0 is fine.

I would really appreciate any help with this. I am sure I am just
doing something stupid. I am trying to port the Sony VISCA interface
that I wrote for the PC side over to the LPC2106 and if anyone is
interested in it, I would be happy to post the code once I can get
past this.

Thanks,

Shawn

An Engineer's Guide to the LPC2100 Series

Hi

Need to see the more detailed code to help you

Regards

Jean-Jacques

--- In l..., "shunt_2000" wrote:
>
> Hi,
>
> I am a newbie to the board but I have tried my best to find the
answer
> to my question before posting for help.
>
> I am using a QuickStart LPC2106 board with a 14.7456 crystal. I
want
> to be able to accept data from the PC on UART0 and command a PTZ
> camera using UART1. UART0 is working just great. The camera
requires
> 9600 bps and I am configuring PINSEL0 with the following code:
>
> //initialize uart #1: 9600 baud, 8N1
> initUart1(B9600((CRYSTAL_FREQUENCY * PLL_FACTOR) / VPBDIV_FACTOR),
> UART_8N1, UART_FIFO_16);
>
> I am sending two packets to zoom the camera in and out using P0.8
and
> P0.9. I verified the code works from the PC using Rx, Tx, and
ground.
>
> If I hook UART1 up to Br@y's terminal application, I just get
garbage.
> UART0 is fine.
>
> I would really appreciate any help with this. I am sure I am just
> doing something stupid. I am trying to port the Sony VISCA
interface
> that I wrote for the PC side over to the LPC2106 and if anyone is
> interested in it, I would be happy to post the code once I can get
> past this.
>
> Thanks,
>
> Shawn
>
Thank you for the help.

I uploaded the relevant code to the Files section under "VISCA". It's
definitely not finished but where I was at last night when I stopped
was sending the four test packets to the camera (at the bottom of main.c)

The first packet sets the address of the camera, the second clears out
its memory, and the third and forth zoom in and out.

If I send these same packets with the same cable using only Rx, Tx,
and Ground hooked up from my COM port, it works fine.

--- In l..., "jdauchot" wrote:
>
> Hi
>
> Need to see the more detailed code to help you
>
> Regards
>
> Jean-Jacques
>
> --- In l..., "shunt_2000" wrote:
> >
> > Hi,
> >
> > I am a newbie to the board but I have tried my best to find the
> answer
> > to my question before posting for help.
> >
> > I am using a QuickStart LPC2106 board with a 14.7456 crystal. I
> want
> > to be able to accept data from the PC on UART0 and command a PTZ
> > camera using UART1. UART0 is working just great. The camera
> requires
> > 9600 bps and I am configuring PINSEL0 with the following code:
> >
> > //initialize uart #1: 9600 baud, 8N1
> > initUart1(B9600((CRYSTAL_FREQUENCY * PLL_FACTOR) / VPBDIV_FACTOR),
> > UART_8N1, UART_FIFO_16);
> >
> > I am sending two packets to zoom the camera in and out using P0.8
> and
> > P0.9. I verified the code works from the PC using Rx, Tx, and
> ground.
> >
> > If I hook UART1 up to Br@y's terminal application, I just get
> garbage.
> > UART0 is fine.
> >
> > I would really appreciate any help with this. I am sure I am just
> > doing something stupid. I am trying to port the Sony VISCA
> interface
> > that I wrote for the PC side over to the LPC2106 and if anyone is
> > interested in it, I would be happy to post the code once I can get
> > past this.
> >
> > Thanks,
> >
> > Shawn
>
Thank you for the responses.

The camera is EVI-D70. It can be controlled using RS-485 or RS-232.
I can plug the same cable I am using on the LPC2106 into D-SUB
connector and control it.

--- In l..., "roboticsbcn" wrote:
>
> Hi, you are using the apropiate driver? I think that the PTZ normaly
> are using RS485 protocol.
>
> --- In l..., "shunt_2000" wrote:
> >
> > Hi,
> >
> > I am a newbie to the board but I have tried my best to find the
> answer
> > to my question before posting for help.
> >
> > I am using a QuickStart LPC2106 board with a 14.7456 crystal. I
> want
> > to be able to accept data from the PC on UART0 and command a PTZ
> > camera using UART1. UART0 is working just great. The camera
> requires
> > 9600 bps and I am configuring PINSEL0 with the following code:
> >
> > //initialize uart #1: 9600 baud, 8N1
> > initUart1(B9600((CRYSTAL_FREQUENCY * PLL_FACTOR) / VPBDIV_FACTOR),
> > UART_8N1, UART_FIFO_16);
> >
> > I am sending two packets to zoom the camera in and out using P0.8
> and
> > P0.9. I verified the code works from the PC using Rx, Tx, and
> ground.
> >
> > If I hook UART1 up to Br@y's terminal application, I just get
> garbage.
> > UART0 is fine.
> >
> > I would really appreciate any help with this. I am sure I am just
> > doing something stupid. I am trying to port the Sony VISCA
> interface
> > that I wrote for the PC side over to the LPC2106 and if anyone is
> > interested in it, I would be happy to post the code once I can get
> > past this.
> >
> > Thanks,
> >
> > Shawn
>
Hummm, Cool
How much is this camera and do you have the protocol to comunicate with it?TCPIPCHIP
To: l...From: s...@gmail.comDate: Fri, 25 Jan 2008 13:08:25 +0000Subject: [lpc2000] Re: Help with LPC2106

Thank you for the responses.The camera is EVI-D70. It can be controlled using RS-485 or RS-232. I can plug the same cable I am using on the LPC2106 into D-SUBconnector and control it.--- In l..., "roboticsbcn" wrote:>> Hi, you are using the apropiate driver? I think that the PTZ normaly > are using RS485 protocol.> > > > --- In lpc2000, "shunt_2000" wrote:> >> > Hi,> > > > I am a newbie to the board but I have tried my best to find the > answer> > to my question before posting for help.> > > > I am using a QuickStart LPC2106 board with a 14.7456 crystal. I > want> > to be able to accept data from the PC on UART0 and command a PTZ> > camera using UART1. UART0 is working just great. The camera > requires> > 9600 bps and I am configuring PINSEL0 with the following code:> > > > //initialize uart #1: 9600 baud, 8N1> > initUart1(B9600((CRYSTAL_FREQUENCY * PLL_FACTOR) / VPBDIV_FACTOR),> > UART_8N1, UART_FIFO_16);> > > > I am sending two packets to zoom the camera in and out using P0.8 > and> > P0.9. I verified the code works from the PC using Rx, Tx, and > ground.> > > > If I hook UART1 up to Br@y's terminal application, I just get > garbage.> > UART0 is fine.> > > > I would really appreciate any help with this. I am sure I am just> > doing something stupid. I am trying to port the Sony VISCA > interface> > that I wrote for the PC side over to the LPC2106 and if anyone is> > interested in it, I would be happy to post the code once I can get> > past this.> > > > Thanks,> > > > Shawn> >>

_________________________________________________________________
Confira veos com notias do NY Times, gols direto do Lance, videocassetadas e muito mais no MSN Video!
http://video.msn.com/?mkt=pt-br





I am still getting garbage. I thought I was getting closer today but
I am not there yet. I think it has to do with how I am setting up the
registers in UART1 although UART0 is working fine at either 9600 or
115200.

Here is the function I am using to init UART1, it is identical to
UART0 except for the register names.

void
initUart1(unsigned short div_factor, unsigned char mode, unsigned char
fifo_mode)
{
volatile unsigned int temp;

//enable uart #1 pins in GPIO (P0.8 = TxD0, P0.9 = RxD0)
PINSEL0 = (PINSEL0 & 0xfff0ffff) | 0x00050000;

U1IER = 0x00;
temp = U1IIR;
temp = U1RBR;
temp = U1LSR;
U1LCR = 0x80;
U1DLL = (unsigned char)div_factor;
U1DLM = (unsigned char)(div_factor >> 8);
U1LCR = (mode & ~0x80);
U1FCR = fifo_mode;

}

--- In l..., "jdauchot" wrote:
>
> Hi
>
> Need to see the more detailed code to help you
>
> Regards
>
> Jean-Jacques
>
> --- In l..., "shunt_2000" wrote:
> >
> > Hi,
> >
> > I am a newbie to the board but I have tried my best to find the
> answer
> > to my question before posting for help.
> >
> > I am using a QuickStart LPC2106 board with a 14.7456 crystal. I
> want
> > to be able to accept data from the PC on UART0 and command a PTZ
> > camera using UART1. UART0 is working just great. The camera
> requires
> > 9600 bps and I am configuring PINSEL0 with the following code:
> >
> > //initialize uart #1: 9600 baud, 8N1
> > initUart1(B9600((CRYSTAL_FREQUENCY * PLL_FACTOR) / VPBDIV_FACTOR),
> > UART_8N1, UART_FIFO_16);
> >
> > I am sending two packets to zoom the camera in and out using P0.8
> and
> > P0.9. I verified the code works from the PC using Rx, Tx, and
> ground.
> >
> > If I hook UART1 up to Br@y's terminal application, I just get
> garbage.
> > UART0 is fine.
> >
> > I would really appreciate any help with this. I am sure I am just
> > doing something stupid. I am trying to port the Sony VISCA
> interface
> > that I wrote for the PC side over to the LPC2106 and if anyone is
> > interested in it, I would be happy to post the code once I can get
> > past this.
> >
> > Thanks,
> >
> > Shawn
>
Hi, you are using the apropiate driver? I think that the PTZ normaly
are using RS485 protocol.

--- In l..., "shunt_2000" wrote:
>
> Hi,
>
> I am a newbie to the board but I have tried my best to find the
answer
> to my question before posting for help.
>
> I am using a QuickStart LPC2106 board with a 14.7456 crystal. I
want
> to be able to accept data from the PC on UART0 and command a PTZ
> camera using UART1. UART0 is working just great. The camera
requires
> 9600 bps and I am configuring PINSEL0 with the following code:
>
> //initialize uart #1: 9600 baud, 8N1
> initUart1(B9600((CRYSTAL_FREQUENCY * PLL_FACTOR) / VPBDIV_FACTOR),
> UART_8N1, UART_FIFO_16);
>
> I am sending two packets to zoom the camera in and out using P0.8
and
> P0.9. I verified the code works from the PC using Rx, Tx, and
ground.
>
> If I hook UART1 up to Br@y's terminal application, I just get
garbage.
> UART0 is fine.
>
> I would really appreciate any help with this. I am sure I am just
> doing something stupid. I am trying to port the Sony VISCA
interface
> that I wrote for the PC side over to the LPC2106 and if anyone is
> interested in it, I would be happy to post the code once I can get
> past this.
>
> Thanks,
>
> Shawn
>
Wow, expensive!
Thanks!
Miguel
To: l...From: s...@gmail.comDate: Fri, 25 Jan 2008 14:52:03 +0000Subject: [lpc2000] Re: Help with LPC2106

It is a nice camera. The zoom and low light capability is incredible.I think it was $800. Yes, Sony publishes the VISCA protocol in the manual. It is a fairlysimple protocol (just not when I am trying to port this over to theLPC2106!) --- In l..., Miguel Wisintainer wrote:>> > Hummm, Cool> How much is this camera and do you have the protocol to comunicatewith it?TCPIPCHIP> > > To: lpc2000@...: shawn.t.hunt@...: Fri, 25 Jan 2008 13:08:25+0000Subject: [lpc2000] Re: Help with LPC2106> > > > > Thank you for the responses.The camera is EVI-D70. It can becontrolled using RS-485 or RS-232. I can plug the same cable I amusing on the LPC2106 into D-SUBconnector and control it.--- Inl..., "roboticsbcn" wrote:>> Hi, youare using the apropiate driver? I think that the PTZ normaly > areusing RS485 protocol.> > > > --- In lpc2000,"shunt_2000" wrote:> >> > Hi,> > > > I am a newbie tothe board but I have tried my best to find the > answer> > to myquestion before posting for help.> > > > I am using a QuickStartLPC2106 board with a 14.7456 crystal. I > want> > to be able to acceptdata from the PC on UART0 and command a PTZ> > camera using UART1.UART0 is working just great. The camera > requires> > 9600 bps and Iam configuring PINSEL0 with the following code:> > > > //initializeuart #1: 9600 baud, 8N1> > initUart1(B9600((CRYSTAL_FREQUENCY *PLL_FACTOR) / VPBDIV_FACTOR),> > UART_8N1, UART_FIFO_16);> > > > I amsending two packets to zoom the camera in and out using P0.8 > and> >P0.9. I verified the code works from the PC using Rx, Tx, and >ground.> > > > If I hook UART1 up to Br@y's terminal application, Ijust get > garbage.> > UART0 is fine.> > > > I would really appreciateany help with this. I am sure I am just> > doing something stupid. Iam trying to port the Sony VISCA > interface> > that I wrote for thePC side over to the LPC2106 and if anyone is> > interested in it, Iwould be happy to post the code once I can get> > past this.> > > >Thanks,> > > > Shawn> >> > > > > > > > __________________________________________________________> Confira veos com notias do NY Times, gols direto do Lance,videocassetadas e muito mais no MSN Video!> http://video.msn.com/?mkt=pt-br> > [Non-text portions of this message have been removed]>

_________________________________________________________________
Veja mapas e encontre as melhores rotas para fugir do trsito com o Live Search Maps!
http://www.livemaps.com.br/index.aspx?tr=true





Hi
Wich Camera do you use?

To: l...From: s...@gmail.comDate: Fri, 25 Jan 2008 04:19:19 +0000Subject: [lpc2000] Help with LPC2106

Hi,I am a newbie to the board but I have tried my best to find the answerto my question before posting for help.I am using a QuickStart LPC2106 board with a 14.7456 crystal. I wantto be able to accept data from the PC on UART0 and command a PTZcamera using UART1. UART0 is working just great. The camera requires9600 bps and I am configuring PINSEL0 with the following code://initialize uart #1: 9600 baud, 8N1initUart1(B9600((CRYSTAL_FREQUENCY * PLL_FACTOR) / VPBDIV_FACTOR),UART_8N1, UART_FIFO_16);I am sending two packets to zoom the camera in and out using P0.8 andP0.9. I verified the code works from the PC using Rx, Tx, and ground.If I hook UART1 up to Br@y's terminal application, I just get garbage.UART0 is fine.I would really appreciate any help with this. I am sure I am justdoing something stupid. I am trying to port the Sony VISCA interfacethat I wrote for the PC side over to the LPC2106 and if anyone isinterested in it, I would be happy to post the code once I can getpast this.Thanks,Shawn

_________________________________________________________________
Receba GRIS as mensagens do Messenger no seu celular quando vocestiver offline. Conhe o MSN Mobile!
http://mobile.live.com/signup/signup2.aspx?lc=pt-br





It is a nice camera. The zoom and low light capability is incredible.
I think it was $800.

Yes, Sony publishes the VISCA protocol in the manual. It is a fairly
simple protocol (just not when I am trying to port this over to the
LPC2106!)

--- In l..., Miguel Wisintainer wrote:
>
>
> Hummm, Cool
> How much is this camera and do you have the protocol to comunicate
with it?TCPIPCHIP
>
>
> To: lpc2000@...: shawn.t.hunt@...: Fri, 25 Jan 2008 13:08:25
+0000Subject: [lpc2000] Re: Help with LPC2106
>
>
>
>
> Thank you for the responses.The camera is EVI-D70. It can be
controlled using RS-485 or RS-232. I can plug the same cable I am
using on the LPC2106 into D-SUBconnector and control it.--- In
l..., "roboticsbcn" wrote:>> Hi, you
are using the apropiate driver? I think that the PTZ normaly > are
using RS485 protocol.> > > > --- In l...,
"shunt_2000" wrote:> >> > Hi,> > > > I am a newbie to
the board but I have tried my best to find the > answer> > to my
question before posting for help.> > > > I am using a QuickStart
LPC2106 board with a 14.7456 crystal. I > want> > to be able to accept
data from the PC on UART0 and command a PTZ> > camera using UART1.
UART0 is working just great. The camera > requires> > 9600 bps and I
am configuring PINSEL0 with the following code:> > > > //initialize
uart #1: 9600 baud, 8N1> > initUart1(B9600((CRYSTAL_FREQUENCY *
PLL_FACTOR) / VPBDIV_FACTOR),> > UART_8N1, UART_FIFO_16);> > > > I am
sending two packets to zoom the camera in and out using P0.8 > and> >
P0.9. I verified the code works from the PC using Rx, Tx, and >
ground.> > > > If I hook UART1 up to Br@y's terminal application, I
just get > garbage.> > UART0 is fine.> > > > I would really appreciate
any help with this. I am sure I am just> > doing something stupid. I
am trying to port the Sony VISCA > interface> > that I wrote for the
PC side over to the LPC2106 and if anyone is> > interested in it, I
would be happy to post the code once I can get> > past this.> > > >
Thanks,> > > > Shawn> >>
>
>
>
>
>
>
> _________________________________________________________________
> Confira veos com notias do NY Times, gols direto do Lance,
videocassetadas e muito mais no MSN Video!
> http://video.msn.com/?mkt=pt-br
>
>
>