![](templates/subSilver/images/CCSLogo.jpg) |
![CCS C Software and Maintenance Offers](templates/subSilver/images/forumAd6.jpg) |
View previous topic :: View next topic |
Author |
Message |
MarkHolbrook Guest
|
Out of IO... |
Posted: Sat Mar 09, 2002 9:36 am |
|
|
Crud!!!
I'm working on a temperature controller project where I have three remotes working via RF link into a master controller. Using a voting / averaging scheme the master controller will set the temperature and control our house heater based on what the remotes say.
I'm just about maxed out on IO and I still want to add an LCD display and a couple of buttons for manually setting the temperature setpoint. In looking at the range of PICs that have 10 or 12 bit analog in, I'm beginning to think I need more IO. That leads me into the PIC18 series.
However... I own the PCW version of the compiler (not the H). I also only own a PICStart Plus programmer.
Question: I can upgrade to the H compiler no problem. But will my PICStart Plus even work with the 18 series?
Thanks - Mark
___________________________
This message was ported from CCS's old forum
Original Post ID: 3081 |
|
![](templates/subSilver/images/spacer.gif) |
Peter H Anderson Guest
|
Re: Out of IO... |
Posted: Sat Mar 09, 2002 10:45 am |
|
|
My own experience was that I could not program the PIC18C452 using my PIC Start Plus. Latest firmware and MPLAB 5.5. I had developed a good deal of code using a RICE-17 emulator with a PB18 probe, but simply could not get a real device to play. Spent better than a day pulling my hair.
I had the same experience when using the WARP-13A under MPLAB. But, I was able to finally program devices using the Newfound software.
But, this was just my experience. I have noted posts on the PICLIST of a similar nature where the user was using a PROMATE.
My general feeling is that there is a problem with MPLAB.
The largest PIC18 I have actually held in my hand is the PIC18C452 and the number of IO is just about the same as the F877. Perhaps, one or two more.
Depending on the application, it seems as if you might free some IO with multiplexers, decoders, shift registers, Philips PCF8574. Perhaps even a slave PIC.
Peter H Anderson, <a href="http://www.phanderson.com" TARGET="_blank">http://www.phanderson.com</a>
:=Crud!!!
:=
:=I'm working on a temperature controller project where I have three remotes working via RF link into a master controller. Using a voting / averaging scheme the master controller will set the temperature and control our house heater based on what the remotes say.
___________________________
This message was ported from CCS's old forum
Original Post ID: 3082 |
|
![](templates/subSilver/images/spacer.gif) |
Hans Wedemeyer Guest
|
Re: Out of IO... |
Posted: Sat Mar 09, 2002 10:52 am |
|
|
:=Question: I can upgrade to the H compiler no problem. But will my PICStart Plus even work with the 18 series?
Yes it works just fine. You will need to make sure you have the latest version of the Picstart Plus firmware when I start mine it reports V2.30.00
Also make sure you have the latest MPLAB, I am using V5.50.00 .
When you download MPLAB and install it, you should alos find the firmware hex file for the Picstart plus I'm not 100\% sure but I think the file name is PSF23000.HEX. ANyway you can find out about it in the readme files.
Have you considered using the PIC16F877 it will give you the extra I/O
___________________________
This message was ported from CCS's old forum
Original Post ID: 3083 |
|
![](templates/subSilver/images/spacer.gif) |
Hans Wedemeyer Guest
|
Re: Out of IO... |
Posted: Sat Mar 09, 2002 12:14 pm |
|
|
That's interesting.
I had no problems with programming, I did however report a problem with MPLAB and PIC18xxx. A long time, but had forgotten all about it.
The issue, which I reported to Microchip, was this.
When importing the PIC18C452 or 252 the first time it loads correctly. But if you change the code and load the new hex file, MPLAB fails to erase the Program Memory first and creates one garbled mess, it was easy to see if the new hex version of the code is smaller than the code hex version.
Check back in the old list and you should find a much more detailed description I posted about that problem.
The workaround is simple:- Use the manual "Erase Program Memory" before loading a new hex file. Once I started doing that I never had anymore problems.
Microchip did eventually manage to duplicate the problem and said it would be fixed.
I just checked to see if the problem has been fixed in V5.50.00 and it appears to be the case. I got so in the habit of manually erasing program memory I never notice it has been fixed...
Otherwise, I program the PIC18X52 on a regular basis.
The only other issue with the PicStart Plus is the programming voltage. Some older PicStart Plus units required a resistor adjustment, I'm sure you already know about that.
For me I still have one issue with the PicStart Plus. When I use it on anyone of my dual CPU systems (three in all) running Windows 2000 or Windows NT4.0 MPLAB fails to program any chip. It knows the PicStart Plus is connected but reports a communications error everytime.
Had it been just one one system, I would have attributed the problems to that one system. But it fails the same way on 3 dual cpu systems, but always works fine on any single CPU I have here in the shop.
___________________________
This message was ported from CCS's old forum
Original Post ID: 3085 |
|
![](templates/subSilver/images/spacer.gif) |
johnpcunningham Guest
|
Re: Out of IO... |
Posted: Sat Mar 09, 2002 2:29 pm |
|
|
<font face="Courier New" size=-1>One way to turn 11 I/O into 24 I/0 would be muxing the outputs to a line driver. I guess you could use a CPLD (Altera, Lattice, Xilinx) but for a simpler approach, you could use three line drivers. Drive one of the PICs 8 output pins to each of the 8-bit line drivers and use the other 3 lines for output enables for each. A 74HC244 is fairly standard for this kind of application. Could work the same for inputs as well. My assumption is that you are driving outputs only and that these pins stay as outputs during code execution.
If you need to change some of the I/O from inputs to outputs during program execution, then you could use a tranceiver instead. One example would be a 74AC245. You would need at least 2 control pins each chip, one for T/R direction and one for OE control. That would mean you would use (8+2+2+2 = 14 pins) 14 pins to create a 24 bit output.
There are tons of different chips that could do what I'm suggesting and different companies that make them. Fairchild has a fairly good parametric search for logic and interface chips (www.fairchildsemi.com) Of course you would need to verify that your timing is good in terms of setup-hold and all of that; and that program execution is not hampered by the extra time to setup the external drivers, but I think you get what I am trying to convey. Something to think about short of going to a larger PIC device and availabel PCB real estate.
JC</font>
___________________________
This message was ported from CCS's old forum
Original Post ID: 3088 |
|
![](templates/subSilver/images/spacer.gif) |
Dave Mac Guest
|
Re: Out of IO... |
Posted: Sat Mar 09, 2002 2:32 pm |
|
|
:=:=Question: I can upgrade to the H compiler no problem. But will my PICStart Plus even work with the 18 series?
:=
:=Yes it works just fine. You will need to make sure you have the latest version of the Picstart Plus firmware when I start mine it reports V2.30.00
:=
:=Also make sure you have the latest MPLAB, I am using V5.50.00 .
:=
:=When you download MPLAB and install it, you should alos find the firmware hex file for the Picstart plus I'm not 100\% sure but I think the file name is PSF23000.HEX. ANyway you can find out about it in the readme files.
:=
:=Have you considered using the PIC16F877 it will give you the extra I/O
I bought a new picstart plus programmer and it would not work with mplab 5.5 so I reverted to 5.4 and it worked fine on a 18c452. There is a windowed eprom version of the dip 18c452, but still a bummer to erase and programm each rev test. I also recomend the 16f877 as there is support for it via ICD. And since it is a flash part you don't need a programmer other than the picdem icd. There are some piggyback boards that dock onto lcds giving you a serial interface (one wire software port). check out <a href="http://www.seetron.com/slcds.htm" TARGET="_blank">http://www.seetron.com/slcds.htm</a>
-dave
___________________________
This message was ported from CCS's old forum
Original Post ID: 3089 |
|
![](templates/subSilver/images/spacer.gif) |
Douglas Kennedy
Joined: 07 Sep 2003 Posts: 755 Location: Florida
|
Re: Out of IO... |
Posted: Sat Mar 09, 2002 5:22 pm |
|
|
Picstart plus and the 18C452 work fine as long as you don't use MPLAB5.50. MPLAB 5.4 works great but 5.50 has a picstartplus (software 2.5 firmware 2.3) and 18Cxxx combination type bug
___________________________
This message was ported from CCS's old forum
Original Post ID: 3092 |
|
![](templates/subSilver/images/spacer.gif) |
MarkHolbrook Guest
|
Re: Out of IO... |
Posted: Sat Mar 09, 2002 9:26 pm |
|
|
John, Hans, Dave, et al,
Thanks for the suggestions. I think I will look into the multiplexer approach. This is a very low speed application. The current PIC is getting the temperature over a 2.5 K baud RF link. So speed is not an issue.
I'll have to see what I need. I know that I want to drive an LCD and I think the serial based approach is easiest and requires less IO.
That leaves controlling a heater and handling a few button inputs. I think the multiplexer/transceiver approach will work.
Thanks again!
Mark
___________________________
This message was ported from CCS's old forum
Original Post ID: 3096 |
|
![](templates/subSilver/images/spacer.gif) |
Hans Wedemeyer Guest
|
Re: Out of IO... |
Posted: Sat Mar 09, 2002 10:23 pm |
|
|
Mark wrote:=
:=That leaves controlling a heater and handling a few button inputs.
Not sure what kind of heater you are going to control, but I suspect it is a regular AC powered device, if it is and unless you want protional control, for simple On/Off you are best off using a relay (solid state or mechancial).
TI makes this chip. That will give you upto eight power drivers.
TPIC6B259 POWER LOGIC 8-BIT ADDRESSABLE LATCH
This chip will sink 150mA and tolerate an inductive load like a relay, no back emf diode needed. It also cuts down on the numebr of external components.
Of the six lines required to control the eight power outputs three can be on a common bus with other data.
In effect you only need 3 lines to control 8 o/p devices.
Nothing wrong with the 245 chip but it will require extra transisitor/resistor/diode etc to interface to drive a relay.
On the subject of heater control:
I've been pondering a better control for my AC and heating. Both are central and use the same duct work. My biggest mechanical problem is finding a cheap source for motor driven control flaps to put in the air vents of each room.
Are you doing anyhting like that, or do you only require heaters control ?
___________________________
This message was ported from CCS's old forum
Original Post ID: 3097 |
|
![](templates/subSilver/images/spacer.gif) |
Jay Guest
|
Re: Out of IO... |
Posted: Sun Mar 10, 2002 5:05 am |
|
|
I'm surprised a 16F877 doesn't have enough pins! I use it for my solar pool controller and it has LCD,ArrowPad,2 SSR, 2 temp sensors,SIO to PC with lots left over. Hardest part was grouping the pins to make it 'logical' and easy to program.
In fact all my project use the 877. Maybe(OK, always) overkill, but easy to 'cut and paste' code snippets,etc, board layouts always very similar( 4 X 6 Radio Shack pph boards), making trouble shooting easy( well, easier).
With respect to motors for the duct dampers, consider using 'gutsy' RC servo units. The 'sail winch' units are real powerful, lot's of torque. The next size up from the 'standard' s-138 series should be OK.
One warning.On all 'normal' duct motors, they defalut to open, max flow ! Something to consider. Maybe a hacking of the guts, toss out 'their' electronics and add your , use only their motor/gear drive is what you can use.
A Honeywell unit up here in Ontario is about $300, servos are $30 max !
Hope this helps
Jay
___________________________
This message was ported from CCS's old forum
Original Post ID: 3100 |
|
![](templates/subSilver/images/spacer.gif) |
MarkHolbrook Guest
|
Re: Out of IO... |
Posted: Sun Mar 10, 2002 6:42 am |
|
|
Hi Hans,
Yes it is a regular household centeral heater. I haven't even gotten to the point of figuring out "what" to use to control it yet. That comes next but your chip is VERY interesting for another reason.
I have been putting together some PICs for a big bio-medical machine that we are working on. The EE does not have a load of experience in industrial control and made LOTS of mistakes that even an electrical hacker/software nerd like myself caught.
One of the functions of this station that is controlled by a PIC is a mixing station. It is a simple DC motor that runs off of 12V. Obviously a relay was used to turn it on. But the complexity came in because just turning it on was not enough. To perform the mixing action a back and forth rotation was needed. So basically he asked that I turn it on in one direction for 1/3 of a second then reverse it for a 1/3 of a second etc.
When I looked at his circuit I new we were going to have problems. He hadn't protected the relays with diodes and there was no way to disipate energy stored in the motor windings when reversing the motor. So I worked with him to solve that problem but there were lots of other errors: insuffient grounds for the PIC, mixed grounds for the motor/logic, etc. Basically it took a lot of work before the PIC driving this motor became reliable and it still isn't very good.
Your chip looks like it might really help!
On your heater question, have you checked out home automation? They have a bunch of motor controlled duct flappers. Goto
www.smarthome.com Move your mouse over the "climate control" tab. Look down the list provided and you should see "zone controllers and duct dampers".
In my case I haven't gotten to duct control. I simply at this point want to do a better job with the heater control than the current thermostat which is mounted right behind the oven so whenever the wife uses the oven the entire house temperature is off.
Mark
___________________________
This message was ported from CCS's old forum
Original Post ID: 3102 |
|
![](templates/subSilver/images/spacer.gif) |
MarkHolbrook Guest
|
Re: Out of IO... |
Posted: Sun Mar 10, 2002 6:58 am |
|
|
Jay,
the 877 probably does have enough IO however I was hoping to use the 12 bit A/D in the 773. I think the 877 has a 10 bit A/D correct?
Mark
:=I'm surprised a 16F877 doesn't have enough pins! I use it for my solar pool controller and it has LCD,ArrowPad,2 SSR, 2 temp sensors,SIO to PC with lots left over. Hardest part was grouping the pins to make it 'logical' and easy to program.
:=In fact all my project use the 877. Maybe(OK, always) overkill, but easy to 'cut and paste' code snippets,etc, board layouts always very similar( 4 X 6 Radio Shack pph boards), making trouble shooting easy( well, easier).
:=
:=With respect to motors for the duct dampers, consider using 'gutsy' RC servo units. The 'sail winch' units are real powerful, lot's of torque. The next size up from the 'standard' s-138 series should be OK.
:=One warning.On all 'normal' duct motors, they defalut to open, max flow ! Something to consider. Maybe a hacking of the guts, toss out 'their' electronics and add your , use only their motor/gear drive is what you can use.
:=A Honeywell unit up here in Ontario is about $300, servos are $30 max !
:=Hope this helps
:=Jay
___________________________
This message was ported from CCS's old forum
Original Post ID: 3103 |
|
![](templates/subSilver/images/spacer.gif) |
Hans Wedemeyer Guest
|
Re: Out of IO... |
Posted: Sun Mar 10, 2002 7:36 am |
|
|
Mark,
If I may suggest a solution for your mixer motor control.
As it is a 12 Volt DC motor and reuqires reversing, the best solution is to use a HEXTFET H-Bridge.
I did a Motor speed control (see my web site) for a fan, but used only a simple HEXFET switch, many people have ontacted me and asked me to had the H-Bridge.
Are you familiar with H-Bridges ? if not I can send you some schematics that will help.
Thanks for the info. and link to smarthome. Cost is the big issue, if the overal result is to save money on heating/cooling (more cooling in Houston) then my criteria of cheap flapper controls is critical :-) I'd hate to spend $1000.- and a bunch of time finding the whole project on decreased my utility bill by $5 a month.. In the 16-20 years it would take to recover the investment the whole thing would most likley be worn out or I will have moved house. :-) Anyway thanks for the info.
___________________________
This message was ported from CCS's old forum
Original Post ID: 3104 |
|
![](templates/subSilver/images/spacer.gif) |
Hans Wedemeyer Guest
|
Re: Out of IO... |
Posted: Sun Mar 10, 2002 7:40 am |
|
|
Thanks for the lead on the RC servo idea.
That makes me think about controlling two Venetian blinds that I have and are situated 25 foot off the floor, project coming up !
___________________________
This message was ported from CCS's old forum
Original Post ID: 3105 |
|
![](templates/subSilver/images/spacer.gif) |
Hans Wedemeyer Guest
|
Re: Out of IO... |
Posted: Sun Mar 10, 2002 7:50 am |
|
|
Just a thought for the ADC, and keepng I/O requirements low, you could add a SPI driven ADC I remember the CCS examples have code already made for the LTC1298 12 bit ADC.
hansw
___________________________
This message was ported from CCS's old forum
Original Post ID: 3106 |
|
![](templates/subSilver/images/spacer.gif) |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|