PIC output for piezo transducer
Moderator: Benj
-
- Matrix Staff
- Posts: 9520
- Joined: Sat May 05, 2007 2:27 pm
- Location: Northamptonshire, UK
- Has thanked: 2585 times
- Been thanked: 3815 times
- Contact:
Re: PIC output for piezo transducer
Yes it's still v3, but the difference is if you use flowcode view, project options.
It should allow you to select 12F1840 as a target device.
Its always best to keep configuration settings in advance mode.
To do that select Chip from menu then configure.
Select options and make sure use simple config screen is unchecked.
It should allow you to select 12F1840 as a target device.
Its always best to keep configuration settings in advance mode.
To do that select Chip from menu then configure.
Select options and make sure use simple config screen is unchecked.
Martin
-
- Flowcode V4 User
- Posts: 382
- Joined: Tue Nov 01, 2011 4:28 pm
- Has thanked: 196 times
- Been thanked: 26 times
- Contact:
Re: PIC output for piezo transducer
Hi Martin - I tried the progrmmed chip out but I get a tiny click every second or so and after a pause of approx 15 seconds I can just make out a VERY high pitched rising tone which then disappears until same thing after another 15 secs
-
- Flowcode V4 User
- Posts: 382
- Joined: Tue Nov 01, 2011 4:28 pm
- Has thanked: 196 times
- Been thanked: 26 times
- Contact:
Re: PIC output for piezo transducer
also - apologies as I had not realised your last post was there cos I didn't see the page 2 button!
-
- Matrix Staff
- Posts: 9520
- Joined: Sat May 05, 2007 2:27 pm
- Location: Northamptonshire, UK
- Has thanked: 2585 times
- Been thanked: 3815 times
- Contact:
Re: PIC output for piezo transducer
Hi Chris.
I found a transducer and connected it up to a different target device, and that woks ok, not how your description.
Have you done a 1 second flasher test. I guess you can use transducer instead of LED.
Make sure it clicks every 1/2 second as there could be something amiss with your configuration settings.
What are you setting osc speed to?
I found a transducer and connected it up to a different target device, and that woks ok, not how your description.
Have you done a 1 second flasher test. I guess you can use transducer instead of LED.
Make sure it clicks every 1/2 second as there could be something amiss with your configuration settings.
What are you setting osc speed to?
Martin
-
- Flowcode V4 User
- Posts: 382
- Joined: Tue Nov 01, 2011 4:28 pm
- Has thanked: 196 times
- Been thanked: 26 times
- Contact:
Re: PIC output for piezo transducer
Hi Martin,
Not sure how one implements the one second flasher test?
The oscillator speed is set to 8 meg and the clicks which I thought were about a second apart, probably ARE - as you say - about 1/2 second.
When I go to configure on flow chart, it shows 'simple - slot 2; the wrong chip and the 1840 is not listed and set to RC. I then select expert config and everything is DISABLED apart from "INTOSC oscilator (fine!) and Brown out reset voltage at 1.9 (only got choice of that or 2.5v anyway of course). Does show correct chip, as it does in view, project options.
I have used the i/o and o/p pins you said and I hadn't - to begin with taken the MCLR pin to pos via a 10k resistor but then having done so it made no difference. I have left the unused pins un-connected.
Not sure what I am doing wrong but there has to be light at the end of the tunnel since your set up is working.
Chris
Not sure how one implements the one second flasher test?
The oscillator speed is set to 8 meg and the clicks which I thought were about a second apart, probably ARE - as you say - about 1/2 second.
When I go to configure on flow chart, it shows 'simple - slot 2; the wrong chip and the 1840 is not listed and set to RC. I then select expert config and everything is DISABLED apart from "INTOSC oscilator (fine!) and Brown out reset voltage at 1.9 (only got choice of that or 2.5v anyway of course). Does show correct chip, as it does in view, project options.
I have used the i/o and o/p pins you said and I hadn't - to begin with taken the MCLR pin to pos via a 10k resistor but then having done so it made no difference. I have left the unused pins un-connected.
Not sure what I am doing wrong but there has to be light at the end of the tunnel since your set up is working.
Chris
-
- Matrix Staff
- Posts: 9520
- Joined: Sat May 05, 2007 2:27 pm
- Location: Northamptonshire, UK
- Has thanked: 2585 times
- Been thanked: 3815 times
- Contact:
Re: PIC output for piezo transducer
Just a thought.
When you changed target device, did you make sure pot on both simulator and hardware match up?
Does altering the pot change the rate of change?
When I tried, I could make it sound like a car alarm going off when running at a fast rate.
I will be altering flowchart to see if i can make improvements.
When you changed target device, did you make sure pot on both simulator and hardware match up?
Does altering the pot change the rate of change?
When I tried, I could make it sound like a car alarm going off when running at a fast rate.
I will be altering flowchart to see if i can make improvements.
Martin
-
- Flowcode V4 User
- Posts: 382
- Joined: Tue Nov 01, 2011 4:28 pm
- Has thanked: 196 times
- Been thanked: 26 times
- Contact:
Re: PIC output for piezo transducer
Hi Martin, I have got a 100k pot and slowly rotated thro' the whole range backwards and forwards (so I guess I should have 'struck' the appropriate match) and I think it might have altered the rate of change but the very high pitch going up only lasts for second or two.
1. Should the simulator pot change the PWM graphic on the flowchart, as I dont get any change.
2. Have I set my config settings ok - virtually everything disabled?
3. Are you using a piezo disc transducer DIRECTLY connected to the output of the chip - mine goes into the same circuitry I have got for the original potted driver.
4. Are you in ageement with my chip connections?
4. The sound you are describing sounds right to me so great - just going to have another go with it now and try driving piezo direct
Chris
1. Should the simulator pot change the PWM graphic on the flowchart, as I dont get any change.
2. Have I set my config settings ok - virtually everything disabled?
3. Are you using a piezo disc transducer DIRECTLY connected to the output of the chip - mine goes into the same circuitry I have got for the original potted driver.
4. Are you in ageement with my chip connections?
4. The sound you are describing sounds right to me so great - just going to have another go with it now and try driving piezo direct
Chris
-
- Flowcode V4 User
- Posts: 382
- Joined: Tue Nov 01, 2011 4:28 pm
- Has thanked: 196 times
- Been thanked: 26 times
- Contact:
Re: PIC output for piezo transducer
Have just tried connecting the piezo and results are exactly the same.. This seems like something to do with my settings somewhere. The rising tone is so high it goes higher than the audible range and I think the long delay between the lowest frequency points is because the whole action is happening a long way into high freqency area. I will await your comments as I not sure how mine is not working as yours is.
Chris
Chris
-
- Matrix Staff
- Posts: 9520
- Joined: Sat May 05, 2007 2:27 pm
- Location: Northamptonshire, UK
- Has thanked: 2585 times
- Been thanked: 3815 times
- Contact:
Re: PIC output for piezo transducer
Not sure, perhaps if you post your flowchart, I can have a look at it for you.
Martin
-
- Flowcode V4 User
- Posts: 382
- Joined: Tue Nov 01, 2011 4:28 pm
- Has thanked: 196 times
- Been thanked: 26 times
- Contact:
Re: PIC output for piezo transducer
I copied it over into my Matrix file areas and the graphic does appear to be working and I guess the duty cycle of 50% is what is needed - anyway, here it is......
-
- Flowcode V4 User
- Posts: 382
- Joined: Tue Nov 01, 2011 4:28 pm
- Has thanked: 196 times
- Been thanked: 26 times
- Contact:
Re: PIC output for piezo transducer
Hi Martin,
Is it anything to do with the chip I am actually using i.e. the 1840?
Chris
Is it anything to do with the chip I am actually using i.e. the 1840?
Chris
-
- Matrix Staff
- Posts: 9520
- Joined: Sat May 05, 2007 2:27 pm
- Location: Northamptonshire, UK
- Has thanked: 2585 times
- Been thanked: 3815 times
- Contact:
Re: PIC output for piezo transducer
Hi Chris,
The only thing I can think of is PLL in configuration settings is enabled.
Can you try disabling it and recompiling.
If PLL enabled, and internal osc is set to 8MHz,then internal osc can run at 8 x 4 = 32MHz
Which is what i'm planing for a different version.
Just lack of time at the moment.
Martin
The only thing I can think of is PLL in configuration settings is enabled.
Can you try disabling it and recompiling.
If PLL enabled, and internal osc is set to 8MHz,then internal osc can run at 8 x 4 = 32MHz
Which is what i'm planing for a different version.
Just lack of time at the moment.
Martin
Martin
-
- Flowcode V4 User
- Posts: 382
- Joined: Tue Nov 01, 2011 4:28 pm
- Has thanked: 196 times
- Been thanked: 26 times
- Contact:
Re: PIC output for piezo transducer
Yep, I will have a go at that - I think it IS the very very high frequency MY arrangement (for one reason or another) is running at that is my problem and apart fom anything else it is naturally a long way from the resonant Fq of the piezo. I also know from experience that as frequency goes up with piezos the volume reduces very dramatically leaving aside the resonant Fq side of things. It is obvious from the graphs anyway.
Basically I'm sure your suspicions are correct. I need to address this whole issue of speed/timing as I havent needed to so far and I don't understand it at the moment but I also need to have an understanding for future projects. Only problem is finding time - we are all in the same boat, I know!
Best wishes'
Cheers,
Chris
Basically I'm sure your suspicions are correct. I need to address this whole issue of speed/timing as I havent needed to so far and I don't understand it at the moment but I also need to have an understanding for future projects. Only problem is finding time - we are all in the same boat, I know!
Best wishes'
Cheers,
Chris
-
- Flowcode V4 User
- Posts: 382
- Joined: Tue Nov 01, 2011 4:28 pm
- Has thanked: 196 times
- Been thanked: 26 times
- Contact:
Re: PIC output for piezo transducer
Hi anyone got any ideas why I get this failure when compiling - This previously compiled quite happily before and have only disabled some things in the config listing. I HAVE repaired the the MM v4 in 'computer' several times but no joy.
Any thoughts greatly appreciated
Chris
Starting preprocessor: c:\PROGRA~1\MATRIX~1\FLOWCO~1\boostc\pp.exe "Sweep output 12F683 V1.c" -i c:\PROGRA~1\MATRIX~1\FLOWCO~1\boostc\include -d _PIC12F1840 -la -c2 -o "Sweep output 12F683 V1.pp" -v -d _BOOSTC -d _PIC16 -d _PIC16x -d _CHAR_INDEX
.......
Sweep output 12F683 V1.c success
success
Return code = 0
Launching the linker/assembler...
c:\program files\matrix multimedia\flowcode v4\boostc\boostlink_pic.exe -ld "C:\Program Files\SourceBoost\lib" libc.pic16.lib "Sweep output 12F683 V1.obj" -t PIC12F1840 -d "C:\Users\dad\Documents\AI Matrix piezo" -p "Sweep output 12F683 V1"
BoostLink Optimizing Linker Version 7.03
http://www.sourceboost.com
Copyright(C) 2004-2011 Pavel Baranov
Copyright(C) 2004-2011 David Hobday
Error: Failed to open:libc.pic16.lib or C:\Program Files\SourceBoost\lib/libc.pic16.lib
failure
Return code = -2
Flowcode was unable to assemble the ASM file due to the following errors:
FINISHED
Any thoughts greatly appreciated
Chris
Starting preprocessor: c:\PROGRA~1\MATRIX~1\FLOWCO~1\boostc\pp.exe "Sweep output 12F683 V1.c" -i c:\PROGRA~1\MATRIX~1\FLOWCO~1\boostc\include -d _PIC12F1840 -la -c2 -o "Sweep output 12F683 V1.pp" -v -d _BOOSTC -d _PIC16 -d _PIC16x -d _CHAR_INDEX
.......
Sweep output 12F683 V1.c success
success
Return code = 0
Launching the linker/assembler...
c:\program files\matrix multimedia\flowcode v4\boostc\boostlink_pic.exe -ld "C:\Program Files\SourceBoost\lib" libc.pic16.lib "Sweep output 12F683 V1.obj" -t PIC12F1840 -d "C:\Users\dad\Documents\AI Matrix piezo" -p "Sweep output 12F683 V1"
BoostLink Optimizing Linker Version 7.03
http://www.sourceboost.com
Copyright(C) 2004-2011 Pavel Baranov
Copyright(C) 2004-2011 David Hobday
Error: Failed to open:libc.pic16.lib or C:\Program Files\SourceBoost\lib/libc.pic16.lib
failure
Return code = -2
Flowcode was unable to assemble the ASM file due to the following errors:
FINISHED
-
- Matrix Staff
- Posts: 9520
- Joined: Sat May 05, 2007 2:27 pm
- Location: Northamptonshire, UK
- Has thanked: 2585 times
- Been thanked: 3815 times
- Contact:
Re: PIC output for piezo transducer
Problem looks like the liknker boost c directory settings are wrong.
Can you click on Chip/Compiler options.
Then click on Restore Defaults.
If you look at:
http://www.matrixmultimedia.com/support ... f=22&t=683
That shows the correct paths.
You have got:
c:\program files\matrix multimedia\flowcode v4\boostc\boostlink_pic.exe -ld "C:\Program Files\SourceBoost\lib" libc.pic16.lib
The C:\Program Files\SourceBoost should be:
C:\Program Files\matrix multimedia\flowcode v4\boostc
etc.
Martin
Can you click on Chip/Compiler options.
Then click on Restore Defaults.
If you look at:
http://www.matrixmultimedia.com/support ... f=22&t=683
That shows the correct paths.
You have got:
c:\program files\matrix multimedia\flowcode v4\boostc\boostlink_pic.exe -ld "C:\Program Files\SourceBoost\lib" libc.pic16.lib
The C:\Program Files\SourceBoost should be:
C:\Program Files\matrix multimedia\flowcode v4\boostc
etc.
Martin
Martin
-
- Flowcode V4 User
- Posts: 382
- Joined: Tue Nov 01, 2011 4:28 pm
- Has thanked: 196 times
- Been thanked: 26 times
- Contact:
Re: PIC output for piezo transducer
Ahh - thanks Martin - I have been trying various things to get it going but to no avail. Just come 'back to it'! I will follow your advice - many thanks, Chris
-
- Flowcode V4 User
- Posts: 382
- Joined: Tue Nov 01, 2011 4:28 pm
- Has thanked: 196 times
- Been thanked: 26 times
- Contact:
Re: PIC output for piezo transducer
Yes that allowed it to compile but it wont programme the chip and it comes up with this message:
Unable to transfer the Hex file using:
[INSTALLDIR]tools\PPP\PPPv3.exe-cs2-chip PIC12LF1840-nogui
"Sweep output 12F683 V1.hex
Check programmer location and options are correct
Is this another problem or if I follow the link you showed in your post, it should sort it?
Unable to transfer the Hex file using:
[INSTALLDIR]tools\PPP\PPPv3.exe-cs2-chip PIC12LF1840-nogui
"Sweep output 12F683 V1.hex
Check programmer location and options are correct
Is this another problem or if I follow the link you showed in your post, it should sort it?
-
- Matrix Staff
- Posts: 9520
- Joined: Sat May 05, 2007 2:27 pm
- Location: Northamptonshire, UK
- Has thanked: 2585 times
- Been thanked: 3815 times
- Contact:
Re: PIC output for piezo transducer
Hi Chris,
For that you need to see this:
http://www.matrixmultimedia.com/support ... f=22&t=612
Martin
For that you need to see this:
http://www.matrixmultimedia.com/support ... f=22&t=612
Martin
Martin
-
- Flowcode V4 User
- Posts: 382
- Joined: Tue Nov 01, 2011 4:28 pm
- Has thanked: 196 times
- Been thanked: 26 times
- Contact:
Re: PIC output for piezo transducer
Hi Martin,
Just spent the time updating everything and tried to compile and it went back to the first problem and when I looked at what i had just put right it had reverted back to all the lower case stuff. Had to redo all those parameters cos default didnt do the job. I have just come back to the forum and I see your post so will check that out
HOW CAN THIS HAPPEN though? I have a feeling I have done something wrong when I did the PPPv3 update - maybe?
Just spent the time updating everything and tried to compile and it went back to the first problem and when I looked at what i had just put right it had reverted back to all the lower case stuff. Had to redo all those parameters cos default didnt do the job. I have just come back to the forum and I see your post so will check that out
HOW CAN THIS HAPPEN though? I have a feeling I have done something wrong when I did the PPPv3 update - maybe?
-
- Matrix Staff
- Posts: 9520
- Joined: Sat May 05, 2007 2:27 pm
- Location: Northamptonshire, UK
- Has thanked: 2585 times
- Been thanked: 3815 times
- Contact:
Re: PIC output for piezo transducer
The PPP update was just copying and pasting.christoph wrote:I have a feeling I have done something wrong when I did the PPPv3 update - maybe?
Have you got anything else that uses boostC.
The [INSTALLDIR] can happen with some installations, so nothing you have done wrong.
The [INSTALLDIR] appeared because of the reset to defaults.
In a lot of cases that does not happen.
Martin
-
- Flowcode V4 User
- Posts: 382
- Joined: Tue Nov 01, 2011 4:28 pm
- Has thanked: 196 times
- Been thanked: 26 times
- Contact:
Re: PIC output for piezo transducer
Hi Martin - the trouble is I corrected that on the fly anyway but as I say it has just ignored all my corrections - how do I get it to 'stick'! The link just says when done press 'OK'
OK - I just checked and I restored to defaults and all the lower case stuff got corrected but it put back the [.....] 'thingy'. so hopefully I just need to correct THAT and might be ok.
Just reverting back to PPP, should I perhaps have deleted the re-titled old file? which I havent so far. I also see what you meant re v3 - it is v3.something!
I will let you know shortly if latest try is successful
OK - I just checked and I restored to defaults and all the lower case stuff got corrected but it put back the [.....] 'thingy'. so hopefully I just need to correct THAT and might be ok.
Just reverting back to PPP, should I perhaps have deleted the re-titled old file? which I havent so far. I also see what you meant re v3 - it is v3.something!
I will let you know shortly if latest try is successful
-
- Flowcode V4 User
- Posts: 382
- Joined: Tue Nov 01, 2011 4:28 pm
- Has thanked: 196 times
- Been thanked: 26 times
- Contact:
Re: PIC output for piezo transducer
BINGO! - that sorted it and the chip programmed successfully.
Very useful bit of knowledge there.
Dont think I am going to get time to try chip tonight but with the PLL business probably the answer to the frequency problem (disabled) I am hoping tomorrow will bring the desired results - will let you know!
Many thanks for all that
All the best
Chris
Very useful bit of knowledge there.
Dont think I am going to get time to try chip tonight but with the PLL business probably the answer to the frequency problem (disabled) I am hoping tomorrow will bring the desired results - will let you know!
Many thanks for all that
All the best
Chris
-
- Flowcode V4 User
- Posts: 382
- Joined: Tue Nov 01, 2011 4:28 pm
- Has thanked: 196 times
- Been thanked: 26 times
- Contact:
Re: PIC output for piezo transducer
Just one other curiosity!....
AS THE PROGRAMMING OF THE CHIP NEARS COMPLETION IT comes up with a message to say the chip in the development board is not the same as the one on the flowchart etc and gives two options (the programming lamp is flashing in a waiting state). In this case it gives the 1840 I AM using and a PIC16F722A! If I autodetect using any of the several places that is possible inclucing PPP, it also comes up with the 722A! I would be interested if there was any explanation particularly as it is a '16' and not a '12'?
AS THE PROGRAMMING OF THE CHIP NEARS COMPLETION IT comes up with a message to say the chip in the development board is not the same as the one on the flowchart etc and gives two options (the programming lamp is flashing in a waiting state). In this case it gives the 1840 I AM using and a PIC16F722A! If I autodetect using any of the several places that is possible inclucing PPP, it also comes up with the 722A! I would be interested if there was any explanation particularly as it is a '16' and not a '12'?
-
- Flowcode V4 User
- Posts: 382
- Joined: Tue Nov 01, 2011 4:28 pm
- Has thanked: 196 times
- Been thanked: 26 times
- Contact:
Re: PIC output for piezo transducer
Just run thro. config and re-programming and it happens every time. Have checked and everything else says 1840!
-
- Posts: 1314
- Joined: Sun Jan 15, 2012 3:15 pm
- Has thanked: 474 times
- Been thanked: 458 times
- Contact:
Re: PIC output for piezo transducer
Hi
go to your ppp folder, place the following files somewhere safe ppp_config_data1 and ppp_config_data2 .
then place the attached file into your ppp folder and try again
let me know if it works ok
Regards
Dazz
go to your ppp folder, place the following files somewhere safe ppp_config_data1 and ppp_config_data2 .
then place the attached file into your ppp folder and try again
let me know if it works ok
Regards
Dazz
To sign up to the V5 forum follow this link http://www.matrixmultimedia.com/forum_upgrades.php