Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

A few questions about PIC & computer (going to get it)

Status
Not open for further replies.

hyphenex

New Member
I am thinking of getting a few PIC micro controllers (I've just read the FAQ sheet) to build a car simulator for my year 12 HSC work (I'm an Aussie.) I have no idea how to write programs in anything other then Basic and Python (I've been using basic for as long as I've been programming.) and think it'll be using mikroBasic. The problem I'm having is that I'll have lots of different subsystems so I'll need communications with multiple PIC chips, Is there a way I can send a variable over from one chip to another? What would be the easiest way of doing this?

Also, is there a way to get variables to be received from the parallel port on a computer? This is needed to send data from the engine into the environment.

Thanks for all your help, Scott
 
Hi, (finally somebody read the sticky first).
Sending information between PICs is easy, you are probably looking for some sort of serial transmission (less wires) maybe SPI, UART or I2C (it depends how many PICs you want to connect together).
As for PC to PIC connection, I would also recomend you to use serial port, it's easier to do than Paralel port.
And as stated in the Sticky, I highly recomend you to learn Assembly language, it's worth it. You can't build very complicated projects with Basic style languages.
 
Humm. I little idea what you are talking about, Why not parallel? Can you give me an example of how I would go about programming the pic to recieve parallel port transmittion?

Thanks, Scott
 
I don't recomend paralel because it's easier to damage it and you need more wires to use it, and it's also harder to do bi-directional transmission (with standard paralel port). Comparing to Serial's "Fool-prof" ability and only two wires are needed to do the same job.
 
hyphenex said:
Humm. I little idea what you are talking about, Why not parallel? Can you give me an example of how I would go about programming the pic to recieve parallel port transmittion?

There's very little reason to use the parallel port, it's FAR easier to use the serial port, and there are many examples of this on the Internet (including my tutorials). I don't recall ever seeing a parallel port example?, there's just no reason!.

As Jay says, the parallel port is easily damaged, and best avoided for that reason as well - unless it's a device that is permanently connected, and never messed about with.
 
How about communication between PIC chips wirelessly, using some well defined protocol..eg: Zigbee.
I am experimenting with my own protocol, wherein I am sending out serial data to an RF Encoder & Transceiver Chip(Chipcon).
 
Electrix said:
How about communication between PIC chips wirelessly, using some well defined protocol..eg: Zigbee.
I am experimenting with my own protocol, wherein I am sending out serial data to an RF Encoder & Transceiver Chip(Chipcon).
Hmm this sounds interesting, but I suggest you try it with wires first and then (when it works fine) switch to RF or IR if you really need to. Try to use a standard protocol rather than your own.
 
It does not need to be wireless, A computer is going to sit in the simulator. I have no problem writing the simulator on the computer but when it comes to the electronic part of interacting with engines to tilt the car and everything it gets kind of hard as I only know basic electronics (What they tought us in yr 9 science.)

Could you please post some links to serial transmittion?

If I was going to send a few varibles through the serial port how does the chip time itself to get each bit in time with the computer sending them? Once again, I have no idea on these matters.

Thanks, Scott
 
Serial transmission is not a big deal, with modern PICs (that have HW USART) you just wait for interrupt, USART will receive the Byte and set RCIF (Received byte Interrupt flag), it's very easy. I won't tell you more because everything is in Nigels tuttorials. Read them!
 
Can you please post a link to those tutorials, I have searched the forum and have not found them
 
hyphenex said:
Can you please post a link to those tutorials, I have searched the forum and have not found them

It's in the sticky at the top of this forum!, and it's also including in the signature at the bottom of every one of my posts! - it's hardly difficult to find?.
 
Sorry, I went down the bottom of your site and found your home page and could not find it on their
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top