Got sidetracked about using ASM

Post here to let others know of a project you're working on.

Moderators: Chuckt, Garth, bitfogav

MrDEB
I practically live here!
I practically live here!
Posts: 372
Joined: Fri Feb 18, 2011 4:24 am

Got sidetracked about using ASM

Post by MrDEB » Tue Nov 19, 2013 8:41 am

I downloaded the first tutorial and also the MPLAB but its now a different MPLABX. Need to figure out in accordance with the tutorial.
Am looking at doing a candle flame effect but instead of using SWORDFISH and an 18F chip was thinking of using a cheaper chip since I need about 30-40 candles.
Have a SWORDFISH candle code working but cost. Could go with an 18f13k22 at $2.10 but a 16 or 12F chip is still cheaper.

User avatar
brad
Site Admin
Site Admin
Posts: 2576
Joined: Fri Mar 26, 2010 10:30 pm

Re: Got sidetracked about using ASM

Post by brad » Tue Nov 19, 2013 9:10 am

Glad you're looking into the ASM tutorials - that's where it all started for me - it was great fun!

What price are you looking at for your micro controllers? What are you planning on using these candles for?

User avatar
bitfogav
Moderator
Moderator
Posts: 908
Joined: Sun Mar 28, 2010 9:03 pm
Location: United Kingdom
Contact:

Re: Got sidetracked about using ASM

Post by bitfogav » Tue Nov 19, 2013 9:55 pm

The MPLAB you wanted is in the previous software releases.

Link: MPLAB you will need to download version MPLAB IDE v8.92

Maybe Brad would update the tutorial? :P :P
If you don't know what Voltage your country is using, you shouldn't be doing electronics ;-)

MrDEB
I practically live here!
I practically live here!
Posts: 372
Joined: Fri Feb 18, 2011 4:24 am

Re: Got sidetracked about using ASM

Post by MrDEB » Tue Nov 19, 2013 11:57 pm

PRICE per pic for the 18F1220 is just under $3per but looking at a larger quantity.
I have a working SWORDFISH code using a tri-color LED. The 30+ units are for our annual parish Italian Dinner on the last Saturday in January 2014.
Couple years ago durring the dinner, the power lines caught fire thus no power. We had a full house of customers so we gathered up all the real candles for light. The mood during dinner was nicer than bright florscents. I got this idea for making LED candles but pricing out the pics I need a programming code that will work on cheaper pics.
Found the 18F13K22 for $2.30 but building say 30 candles! but the pic would use nano watt,
I presently am using the tri color LED (red = 2.4fv, Blue = 3.4fv, Green = 3.4fv)and a 370 ohm resistor on the common cathode. Seems fairly bright? but could use a smaller resistor but planning on hopefully going with 3v input voltage (2 AAA batteries) and using a section of PVC pipe for holder.
I need to look at say a 12 or 16F pic but using nano watt?
These candles need to run for a min of 5 hours thus the batteries should last couple years? need to look at caculations but my present setup the LED draws a max of 7ma (using a tap28 board and Pickit2).
Going to look over at Microchip and mplab v8.92

MrDEB
I practically live here!
I practically live here!
Posts: 372
Joined: Fri Feb 18, 2011 4:24 am

Re: Got sidetracked about using ASM

Post by MrDEB » Wed Nov 20, 2013 4:26 am

Well I have on hand 18f2420, 16f84a.
Need to study the datasheets if I can write the code using the 16F84a but use a 12f508 or 16f505(same data sheets)
I got the MPLAB to load and open the downloaded asm file. Just need to do some studying and hopefully use the 18F2420 for testing then purchase the 12f508 @ .67 each or the 16F505 at .79 each.
Looking over the instruction set it looks like I might be able to write for the 18F but use the 16F or 12F pic's??

User avatar
brad
Site Admin
Site Admin
Posts: 2576
Joined: Fri Mar 26, 2010 10:30 pm

Re: Got sidetracked about using ASM

Post by brad » Thu Nov 21, 2013 8:55 pm

I would highly recommend going straight for the 18F pics because they don't have the memory paging problems like the 16f's do. The prices are also quite comparable :)

MrDEB
I practically live here!
I practically live here!
Posts: 372
Joined: Fri Feb 18, 2011 4:24 am

Re: Got sidetracked about using ASM

Post by MrDEB » Thu Nov 21, 2013 11:58 pm

Comparing prices I think your right. Using anything other than the 18F will involve using and trying to learn a new programming language.
Now to do some calculations if I can run this candle using 3v instead of 5v. Am / was looking at stick candles but perhaps a votive candle would be easier to house say 3 AA batteries? Then I could increase the led brightness using 5v instead of 3v.
I kinda wish I went with 10mm leds but I have 200 of the 5mm LEDs that I had planned for the bicycle project that has gone to the wayside for next year.

MrDEB
I practically live here!
I practically live here!
Posts: 372
Joined: Fri Feb 18, 2011 4:24 am

Re: Got sidetracked about using ASM

Post by MrDEB » Fri Nov 22, 2013 8:45 am

Decided to go with the 18F13K22 and pricing out for 25 units. Going with the SOIC SMD along with SMD cap and 4 resistors-- 3 for the leds and one for the mclr
Now to design a board.
Plan is to fit into a 3" section on PVC pipe (wish it could be smaller but the battery holder is 2.70 wide unless I get a smaller battery holder?

User avatar
brad
Site Admin
Site Admin
Posts: 2576
Joined: Fri Mar 26, 2010 10:30 pm

Re: Got sidetracked about using ASM

Post by brad » Sun Nov 24, 2013 5:56 am

I have used the LF versions just fine with a coin cell 3V battery.

as for the MCLR pin, you don't need an extra resistor for that, you can just set it to off in your code:

Code: Select all

Config MCLRE = OFF

MrDEB
I practically live here!
I practically live here!
Posts: 372
Joined: Fri Feb 18, 2011 4:24 am

Re: Got sidetracked about using ASM

Post by MrDEB » Mon Nov 25, 2013 7:26 am

Got a BOM put together for a bunch of votive candles but instead of each candle having one pic, one RGB led and one battery pack I got the idea of combining candles.
Have three candles tied together per table with a Cat 5 cable chaINING THEM TOGETHER.
The middle candle to house the pic and 3 C batteries (6000mah capacity) thus equating to about 40+ hours run time, probally closer to 25 hours with 3 RGB leds going at one time off of the one pic..
I am looking for a battery pack that has 3 C batteries in a triangular sort of way. Not side by side or end to end.
End to end = 7" long which is too long. Side by side flat is too wide. In a triangular bunch they would be the perfect size IMO.
Yes I though about AA batteries but run time at 100ma would be at best 6 - 8 hours.
Even considered D batteries. Remember one battery pack runs 3 RGB LEDs
Using this chain method the cost for just the electronics is about $3-$4 for 3 candles plus batteries and pvc pipe.
I have lots of CAT5 and RJ45 pcboard sockets as well as the CAT5 end plugs.
Haven't included the PCboard cost either but shouldn't be too much with smd boards and only need 15. I can't see a board any bigger than say 10mm x 10mm at best, maybe smaller. The RJ45 sockets are the largest foot print. Just need to find a smaller battery holder for C batteries.

User avatar
brad
Site Admin
Site Admin
Posts: 2576
Joined: Fri Mar 26, 2010 10:30 pm

Re: Got sidetracked about using ASM

Post by brad » Mon Nov 25, 2013 9:47 pm

What about using a couple of smartphone batteries in parallel?

You can get them for quite cheap on ebay, have a small footprint and some of them have 3000mAh capacity. They could also run just fine with an LF chip (3.6V).

Although then you may want to look at incorporating some charging circuitry which makes it a bit more involved...

MrDEB
I practically live here!
I practically live here!
Posts: 372
Joined: Fri Feb 18, 2011 4:24 am

Re: Got sidetracked about using ASM

Post by MrDEB » Mon Nov 25, 2013 10:17 pm

I contemplated a rechargable but yes the rechargeable issue rears iit's ugly head. For 15 units just think how many days to recharge.
Then we need to consider that the forward voltage of the Blue and Green are 3 - 3.4v
The batteries wear down and now the LEDs go kaputt.
Will do some more thinking n searching

MrDEB
I practically live here!
I practically live here!
Posts: 372
Joined: Fri Feb 18, 2011 4:24 am

Re: Got sidetracked about using ASM

Post by MrDEB » Tue Nov 26, 2013 1:50 am

Here is the simplistic schematic. The two other candles plug into the the RJ45 sockets.
Even contemplating adding or eliminating an on/ off switch to save cost.
Attachments
schematic candles.jpg
schematic candles.jpg (103.36 KiB) Viewed 7072 times

User avatar
brad
Site Admin
Site Admin
Posts: 2576
Joined: Fri Mar 26, 2010 10:30 pm

Re: Got sidetracked about using ASM

Post by brad » Wed Nov 27, 2013 10:04 pm

One thing to note - you have your cathodes connected to Vcc, those will need to be going to Ground (Vss)

MrDEB
I practically live here!
I practically live here!
Posts: 372
Joined: Fri Feb 18, 2011 4:24 am

Re: Got sidetracked about using ASM

Post by MrDEB » Thu Nov 28, 2013 1:19 am

I realized that I had the LEDs wired backwards after I posted.
BAD NEWS -- the PWM outputs on the 2420 there is only tweo. The results of the code I posted looks more like a strobe light than a candle. Attempting to slow it down but no go so far.
GOOD NEWS --- the 18F13K22 I planed on using has 4 PWM outputs (pins 5, 6, 7, 14) and thinking perhaps a PWM output would simulate a candle flicker better.
here is what I am looking at doing. Now to actually start using the 18F13K22 I just got in the mail, figure out how to implement the PWM module in SWORDFISH.
any suggestions welcomed.
Attachments
PWM outs.png
PWM outs.png (19.07 KiB) Viewed 7061 times

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest