FPGA Serializer Communication
Navigates to RoboticsConnection.com Home RoboticsConnection.com HomePage
RoboticsConnection User Forum
Home       Members    Calendar    Who's On
Welcome Guest ( Login | Register )
        



FPGA Serializer Communication Expand / Collapse
Author
Message
Posted Monday, August 03, 2009 11:57 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: Forum Members
Last Login: Tuesday, October 06, 2009 6:03 AM
Posts: 4, Visits: 15
hi

I am trying to construct software for an FPGA card and I will try to communicate with the serializer. Just to be sure I want to ask some questions.

1. As I understand the XBee module and the serial port(not the serial module) can not work simultaneously. Is it possible with serializer to communicate via GPIO ports(use GPIO ports as serial port)? I mean if I send data from FPGA to GPIO ports is it possible to store them in Serializer and send the data to PC with XBee Module in order to show this data on a Windows form in real time?

2. How many bits can be transferred to a PC in a second with XBee module?

thanks
__
fatih
Post #1259
Posted Friday, August 07, 2009 7:34 AM


Supreme Being

Supreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme Being

Group: Administrators
Last Login: Monday, October 31, 2011 9:18 PM
Posts: 640, Visits: 819
The only way to communicate w/ the Serializer is via the serial modules, or via the TTL port pins (see documentation). You cannot communicate with it through GPIO. I think you should be able to get your FPGA to communicate over the TTL port, as you just need Tx, Rx, and Gnd connections.

This means that you'll have to implement serial port functionality in your FPGA image though...

Best Regards,


Jason Summerour
President,
Summerour Robotics Corporation
www.roboticsconnection.com
Post #1265
Posted Friday, August 07, 2009 1:01 PM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: Forum Members
Last Login: Tuesday, October 06, 2009 6:03 AM
Posts: 4, Visits: 15
hi
thanks for the reply

Since TTL port pins and XBee module cannot be used simultaneously I am tryin to use GPIO pins. I am driving GPIO pins with FPGA in order to send my data in FPGA to PC. As you understand I am tring to use the the XBee module of serializer as a bridge between PC and FPGA.

I wrote my code for FPGA and also C# code for Serializer. I am using one of the GPIO pins(pin0) as controller. When pin0 is set I am transferring the state of all other 9 pins of Serializer to PC. In first stages, I am setting pin0 one time in a second.I am also driving these 9 pins with FPGA as you must understand.

The problem is that when I increase the set frequency of pin0 I could not observe all data correctly in PC. I mean some bits are not transferred to PC with XBee module.

I also paste my code below whose motor drive part is irrelevant

Thanks

using RoboticsConnection.Serializer;
using RoboticsConnection.Serializer.Ids;
using RoboticsConnection.Serializer.Sensors;
using RoboticsConnection.Serializer.Components;
using RoboticsConnection.Serializer.Controllers;
using System;
using System.Threading;

namespace test
{
class Program
{
static Serializer serializer;
static PwmDCMotorController LeftMotor;
static PwmDCMotorController RightMotor;

static GpioPin pin0;
static GpioPin pin1;
static GpioPin pin2;
static GpioPin pin3;
static GpioPin pin4;
static GpioPin pin5;
static GpioPin pin6;
static GpioPin pin7;
static GpioPin pin8;
static GpioPin pin9;

static void Main(string[] args)
{
serializer = new Serializer();
serializer.PortName = "COM3";
serializer.BaudRate = 19200;

pin0 = new GpioPin(serializer);
pin0.Pin = GpioPinId.Pin0;
pin1 = new GpioPin(serializer);
pin1.Pin = GpioPinId.Pin1;
pin2 = new GpioPin(serializer);
pin2.Pin = GpioPinId.Pin2;
pin3 = new GpioPin(serializer);
pin3.Pin = GpioPinId.Pin3;
pin4 = new GpioPin(serializer);
pin4.Pin = GpioPinId.Pin4;
pin5 = new GpioPin(serializer);
pin5.Pin = GpioPinId.Pin5;
pin6 = new GpioPin(serializer);
pin6.Pin = GpioPinId.Pin6;
pin7 = new GpioPin(serializer);
pin7.Pin = GpioPinId.Pin7;
pin8 = new GpioPin(serializer);
pin8.Pin = GpioPinId.Pin8;
pin9 = new GpioPin(serializer);
pin9.Pin = GpioPinId.Pin9;

pin0.Set += new SerializerComponentEventHandler(pin0_Set);

LeftMotor = new PwmDCMotorController(serializer);
RightMotor = new PwmDCMotorController(serializer);

LeftMotor.DCMotorId = DCMotorId.DCMotor2;
RightMotor.DCMotorId = DCMotorId.DCMotor1;

serializer.StartCommunication();


ConsoleKeyInfo cki;

while (true)
{
serializer.PumpEvents();
if (Console.KeyAvailable == true)
{
Console.Beep();
cki = Console.ReadKey(true);
switch (cki.Key)
{
case ConsoleKey.DownArrow:
LeftMotor.Speed = -50;
RightMotor.Speed = -50;
Console.WriteLine(LeftMotor.Speed.ToString() + " geri");
break;
case ConsoleKey.UpArrow:
LeftMotor.Speed = 50;
RightMotor.Speed = 50;
Console.WriteLine("ileri");
break;
case ConsoleKey.LeftArrow:
LeftMotor.Speed = -50;
RightMotor.Speed = 50;
Console.WriteLine("sol");
break;
case ConsoleKey.RightArrow:
LeftMotor.Speed = 50;
RightMotor.Speed = -50;
Console.WriteLine("sag");
break;
case ConsoleKey.S:
LeftMotor.Speed = 0;
RightMotor.Speed = 0;
Console.WriteLine("dur");
break;
}
}
}
}

static void pin0_Set(SerializerComponent sender)
{
Console.WriteLine(pin0.Pin.ToString() + " " + pin0.State.ToString());
Console.WriteLine(pin1.Pin.ToString() + " " + pin1.State.ToString());
Console.WriteLine(pin2.Pin.ToString() + " " + pin2.State.ToString());
Console.WriteLine(pin3.Pin.ToString() + " " + pin3.State.ToString());
Console.WriteLine(pin4.Pin.ToString() + " " + pin4.State.ToString());
Console.WriteLine(pin5.Pin.ToString() + " " + pin5.State.ToString());
Console.WriteLine(pin6.Pin.ToString() + " " + pin6.State.ToString());
Console.WriteLine(pin7.Pin.ToString() + " " + pin7.State.ToString());
Console.WriteLine(pin8.Pin.ToString() + " " + pin8.State.ToString());
Console.WriteLine(pin9.Pin.ToString() + " " + pin9.State.ToString() + "");

}

}
}
Post #1271
« Prev Topic | Next Topic »


Reading This Topic Expand / Collapse
Active Users: 0 (0 guests, 0 members, 0 anonymous members)
No members currently viewing this topic.
Forum Moderators: jsummerour, ringo

Permissions Expand / Collapse

All times are GMT -8:00, Time now is 4:45pm

Powered By InstantForum.NET v4.1.4 © 2012
Execution: 0.094. 9 queries. Compression Disabled.