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.

New to programming, trying to accomplish the following

Status
Not open for further replies.
If I might ask a very practical question about a subject that you haven't addressed and no one has asked about. What do you mean by "present"? Does it refer to a particular distance and how would you determine that distance? IR is directional so two devices could be close but not properly oriented to receive. On the other hand IR can travel significant distances and can be subject to reflection.
 
If I might ask a very practical question about a subject that you haven't addressed and no one has asked about. What do you mean by "present"? Does it refer to a particular distance and how would you determine that distance? IR is directional so two devices could be close but not properly oriented to receive. On the other hand IR can travel significant distances and can be subject to reflection.

I'm going to be limiting the IR distance using a variable potentiometer to try and get it down to within 1 - 2 feet. As well, I will be more than likely using up to 3 IR TX & TR to give me as close to 360 degrees as possible. I have been looking into ordering some LED's that have a 160 degree line of sight as well.
 
The 16f690 has only one hardware PWM module. It would be best to have two, one to create the IR carrier and one to fade the LEDs. I am assuming all LEDs on one device fade together. Is that correct?
 
If you have any extra time & motivation then I recommend Morton's book 'the PIC Microcontroller' - it's a compelling read (assembler language), and I went from total ignorance to a degree of competence (i.e. I understand the data sheets) in less than a month.

My first project was a success, using 16F690, Pickit 2, MPLAB, like you, and was quite sophisticated. i.e. The book recommendation was not an idle recommendation.

If you're prepared to spend money to get someone to do it for you, then consider using this getafreelancer site, it turns up quite frequently when I google PIC-related things. For example

GetAFreelancer.com - Adding voltmeter / ammeter to PIC microcontroller
 
The 16f690 has only one hardware PWM module. It would be best to have two, one to create the IR carrier and one to fade the LEDs. I am assuming all LEDs on one device fade together. Is that correct?

Hmmm, good point Skyhawk!

Each device has to send and receive a IR signal, as well as fade the LED's. So you're right. I was hoping it was possible to have the LED's fade randomly (each one fades in and out independent of the others).

astronomerroyal

Thanks! I'll see if I can go get that book tomorrow, or order it.

I would rather learn how to do this myself as it's half the fun, but if I end up having to pay someone I'll for sure check out that site.
 
The PIC16F876A would be a good chip for you.It has 2 PWM channels and a USART so it would work for your project.
 
Sweet...do you happen to know how big that chip is? Like size wise?

The reason I ask is that first of all I need to find a way to keep this as small as possible as the cases they'll be in are quite small....secondly, my PIC programmer only has like 20 pins I think.
 
Sweet...do you happen to know how big that chip is? Like size wise?

The reason I ask is that first of all I need to find a way to keep this as small as possible as the cases they'll be in are quite small....secondly, my PIC programmer only has like 20 pins I think.

You must put a ICSP connector in your programmer.So you can program many PICs.If not currently have you can sort out the tracks that going into the 18 pin socket & solder some wires to the connections.From end of this wire ends you could make a ICSP connector.

Looks likes you have a JDM type programmer.
 
Last edited:
The 16F876A is a 28pin PIC, at the end of the datasheet they'll tell you the packages available. I think it has a SOIC (really small) version and the standard 28pin DIP.
 
Gyan,

I have the PICKit 2 Starter Kit which allows you to program up to 20 pin MCU's. The documentation tells me where it's all going as well it has LED's to test.
 
The PicKit 2 will program any pic from 6 to 100 pins and any family from PIC10F to PIC32MX.Oh and the pic i told about is 28 pins.

You probably have a breadboard right? Just stick the pic in there and connect the right pins to the pickit. What pin is what is in the pickit pdf documentation that comes with it.
 
The 16F876A is a 28pin PIC, at the end of the datasheet they'll tell you the packages available. I think it has a SOIC (really small) version and the standard 28pin DIP.

Blue, the SOIC is a surface mount is it not?

You're both right...I can make a breadboard programmer...I was hoping to find something that worked with what I have so I didn't have to spend time mucking around with one, but unless there is another chip that'll do what I need, I may be forced to.

My main two concerns really is size of the chip, and getting the right chip. I want to avoid anymore random purchases until I know exactly what I need. Going out and ordering 3 chips at $7.00 is going to suck if they don't work for what I need.
 
Last edited:
Yes SOIC is a smd package with 1,27mm apart pins its one of the biggest SMD packages. But What you want is the PDIP.Its the normal chip that will fit in the breadboard.

Oh and sooner or later you will need to make your own hardware. The test board that comes with the pickit could only be used to try fadeing LEDs. For IR and stuff like that you will need to build your own cirucit.Preferably on the breadboard first and then solder it on a prefboard or something.
 
I have to order 3 chips to get this thing to work...that's why I'm hesitant to just order any random thing.

What is the difference from the two chips? I'm reading the Datasheet for the first one as we speak.
 
Well for the IR i would rather use the hardware UART rather than "big banging" it using software. In that cause you would connect the IR LED between the PWM pin and the UART TX pin.As for the receiver just directly on to the UART RX pin.

It will make the program cleaner and faster and also a lot easyer if you use asembely because useing the UART is pretty easy.


EDIT: The 2nd chip is a newer replacement for the one i told about but i guess its more complicated so it would be better to use the old one. also the 16F876A is a pretty common pic so lots of compilers will support it.
 
Last edited:
PDIP is also known as DIL, DIL ,CERDIP, SPDIP etc. And the package code if often followed by a number inidcating the number of pins.
 
Status
Not open for further replies.

Latest threads

Back
Top