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.

Using PWM on a 18F13K22

Status
Not open for further replies.
image.jpg
 
I have clicked almost every link posted so what link did you assume I did not click?
Maybe just maybe Littleghostman will come up with a better method to simulate a candle. The links that Jonsea posted are ok, I looked at several videos that were posted within the links and compared to what I presently have working, they are all pretty lame IMO but seeing what other people are doing does help.
As soon as I get the bi-colored LEDs I will post a video and challenge anyone to discredite it if they feel it looks like something from Mars--lol
 
Well LG didn't get a chance to post tonight, as the post takes ages to do, but he has sorted out the way to do it with single array's, so no doubt he will post tomorrow, Futile? yes and no. LG has learn t things for himself, he has gone through the datasheet, and then has started to post something he is working out for himself as he goes. So yes might not help Mr Deb, but at some point someone we will never know, will Google it and maybe learn from it, or some the other things in this thread.
So yeah i agree futile in one sense, but worthwhile in another.
 
Well LG didn't get a chance to post tonight, as the post takes ages to do, but he has sorted out the way to do it with single array's, so no doubt he will post tomorrow, Futile? yes and no. LG has learn t things for himself, he has gone through the datasheet, and then has started to post something he is working out for himself as he goes. So yes might not help Mr Deb, but at some point someone we will never know, will Google it and maybe learn from it, or some the other things in this thread.
So yeah i agree futile in one sense, but worthwhile in another.

Yes, I must agree that providing information for others and learning things for yourself is (nearly) the only benefit of attempting to help MrDEB. He scarcely glances at posts that may take hours to research and write and fails to appreciate that the detailed explanations are for his benefit, not yours. It's a good exercise for LG to learn about the kinds of folks he may have to put up with in his future career.
 
I will be posting later with luck, i am trying to track down all the limitations of swordfish, there are a few that i need a work around for. will swordfish handle say a double long?
 
well apparently swordfish wont do multi element array's, so i was thinking sticking it in one array, but have 64 bits, so 8 bits for red 8 bits for green 8 bits for blue 8 bits for intensity then the rest for one the other rgb leds and the third led could be one taken from other, that way all three leds different, but i would settle for 32 bits
 
Oh the other reason was, we were talking a bit ago about 4 leds on one pic, so 64 bits if you include the flicker/brightness

Goofed again! Sorry i am writing something down and not paying attention!
4 Leds,
One colour on each tied 2 colours on pwm, flicker just random in main code, but i would prefer first option, 3 leds 64 bits
 
I've made PDFs of two sections of the Swordfish documentation, which may be found by clicking "help" in the Swordfish IDE menu bar.

The first is the section on variables. It may be possible to use strings to hold 64 bits, but the overhead of using strings is huge.

The other section is on structures. Using a structure, several variables may be linked together and treated as a unit or separately. I must admit I don't really understand how to make use of a structure but apparently this is almost straight C, so maybe it will make sense and be useful.
 

Attachments

  • variable types.pdf
    202.6 KB · Views: 249
  • Structures.pdf
    157.3 KB · Views: 259
Ok. I'm impressed. I typed the above message on my iPad but then realized I couldn't upload the files from my iPad even though they are accessible via Dropbox.

Darn it, I was thinking. I'll open Electrotech on my laptop but I'll have to re-type the message. When I opened the thread and scrolled to the bottom, my message was waiting for me in an open edit box, just waiting for me to attach the files. Slick.
 
thanks jonsea, i am having to tweak what i was going to do. This would have been so much easier in C, but we have what we have! I am reading swordfish now. Man its so different
 
I was wondering if it was a server error or ??
Being in the middle of nowhere and perhaps the slowest internet speed in the country
SENT 200,410,027
RECEIVED 1,172,760,891
Anyway any progress on the code you are conjuring up that might work? Been putting together a schematic and pcboard but waiting for the bi colored LEDs before going any further. Ordered several 5mm and 10mm.
At this point in time , am going with the basic idea of using the basic circuit that Welcome to wire2wire LED candle uses but incorporating the 18F13K22. Using one of the routines I have operational or trying out what Littleghost comes up with. Still tinkering with the code Tumbleweed posted but not any great results as yet.
Been thinking about how to house each candle? PVC pipe cap is one way but kinda spendy per cap.
 
....Been putting together a schematic and pcboard but ....

As LittleGhost said way back about message 15, you can't layout a board until you know what you're going to build. You've mentioned at least 3 different circuits with different approaches and even different numbers of LEDs plus introduced bi-polar LEDs into the mix that may or may not work with whatever version of the code you decide to go with and you're working on a schematic and a board? For what exactly?

If you're ever going to make something work, you need to follow a flow. First figure out the code. Then figure out the parts. Then make a schematic. Finally, after all those things are done, THEN you can lay out a board.
 
....At this point in time , am going with the basic idea of using the basic circuit that Welcome to wire2wire LED candle uses but incorporating the 18F13K22....

Also, the "Welcome to wire2wire LED candle", which is the link I posted, uses assembly language on a PIC12F508. Have you looked over the source code well enough to know you can translate it? This would not be a trivial task for one experienced in assembly. Why not build it as designed?
 
Status
Not open for further replies.

Latest threads

Back
Top