Search found 143 matches

Return

by medelec35
Thu Sep 20, 2018 7:14 am
Jump to forum
Jump to topic

Re: Flowcode 6 & PicKit 2 [SOLVED]

Hi John, Your welcome. Gald the issues have been solved. I have changed the title to reflect this. I was looking around the forum and I found a issue with the Compiler. In windows 10 you need to set Flowcode to Administrator. I did that and Flowcode worked. Yes, it shows you that in the last link I ...
by mnf
Sat Oct 06, 2018 8:39 am
Jump to forum
Jump to topic

Re: Random selections

Hi John, What a cool (or should that be ghoul?) project.... There are many ways to achieve what you want - depending on how 'random' you want the ghosts to be: A few suggestions: 1) If the ghosts are 'started' by a sensor - then use a timer / counter and look at the value when the person trips the s...
by medelec35
Sat Oct 20, 2018 8:29 pm
Jump to forum
Jump to topic

Re: Faster detection on Port A0

Really nice to hear from you on my newest project Thanks John, Happy to help Would I not be in the same pickle with the timer ? I don't believe it would be the same pickle at all! Both interrupts are placed at the start so are only ever enabled once. Add a timer2 interrupt and set the properties fo...
by medelec35
Sat Oct 20, 2018 11:34 pm
Jump to forum
Jump to topic

Re: Faster detection on Port A0

Hi John,
Made some corrections for you.
See how you get on with flowchart now.
You need to make sure your other call macros are correct.
by medelec35
Sun Oct 21, 2018 9:59 am
Jump to forum
Jump to topic

Re: Faster detection on Port A0

As the seconds continuously count up (or you could have it to count down) in the background, you can have the seconds displayed live.
Just within the main loop place a LCD print number macro for the seconds.
best to place a 100ms delay also within the main loop so LCD is not being updated too fast.
by medelec35
Sun Oct 21, 2018 6:25 pm
Jump to forum
Jump to topic

Re: Faster detection on Port A0

I have made a fair few changes. You definitely don't require 2 timer interrupts. I only had timer2 in mind as the timing is much more accurate than timer0 Should work on hardware better than simulation. At all times you should see on the display exactly how many seconds are left including the 10 &am...
by medelec35
Sun Oct 21, 2018 8:58 pm
Jump to forum
Jump to topic

Re: Faster detection on Port A0

Glad it works like a charm. In my Main at the start is there a cleaner way to reset the PortC and Port A Yes just output 255 to the Entire port rather than 1 to a Single Bit . Just select each bit that has to be at 5V. Make sure any other bits that you don't want to be at 5V are not selected. I see ...
by medelec35
Sun Nov 18, 2018 12:55 am
Jump to forum
Jump to topic

Re: DFPlayer Build

Hi John, DFPlayer can work from about 3.2 to 5V. The Resistor goes from MCU TX to DFPlayer RX All makes of SD cards i have tried seem to work I'm currently using 16G Scandisk There are two ways of placing the files on the SD card. 1 which is the best way: Make a folder called MP3 on the root of sd c...
by medelec35
Sun Nov 18, 2018 4:00 pm
Jump to forum
Jump to topic

Re: DFPlayer Build

Hi John, Attached are mp3 files for testing that will count from one to ten and back down again. It's using command 0x12. For some silly reason that is the main command for playing a track number, but was left off the data sheet. What you can see on the datasheet is 0x03. that is Play FAT file numbe...
by medelec35
Mon Nov 19, 2018 7:40 pm
Jump to forum
Jump to topic

Re: DFPlayer Build

Hi John To make a track 3 play for example: Commands = 0x12 CommandFeedback = 0 Parameter1HighByte = 0 //Track number HB Parameter2LowByte = 3 //Track number LB You may find it easer if using decimal instead of hex. If you want to play a track number less then 255 then keep Parameter1HighByte at 0 P...
by medelec35
Tue Nov 20, 2018 8:58 pm
Jump to forum
Jump to topic

Re: DFPlayer Build

Hi John, Whenever you create a new project, ALWAYS connect an LED via a resistor with Loop: LED on, 1sec, LED off, sec. You must make sure the LED is flashing at the correct rate. If with your project RS232 is not at the correct baud rate because osc at running at wrong speed, then project will not ...
by medelec35
Wed Nov 21, 2018 8:23 am
Jump to forum
Jump to topic

Re: DFPlayer Build

Hi John,
Glad its working now.
Thanks for the update.
by medelec35
Thu Jan 24, 2019 6:56 am
Jump to forum
Jump to topic

Re: Servo Issue

Hi John
If you look at the screen shot of the pickit settings, it's showing the device as 16LF1938 (low voltage version) instead of 16F1938.
Check and change your target device.
by medelec35
Sun Jan 27, 2019 1:49 am
Jump to forum
Jump to topic

Re: Servo Issue

Hi John, Not a problem The osccon registor within a c code block sets the internal osc speed. You have got that C code block disabled. You are showing nothing connected to MCLR pin, yet that is enabled within configuration settings. If you have not got anything connected to MCLR pin, then it must be...
by medelec35
Tue Jan 29, 2019 9:58 pm
Jump to forum
Jump to topic

Re: Servo Issue

Martin are you indicating on the "little as possible" for interupts that If I use (B0) as my button trigger I can't use pins (B1-B7) for any action ? Yes you can but within the interrupt set a variable depending on what button is pressed. You can have inputs which won't cause any issues t...
by medelec35
Thu Jan 31, 2019 9:59 pm
Jump to forum
Jump to topic

Re: Servo Issue

Hi John, Have you done a one second flash test to see if everything is set up correctly? If so will be surprised if delays are correct as you still got osccon statement commented out. If the delays are way out then the 1 - 2 ms required for servo will be wrong causing access current and servo to bur...
by medelec35
Fri Feb 01, 2019 8:49 am
Jump to forum
Jump to topic

Re: Servo Issue

I didn't know about the Button bounce protection. I use to use the Button properties That is only when you use The switch component macros i.e. ReadState, WaitUntilHigh & WaitUntilLow. As they are not used within interrupt, then debouncing will be required. ? Not sure how to do a "one seco...
by medelec35
Sat Feb 02, 2019 11:30 am
Jump to forum
Jump to topic

Re: Servo Issue

Sounds to me like a hardware issue. Could be the power supply not up to the job. The way to find out is scope the servo signal line with servo disconnected. If it's steady at say 1.5ms every 20ms then is not software. With servo connected and playing up, scope power supply line. You may have to set ...
by medelec35
Fri Mar 08, 2019 6:28 pm
Jump to forum
Jump to topic

Re: DFPlayer Bug

Hi John, If you look a the DFPlayer datasheet, it will state that all commands start by sending 0x7E. If you look at your flowchart, within SendBytes macro the send 0x7E has been changed to Receive and 0x7E you supposed to be sending is being used as the Timeout. You need to change it back! Same wit...
by medelec35
Fri Mar 15, 2019 6:42 am
Jump to forum
Jump to topic

Re: DFPlayer Bug

The program I posted automatically calculates the correct checksum for every command.
Is that where you are learning the checksum formula from?

Congratulations to your daughter, you must be one proud dad?
by medelec35
Fri Mar 15, 2019 6:30 pm
Jump to forum
Jump to topic

Re: DFPlayer Bug

Hi John, The high and low number is just a 16bit integer number that has been spilt into two bytes! Track number (integer) HighByte LowByte 1 0 1 2 0 2 3 0 3 ... 255 0 255 256 1 0 257 1 1 If the track you are interested in is track 4 just use: Commands = 0x12 CommandFeedback = 0x00 Parameter1HighByt...
by Benj
Wed Mar 20, 2019 5:36 pm
Jump to forum
Jump to topic

Re: Error Code 34

Hello John,

Have you tried unplugging the PICkit from the USB and also restarting your PC. Could simply be that the PICkit has become stuck or ran out of memory etc.
by medelec35
Wed Mar 20, 2019 8:15 pm
Jump to forum
Jump to topic

Re: Error Code 34

Hi John, You need to select Build, View C. Let's look at Pitcher Master 2019.c(3655:15): warning: expression was optimized out the C code view window that pops up, scroll down to line 3655: optimized out.png It's pointing to the calculation Keypress = Keypress That's just a waste of a calculation! I...
by medelec35
Fri Mar 22, 2019 6:13 pm
Jump to forum
Jump to topic

Re: Math with Variable

Hi John,
What about just adding another variable?
HM OR VM.png
by medelec35
Fri Mar 29, 2019 6:49 am
Jump to forum
Jump to topic

Re: Math with Variable

If it fails on one condition then the code within decision branch can be altered to deal with that condition.
So long as you know what you want to happen should that condition occur.