View previous topic :: View next topic |
Author |
Message |
bahnfire
Joined: 30 Apr 2009 Posts: 8
|
Will the general 1-wire routines fit into a PIC10F? |
Posted: Wed Nov 30, 2011 9:48 pm |
|
|
I am looking at using a PIC10F with the 1-wire bus, but wanted to see if anyone had experience with this fitting into the IC before I went out and purchased the ICs and associated equipment.
Any advice? |
|
|
dyeatman
Joined: 06 Sep 2003 Posts: 1934 Location: Norman, OK
|
|
Posted: Wed Nov 30, 2011 10:01 pm |
|
|
Why not pay 25 cents more and get an 16F processor or 75 cents
more and get an 18F processor?
Is this a school project that requires a 10F? _________________ Google and Forum Search are some of your best tools!!!! |
|
|
bahnfire
Joined: 30 Apr 2009 Posts: 8
|
|
Posted: Wed Nov 30, 2011 10:14 pm |
|
|
dyeatman wrote: | Why not pay 25 cents more and get an 16F processor or 75 cents
more and get an 18F processor?
Is this a school project that requires a 10F? |
I need this application to be tiny since it will be built into some wiring. I am also looking at the PIC12 series that has a 8DFN package. I will need to rethink the design though since I keep adding features.
This is not for a school project (I am 30 and have been out of school for at least 8 years). |
|
|
bahnfire
Joined: 30 Apr 2009 Posts: 8
|
|
Posted: Wed Nov 30, 2011 10:17 pm |
|
|
Let me go into more detail: I am making a string of micros that will perform a function and report back to a master. There would be up to 50 micros on this string and it can be up to 100' long.
Would a 1-wire interface be the easiest, or does another protocol exist that would perform like a repeater/relay (into PIC, then out to next PIC - versus a shared bus like 1-wire or I2C)? |
|
|
dyeatman
Joined: 06 Sep 2003 Posts: 1934 Location: Norman, OK
|
|
Posted: Wed Nov 30, 2011 10:48 pm |
|
|
With a max 800 bytes I think it would be tough to fit what you need.
The 12F would have a better chance of working. The 12F1840
has 7K memory and an UART module you can use for RS485. _________________ Google and Forum Search are some of your best tools!!!! |
|
|
bahnfire
Joined: 30 Apr 2009 Posts: 8
|
|
Posted: Thu Dec 01, 2011 12:18 am |
|
|
dyeatman wrote: | With a max 800 bytes I think it would be tough to fit what you need.
The 12F would have a better chance of working. The 12F1840
has 7K memory and an UART module you can use for RS485. |
Sounds good. I will take a look at that chip to see if they have it in a DFN package. |
|
|
temtronic
Joined: 01 Jul 2010 Posts: 9246 Location: Greensville,Ontario
|
|
Posted: Thu Dec 01, 2011 5:45 am |
|
|
Rule #1 project code and features will always exceed the PIC you first choose
Rule #2 saving 50c now will cost you $$$ later
Rule #3 after soldering smd PIC board 17, your eyes will go 'funny', and you'll appreciate why I've stuck with 40 pin DIPs ! |
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19553
|
|
Posted: Thu Dec 01, 2011 6:03 am |
|
|
One wire, might well give you problems.
Basically the bus has a maximum 'weight', and every device you add, itself adds a 'weight' (in terms of electrical load). So you can run the bus well over a hundred feet, with just one device attached, but as you add devices, the physical length you have left to use goes down. With 50 micros on the 'string', I think it is _very_ doubtful that you will be able to go 100' with one-wire.
Lots of things you need to think about:
Power consumption of devices - should there be a separate power wire?.
Speed of the communication required?.
Can the communication be simplex, half duplex, or is duplex needed?.
Total quantities involved - seriously, you can get a RS485 transceiver on a dye, and put a complete system with processor and transceiver, and a switch mode PSU, into perhaps 0.02cc, if you are going to produce hundreds of thousands. The same done in thousands off, can still quite easily be under 0.2cc if hybrids are used, but go to hundred off quantities instead, and something like 0.5cc will be the limit.
How noisy is the environment? - affects error recovery requirements, and device protection requirements.
Best Wishes |
|
|
temtronic
Joined: 01 Jul 2010 Posts: 9246 Location: Greensville,Ontario
|
|
Posted: Thu Dec 01, 2011 10:17 am |
|
|
hmm...
'One-wire' , if it refers to the Dallas Semiconductor series of parts might actually go 100', but check out their website for application notes and design details.
Some of the details include wire size,pullup resistor selection,noise(EMI) consideration and of course datarate.
Now if 'one-wire' means a single wire for communications, I've had systems up and running here for the past 20 years with over 15 miles(yes,miles) of unshielded copper.Not fast but ultra reliable.32 slaves per line.This is true 'one-wire', a single conductor from point A to B.Power is local to the devices. |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Thu Dec 01, 2011 8:34 pm |
|
|
Quote: |
I wanted to see if anyone had experience with this fitting into the IC
before I went out and purchased the ICs.
|
You can easily answer this question by yourself. Download MPLAB from
the Microchip website. It comes with vs. 4.073 of the PCB compiler.
(Look in "Third Party" tools during the installation and select it to install).
It's the compiler that works with the 10F-series. It runs from within MPLAB.
Then use some 1-wire example code found on this forum:
http://www.ccsinfo.com/forum/viewtopic.php?t=28425
Edit it so that the #include, #fuses, etc., and the 1-wire pin are suitable
for your 10F PIC. Then attempt to compile it. If it doesn't compile, it may
say "out of rom" or "not enough RAM".
By this method, you can do your own experiments ahead of time and
find out what PIC will work best. |
|
|
bahnfire
Joined: 30 Apr 2009 Posts: 8
|
|
Posted: Thu Dec 01, 2011 11:26 pm |
|
|
temtronic: I do not really need to adhere to any standard since this is for fun - I am actually looking at making my own protocol and using the ICs as tiny repeaters. Each IC would have its own power, so that is not an issue. I agree that trying to design for a cheaper IC now will bite you later. I was hoping that someone out there had some experience with the 10F line or low end 12Fs. I have no issues soldering - I have access to some neat soldering equipment (air rework systems, stencil machine, pick and place, etc).
PCM programmer: I understand that I can code up a quick sample and test this myself - but then what is the point of a forum of other engineers if I cannot ask a simple question - especially if someone else has experience in this and can save a few minutes or hours of work. If we all answered our own questions and never shared there would be no reason for this forum (or any forum, or even the internet). Heck, I would not feel slighted at all if someone asked a question that I knew the answer to - I would feel excited that I could actually help someone. |
|
|
temtronic
Joined: 01 Jul 2010 Posts: 9246 Location: Greensville,Ontario
|
|
Posted: Fri Dec 02, 2011 6:34 am |
|
|
One really good thing about cutting code and assembling it under MPLAB is getting familiar with the 'quirks' of that chip or family of PICs.
Over the decades I've used PICs there's been tons of peripherals and pins added since the 16C84 days.As well, the compiler's have grown leaps and bounds !!
The internet has exploded with sites like this forum that can give you 'information overload' but real hands on testing is the best educator.
I agree that when you have a 'tricky' problem or a weird coding issue it's great to have a site like this.
If your project has the space,get a bigger PIC, one that can be used for another series of products or projects.It allows you to have a lot of common code, saves on inventory, pcb designs and common parts.I currently use the 4550(DIP pkg),best upgrade from the 877.Tons of pins, perihperals and memory though USB program code takes about 1/3 of the space! |
|
|
ckielstra
Joined: 18 Mar 2004 Posts: 3680 Location: The Netherlands
|
|
Posted: Fri Dec 02, 2011 8:30 am |
|
|
For a long time I've had plans to do a similar project with 100+ individually driven RGB-leds but never got time to actually do it. A hobby project where one of my design goals was to do it cheap.
The Dallas (Maxim) one-wire protocol is a nice and good documented protocol but not the only option. Great thing about the Dallas one-wire protocol is the possibility to use just two wires: data and ground. During the periods where the data line is used for data transmission a small capacitor powers the device.
Since you are planning to use seperate power supply lines other protocols come into play. Dallas one-wire uses differences in pulse-width to differentiate 0 and 1's, another option could be Manchester encoding as used in Ethernet. Read the Wiki page on Manchester Encoding for more info and links to other encoding schemes.
RS485 is great for long distances, high speed and multi-drop but has the disadvantage of requiring an extra tranceiver chip. Not too expensive, but 100 times small money makes too much for my hobby project.
A good article for reading is Guidelines for Reliable Long Line 1-Wire® Networks. It gives info on terms like network Weight, network length, topology and how this relates to maximum speed and driver requirements.
Deciding on the exact PIC type to use is difficult in this stage of your project. You'll always want to add more features after the first prototypes are made. I suggest you start with a large PIC from the 12 or 16-series as these are almost code compatible. Once you have a running software prototype you'll know the required hardware and can search for the cheapest fitting PIC model. Always design in a big chip and only when going to production buy the best fitting chip model in large quantities. That's one of the great features of the CCS compiler, changing PIC model often involves nothing more than including another header file. |
|
|
|