Parallel Port Interface from PIC to PC

May 17, 2005 11 Replies

hi there,



my current project involves designing a circular sonar-sensor array to be incorporated onto a mobile robot. the hardware design i had in mind was simple - the sensors would communicate with a PIC via I2C, which would then transmit the readings to the laptop on the robot. i managed to implement the I2C interface between the PIC and the sensors. i now need to establish communication between the PIC and the laptop on the robot. the laptop has two ports, a USB port and a parallel port. i'm pretty sure it's much easier to try to develop a parallel port interface. could somebody guide me through this process? i don't know if this complicates matters, but the laptop on the robot is running a real-time operating system called QNX. if there are any other details i can provide, please let me know.



any help would be appreciated. thanks,



rajiv



I'm not sure of QNX, but Linux has a whole I2C communications suite of drivers (2.6.x).

I bet (but have not looked) that QNX has a set of protocol drivers, but do not know for sure. I own a Velleman K8000 board and uses the parallel port to implement an I2C bus. Use google to find "Manual_K8000.pdf" which contains a set of schematics, and if you can find the software it has a set of DOS libraries.

Well, I've got some code for a PIC to talk EPP if that's any use to you.

cheers, Rich.

A basic serial link would work. I use RS485. Even RS232 could work.

There are many USB devices that convert between USB and the various serial protocols.

-- D. Jay Newman

formatting link

You might find it simpler to use an RS-232 USB converter and just use regular async to/from the PIC.

"D. Jay Newman"

Could you tell a bit more on how exactly you are using RS485? What software/protocol do you use in the PC side? I'm about to implement a bus in my robot using RS485, and I'm still not sure on the whole picture. I've read the serial port complete from Jan Axelson and I got a basic idea, but I would appreciate hearing how you did yours.

TIA

Padu

hi rich,

that would indeed be helpful. please let me know how/where i can get it.

thanks,

rajiv

i did try to use a parallel to usb converter chip made by FTDI. the chip was FT8U245AM, and i chose it because the FTDI listed third party drivers for QNX for that particular chip. however, when i tried to install the drivers on the QNX laptop on the robot, i ran into serious problems, so i had to give up on that plan.

sent by mail

cheers, Rich.

Brian Dean of BDMicro should really answer this because he created the protocol, but I suppose that I can give you an overview.

This is a master/slave protocol with a single master with no guarenteed delivery. On the other hand, I've never had a problem with it.

Each device has a 1 byte id. 0 is the broadcase address.

The master sends a request to a slave with id 4: >>4:id=2;

The master sends a command to make all the devices verbose: >>0:verbose=1;

Brian is using this protocol for his new motor drivers and he programmed a library for use with his MAVRIC-IIB board. It's programmed in C and would be a good example. I'm writing my master code in Java.

-- D. Jay Newman

formatting link

What do you make the physical connection of your PC to the RS485 bus? Do you have a root node or do you use a rs485 adapter?

Padu

I use a USB-COMi device to go from the Linux board to the RS485. Theoretically the iBase890c board has settings for RS485 but I've never gotten it to work. :(

-- D. Jay Newman

Join the Discussion

Have something to add? Share your thoughts — no account required.

Didn't find your answer?

Ask the community — no account required