It is possible to do what you are described (and much more) with a single PIC.
It is possible to do what you are described (and much more) with a single PIC.
Hi All,
I agree with you that 60% or more could be fit for using single PIC.
Real applications require more than one PIC by my point of view.
For example: Inductive heating require frequencies from 200 up to 500 KHz.
The first task is generating starting frequency 200 KHz.
Second one is increasing frequency up to resonance point slowly it mean that find
minimum current point and keep it near minimum.
Due to nature of metals that is changing its parameters resonance point will be moving
so increasing or decreasing frequency.
Third task is to send to LCD data about heating – temperature, frequency.
Fourth task is generate heat for specific period of time after temperature in
metal equal needed.
Fifth task is keeping cooling water flow and stop heating if water is not in system
(broken hose).
Sixth task is giving signal to robot to take detail off and put new one.
Seventh task is status of process indication by LED and sound.
So as you see it is not possible to use single PIC for these applications.
Process of heating has to be continuous without interruption otherwise
PIC will loose resonance point.
Before resonance point here is high current.
After passing resonance point current is increasing.
Resonance only has low current.
I can write examples of many applications that require 2 PICs not one.
Best Regards to All
![]()
Sure, you can do all that with single PIC (and even much more), if you know how. I wouldn't use the ones you mentioned though.
Hi All,
I am still learning to keep my brain from drying and I will appreciate any tips or tricks
to show me how to work in right way.
In early eighty I already learned processor architecture and had learning experience
How to write program in binary that processor understand (just BIOS).
I did not use this knowledge in my working experience.
Right now PIC for me is just a nail and PICBASIC PRO is just a hummer.
So using both of them I able to put together hardware and technology.
Doing this in easy way I am pretty sure that double core PIC has
advantage than using single advanced and expensive PIC for multitasking program
Especially if you are not a ghost living in microprocessor and manually turn on or off
bits in registers.
In my example I am not agree that to generate frequency and find minimum can be done
by using one comparator:
OSC 20 MHz
NUM var WORD
DELTA var WORD
CMCON=%00000101 ‘ set
DELTA = 2500
Run:
PORTB.0 =%00000001
CALL WAITA
IF CMCON=%10000101 Then Delta = DELTA -1‘ if digital more than reference
PORTB.0 =%00000000
CALL WAITA
GOTO RUN
WAITA:
FOR NUM = 0 TO DELTA
@ useless statement
NEXT NUM
OR write statements in assembler or better in binary code
For frequency 200KHz period on is equal 2.5uSec and off 2.5uSec.
For right heating condition needs to be in 10Hz range so 200000+10 = 200010KHz
It is means steps on is equal 1.5nSec and off 1.5nSec.
So variable NUM has step 1.5nSec and max value is equal 3333
For 500KHz you can calculate more strange numbers.
How is it possible to send SEROUT message that last 2mSec when microprocessor
Is Working on generating frequency and time needed for one operation is 200nSec?
My guess that your expertise ends here because using one PIC cannot do this task
Any comments?
Best Regards to ALL
Hi hardcore,
The key is to use the PIC's built in peripheral modules. Most "modern" PICs have at least one CCP module (Capture Compare PWM module) that, in conjunction with one of the PIC's hardware timers can be set up to generate any frequency and duty cycle you want (within limits depending on oscillator speed etc). The PBP command HWPM uses the CCP module to do this but it has it's limitations which you can get around by writing the registers manually.
Let's see, a 16F628 running at 20Mhz....(this is untested but try it out, read the datasheet section on CPP module and TMR2 in this case)Another very common peripheral is the USART (16F628 has one) which can be used to send data out over a serial line, it is also hardware so you set it up for the baudrate you want (or let PBP so it for you) and then just write a character to it and IT will send it out - no need to bit-bang it out with SEROUT. The PBP command HSEROUT for example uses the hardware USART to send data.Code:DEFINE OSC 20 TRISB.3 = 0 'Set CCP pin to output. CCP1CON = %00001100 'CCP module in PWM mode PR2 = 9 '~500kHz TMR2L = 20 '~50% duty cycle at 500kHz T2CON = %00000100 'TMR2 ON, prescaler 1:1 Main: 'Do whatever. Goto Main
There are several other hardware periphelals bulit in to most PICs that you have to master and take advantage of. Think of it, it's only the last couple of years that the CPU's used in modern PC's have gone "multi-core" yet they've been able to get them doing quite a bit of work "in parallel" by using IT'S hardware peripherals and clever time-slicing and other multitasking tricks.
If you REALLY think you need "multi-core" then take a look at Parallax Propeller chip, it has 8 CPUs with shared RAM and some pretty cool things can be done with it. (Never tried one myself though).
/Henrik.
Dear Henrik,
Always when we speak about feedback than best solution is analog schematics.
Unfortunately, especially when needs to generate frequency in SWEEP MODE.
Start at 200KHz and go up with 10 Hz step until schematics find optimum.
When optimum frequency is found then needs continuously adjust frequency by monitoring voltage
on serial/parallel resonance output LC module and keep it close to zero.
Using traditional PIC architecture does not allow to do that.
So idea about dual core PIC with bridges between registers keeping variables is advance move in right direction.
Few words about USART. I read all literature and could not found how assigned
PORTB.Pin can send periodically variable values to serial LCD without involving
CPU resources for example 4 times per Sec.
About Propeller Chip: It is really good for gathering information, scaling data, and
sending data to storage.For me 8 CPU is too much and will never be using in any hobby applications
except special industrial ones.Will be better if manufacturerdesign
this chip with 2-4 cores and inner bridges between registers.It will give more freedom.
Best Regards to All
Bookmarks