Author Topic: PIC controlled LED circuit  (Read 3003 times)

Offline soakes94

  • Sr. Member
  • ****
  • Posts: 114
PIC controlled LED circuit
« on: December 26, 2010, »
Im new to pics and things, and still need to get a pickit but I was wondering if there is any tutorials for people like me, as far as I know all I need is a pickit and somewhere to mount my PIC. How do I go around programming it, I don't think it will be to hard to program the PIC with the hex files that have already been written but I was thinking more about making something that will have a standalone mode unless the PIC is receiving code from the computer.

So lets say mood lighting in my bedroom that is controlled by a PIC but when I want to show off using my itouch and OSD touch or make my room a specific colour or something it will stop the stand alone mode and carry out the command issued by the computer.

Is this possible or am I asking for to much? And if it is possible how would I do it?

Thanks Steve

Offline rrowan

  • Administrator
  • Sr. Member
  • *****
  • Posts: 5899
  • 08096
Re: PIC controlled LED circuit
« Reply #1 on: December 26, 2010, »
Pics are programed normally with C or assembly languages

For Microchip pics you will need to use mplab and you can get samples from microchip website along with forums.
There is also arduino pics but I am not familiar with that one.

Of course you can google for pic programming

Cheers

Rick R.
Light Animation Hobby - Having fun and Learning at the same time. (21st member of DLA)
You are not allowed to view links. Register or Login
Warning SOME assembly required

Offline RJ

  • Administrator
  • Sr. Member
  • *****
  • Posts: 8519
Re: PIC controlled LED circuit
« Reply #2 on: December 26, 2010, »
Just google there is a millions site about doing this kind of thing.

RJ
Innovation beats imitation - and it's more satisfying

Offline soakes94

  • Sr. Member
  • ****
  • Posts: 114
Re: PIC controlled LED circuit
« Reply #3 on: December 27, 2010, »
Okay thanks :), I think it will be easy to find ways to make the standalone mode, the only problem I would have would be adding to the 2 bits of code, so that when the PIC isn't receiving commands from the computer it defaults to standalone mode. Can you guys give me any help there?

Thanks :)

Offline n1ist

  • Coop Manager
  • Sr. Member
  • *
  • Posts: 760
  • 02148
Re: PIC controlled LED circuit
« Reply #4 on: December 27, 2010, »
I'd have a timer running.  Reset it to 0 when you receive a command.  If it ever hits some timeout value, you now know that you haven't received anything within the timeout period, so switch to the standalone mode.  If you receive a command while you are in standalone mode, switch to controlled mode.

/mike

Offline soakes94

  • Sr. Member
  • ****
  • Posts: 114
Re: PIC controlled LED circuit
« Reply #5 on: December 27, 2010, »
I'm completely new to programming pics, any idea how I would work my way around that?

Thanks

Offline rrowan

  • Administrator
  • Sr. Member
  • *****
  • Posts: 5899
  • 08096
Re: PIC controlled LED circuit
« Reply #6 on: December 27, 2010, »
You are not allowed to view links. Register or Login
I'm completely new to programming pics, any idea how I would work my way around that?

Thanks

Google pic programming and learn the basics of how the pic works and try tutorials. I just started to learn pic programming and then got side tracked. RJ does not release his firmware. So unless someone gives you code you will have to learn it yourself.

Rick R.
Light Animation Hobby - Having fun and Learning at the same time. (21st member of DLA)
You are not allowed to view links. Register or Login
Warning SOME assembly required

Offline RJ

  • Administrator
  • Sr. Member
  • *****
  • Posts: 8519
Re: PIC controlled LED circuit
« Reply #7 on: December 27, 2010, »
Here this will get you started :

You are not allowed to view links. Register or Login

RJ
Innovation beats imitation - and it's more satisfying

Offline soakes94

  • Sr. Member
  • ****
  • Posts: 114
Re: PIC controlled LED circuit
« Reply #8 on: December 27, 2010, »
Wow I need to get use to this stuff, I spent a year learning about all the equipment on DIYC mainly the renard stuff, am I correct in thinking that I don't need to program any of the pics with a pickit as lynx adress utility deals with this?

I'm not sure what I will do then to sort out code for my standalone mode + DMX. I might use a Renard board since I have access to that code and have the ability to change it.

Thanks

Offline tbone321

  • Sr. Member
  • ****
  • Posts: 4055
Re: PIC controlled LED circuit
« Reply #9 on: December 28, 2010, »
You would be incorrect in thinkng that you don't need a pic programmer for either the Renard or Lynx.  The Lynx address utility simply sets the start address.  It dose not load the firmware and the pic will do nothing without the firmware loaded.  The same goes for the Renard designs.  Renard does give a significant advantage for what you want to do by providing the code for the firmware but making the changes that you want to do may not be as easy as you think.  You really need to fully understand how the board works and what the firmware is doing in order to make the changes required to implement your ideas and this is not simple stuff with all of the timing issues involved.  You also need to make sure that the code you will need to add will fit into the memory of the pic that you are working with. 

I also have this same  idea in mind and wish that RJ would release some of his older firmware code for those of us wanting to learn to study from but that's completely up to him.  It really doesn't make much sense spending months reinventing the wheel but if I have to, I can download and study the Renard code to get an understanding of how things work.
If at first you don't succeed,
your not cut out for sky diving