Cancel Command ?
- acestu
- Posts: 1720
- Joined: Thu Dec 01, 2011 9:36 pm
- Location: Macclesfield UK
- Has thanked: 783 times
- Been thanked: 223 times
- Contact:
Cancel Command ?
Hi,
I was wondering if there was some sort of command that will halt a running program so that you can use a cancel button, or is it more complicated than that.
I have just been working on a trailer light test project with the help of the good guys on this forum, however I would like to add a cancel button to it.
Any suggestions welcome
Thanks in advance
Acestu
I was wondering if there was some sort of command that will halt a running program so that you can use a cancel button, or is it more complicated than that.
I have just been working on a trailer light test project with the help of the good guys on this forum, however I would like to add a cancel button to it.
Any suggestions welcome
Thanks in advance
Acestu
Laptop Mac Book Pro i7 retina El Capitan //// Tower/Intel i7-Windows 7 64 Bit, Toshiba i5 Laptop Windows 10
Computers are like air conditioners. They work fine until you start opening windows.
Computers are like air conditioners. They work fine until you start opening windows.
- Enamul
- Posts: 1772
- Joined: Mon Mar 05, 2012 11:34 pm
- Location: Nottingham, UK
- Has thanked: 271 times
- Been thanked: 814 times
- Contact:
Re: Cancel Command ?
Hi Stuart,
I have added cancel functionality in RB0 pin which is implemented by INT. That's why I have to shift LCD bits from RB1 to RB6. Start bit to RB7.
You can now cancel anytime in test mode..
I have added cancel functionality in RB0 pin which is implemented by INT. That's why I have to shift LCD bits from RB1 to RB6. Start bit to RB7.
You can now cancel anytime in test mode..
- Attachments
-
- Trailer_testV6.fcf
- (29.46 KiB) Downloaded 222 times
-
- 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: Cancel Command ?
The way Enamul has implemented cancel function I would agree is the best way to do it.
What I would also add to the flowchart is an output which resets port A to 0 just after connection point A: This will turn off any lights that are currently on just prior to test being cancelled
Martin
What I would also add to the flowchart is an output which resets port A to 0 just after connection point A: This will turn off any lights that are currently on just prior to test being cancelled
Martin
Martin
- acestu
- Posts: 1720
- Joined: Thu Dec 01, 2011 9:36 pm
- Location: Macclesfield UK
- Has thanked: 783 times
- Been thanked: 223 times
- Contact:
Re: Cancel Command ?
Thank you so much guys, I will have a look at this when I get home...
Cheers
Acestu
Cheers
Acestu
Laptop Mac Book Pro i7 retina El Capitan //// Tower/Intel i7-Windows 7 64 Bit, Toshiba i5 Laptop Windows 10
Computers are like air conditioners. They work fine until you start opening windows.
Computers are like air conditioners. They work fine until you start opening windows.
- acestu
- Posts: 1720
- Joined: Thu Dec 01, 2011 9:36 pm
- Location: Macclesfield UK
- Has thanked: 783 times
- Been thanked: 223 times
- Contact:
Re: Cancel Command ?
Hi Guys,
I have just tried the fcf file but the button acts really weird in simulation in that sometimes you can press it and other times you can't even
press the button, is this correct ?
thanks
Acestu
I have just tried the fcf file but the button acts really weird in simulation in that sometimes you can press it and other times you can't even
press the button, is this correct ?
thanks
Acestu
Laptop Mac Book Pro i7 retina El Capitan //// Tower/Intel i7-Windows 7 64 Bit, Toshiba i5 Laptop Windows 10
Computers are like air conditioners. They work fine until you start opening windows.
Computers are like air conditioners. They work fine until you start opening windows.
- Enamul
- Posts: 1772
- Joined: Mon Mar 05, 2012 11:34 pm
- Location: Nottingham, UK
- Has thanked: 271 times
- Been thanked: 814 times
- Contact:
- acestu
- Posts: 1720
- Joined: Thu Dec 01, 2011 9:36 pm
- Location: Macclesfield UK
- Has thanked: 783 times
- Been thanked: 223 times
- Contact:
Re: Cancel Command ?
Hi Enamul,
When I simulate the file that you have posted, when I mouse click on the cancel button sometimes you see it press and the programme stops, but other times when I click on the cancel button nothing happens ie you can't see the button moving in with drop shadow and you can keep trying but it will not press in.
I hope that explains it better
thanks
Acestu
When I simulate the file that you have posted, when I mouse click on the cancel button sometimes you see it press and the programme stops, but other times when I click on the cancel button nothing happens ie you can't see the button moving in with drop shadow and you can keep trying but it will not press in.
I hope that explains it better
thanks
Acestu
Laptop Mac Book Pro i7 retina El Capitan //// Tower/Intel i7-Windows 7 64 Bit, Toshiba i5 Laptop Windows 10
Computers are like air conditioners. They work fine until you start opening windows.
Computers are like air conditioners. They work fine until you start opening windows.
-
- 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: Cancel Command ?
Hi Acestu,
This is a known issue its to to with graphical interface.
There are two ways around this.
1) Press pause (F7) then continue (F5)
Or my personal favorite is:
2) Use Key mapping (See: http://www.matrixmultimedia.com/mmforum ... 19&#p21219 ) to assign both switches to number keys on your keyboard.
This is also ideal if your single stepping
I have set key mapping up on attached flowchart
Martin
This is a known issue its to to with graphical interface.
There are two ways around this.
1) Press pause (F7) then continue (F5)
Or my personal favorite is:
2) Use Key mapping (See: http://www.matrixmultimedia.com/mmforum ... 19&#p21219 ) to assign both switches to number keys on your keyboard.
This is also ideal if your single stepping
I have set key mapping up on attached flowchart
Martin
- Attachments
-
- Trailer_testV6 + Key Mapping.fcf
- (29.5 KiB) Downloaded 215 times
Martin
- acestu
- Posts: 1720
- Joined: Thu Dec 01, 2011 9:36 pm
- Location: Macclesfield UK
- Has thanked: 783 times
- Been thanked: 223 times
- Contact:
Re: Cancel Command ?
Thanks Martin, I am just putting it together on a breadboard but I can't get the LCD working now.
Hopefully I will get it going in a bit
thanks
Acestu
Hopefully I will get it going in a bit
thanks
Acestu
Laptop Mac Book Pro i7 retina El Capitan //// Tower/Intel i7-Windows 7 64 Bit, Toshiba i5 Laptop Windows 10
Computers are like air conditioners. They work fine until you start opening windows.
Computers are like air conditioners. They work fine until you start opening windows.
- Enamul
- Posts: 1772
- Joined: Mon Mar 05, 2012 11:34 pm
- Location: Nottingham, UK
- Has thanked: 271 times
- Been thanked: 814 times
- Contact:
Re: Cancel Command ?
Hi,
I also sort that in my own technique..Pause the simulation and click the button which is not working in simulation once..then run simulation again..this time it works..
Martin's 2nd option is more smarter..
I also sort that in my own technique..Pause the simulation and click the button which is not working in simulation once..then run simulation again..this time it works..
Martin's 2nd option is more smarter..
- acestu
- Posts: 1720
- Joined: Thu Dec 01, 2011 9:36 pm
- Location: Macclesfield UK
- Has thanked: 783 times
- Been thanked: 223 times
- Contact:
Re: Cancel Command ?
OMG I have got a row of blocks on the bottom line of my LCD any ideas ?
I have Data 1,2,3, and 4 connected to Data 5,6,7,and 8 on the LCD
thanks
Acestu
I have Data 1,2,3, and 4 connected to Data 5,6,7,and 8 on the LCD
thanks
Acestu
Laptop Mac Book Pro i7 retina El Capitan //// Tower/Intel i7-Windows 7 64 Bit, Toshiba i5 Laptop Windows 10
Computers are like air conditioners. They work fine until you start opening windows.
Computers are like air conditioners. They work fine until you start opening windows.
- acestu
- Posts: 1720
- Joined: Thu Dec 01, 2011 9:36 pm
- Location: Macclesfield UK
- Has thanked: 783 times
- Been thanked: 223 times
- Contact:
Re: Cancel Command ?
OK It's official, I am an idiot, I didn't connect the second vss on the chip again.....
Anyway after I did the LCD lit up but the program wasn't running right as my simulation, so I went to programme the chip with my earlier version and now
I just have a row of Blocks again.... investigating
Thanks
Acestu
Anyway after I did the LCD lit up but the program wasn't running right as my simulation, so I went to programme the chip with my earlier version and now
I just have a row of Blocks again.... investigating
Thanks
Acestu
Laptop Mac Book Pro i7 retina El Capitan //// Tower/Intel i7-Windows 7 64 Bit, Toshiba i5 Laptop Windows 10
Computers are like air conditioners. They work fine until you start opening windows.
Computers are like air conditioners. They work fine until you start opening windows.
- Enamul
- Posts: 1772
- Joined: Mon Mar 05, 2012 11:34 pm
- Location: Nottingham, UK
- Has thanked: 271 times
- Been thanked: 814 times
- Contact:
Re: Cancel Command ?
Did you connected RS, E to the respective pin? And R/W gnd?
PORTB1-6 were your LCD DB4-7, RS,E correspondingly..
In my version of program LCD is not in RB0-5 rather it is RB1-6..
PORTB1-6 were your LCD DB4-7, RS,E correspondingly..
In my version of program LCD is not in RB0-5 rather it is RB1-6..
- acestu
- Posts: 1720
- Joined: Thu Dec 01, 2011 9:36 pm
- Location: Macclesfield UK
- Has thanked: 783 times
- Been thanked: 223 times
- Contact:
Re: Cancel Command ?
If I am using the Pickit 3 connected all the time do I need a resister somewhere ?
I get the feeling that it has erased the chip and not reprogrammed it
Thanks
Acestu
I get the feeling that it has erased the chip and not reprogrammed it
Thanks
Acestu
Laptop Mac Book Pro i7 retina El Capitan //// Tower/Intel i7-Windows 7 64 Bit, Toshiba i5 Laptop Windows 10
Computers are like air conditioners. They work fine until you start opening windows.
Computers are like air conditioners. They work fine until you start opening windows.
- Enamul
- Posts: 1772
- Joined: Mon Mar 05, 2012 11:34 pm
- Location: Nottingham, UK
- Has thanked: 271 times
- Been thanked: 814 times
- Contact:
- acestu
- Posts: 1720
- Joined: Thu Dec 01, 2011 9:36 pm
- Location: Macclesfield UK
- Has thanked: 783 times
- Been thanked: 223 times
- Contact:
Re: Cancel Command ?
Yes the flasher circuit works, and the strange thing is the when I reprogrammed with the old trailer code blocks on the bottom of the lcd but when you pressed the start button the leds worked..
thanks
Acestu
thanks
Acestu
Laptop Mac Book Pro i7 retina El Capitan //// Tower/Intel i7-Windows 7 64 Bit, Toshiba i5 Laptop Windows 10
Computers are like air conditioners. They work fine until you start opening windows.
Computers are like air conditioners. They work fine until you start opening windows.
- acestu
- Posts: 1720
- Joined: Thu Dec 01, 2011 9:36 pm
- Location: Macclesfield UK
- Has thanked: 783 times
- Been thanked: 223 times
- Contact:
Re: Cancel Command ?
the next to last led does not light and I have changed it , nothing coming out of the chip, do you think I have blown it ?
cheers
Acestu
cheers
Acestu
Laptop Mac Book Pro i7 retina El Capitan //// Tower/Intel i7-Windows 7 64 Bit, Toshiba i5 Laptop Windows 10
Computers are like air conditioners. They work fine until you start opening windows.
Computers are like air conditioners. They work fine until you start opening windows.
- Enamul
- Posts: 1772
- Joined: Mon Mar 05, 2012 11:34 pm
- Location: Nottingham, UK
- Has thanked: 271 times
- Been thanked: 814 times
- Contact:
Re: Cancel Command ?
In which pins you have connected LCD? If your flasher LED works, there is nothing to worry about chip..it's alive..May be connection problem in LCD
- acestu
- Posts: 1720
- Joined: Thu Dec 01, 2011 9:36 pm
- Location: Macclesfield UK
- Has thanked: 783 times
- Been thanked: 223 times
- Contact:
Re: Cancel Command ?
Hi Enamul, right this is a little confusing, I have changed the LCD wires and now it is working, however I can't
for the life of me get anything coming out of A4 the R/H Indicator LED, I have even reprogrammed the chip but nothing
Thanks
Acestu
for the life of me get anything coming out of A4 the R/H Indicator LED, I have even reprogrammed the chip but nothing
Thanks
Acestu
Laptop Mac Book Pro i7 retina El Capitan //// Tower/Intel i7-Windows 7 64 Bit, Toshiba i5 Laptop Windows 10
Computers are like air conditioners. They work fine until you start opening windows.
Computers are like air conditioners. They work fine until you start opening windows.
- Enamul
- Posts: 1772
- Joined: Mon Mar 05, 2012 11:34 pm
- Location: Nottingham, UK
- Has thanked: 271 times
- Been thanked: 814 times
- Contact:
Re: Cancel Command ?
Hi,
I know why RA4 is not working..This is because in PIC16f870, RA4 is open drain output..That's why output can't go high..
The solution is to use pull -up resistor of 1K. Connect 1K resistor from RA4 to Vdd. Now you can put led in RA4 it will work..
I know why RA4 is not working..This is because in PIC16f870, RA4 is open drain output..That's why output can't go high..
The solution is to use pull -up resistor of 1K. Connect 1K resistor from RA4 to Vdd. Now you can put led in RA4 it will work..
- acestu
- Posts: 1720
- Joined: Thu Dec 01, 2011 9:36 pm
- Location: Macclesfield UK
- Has thanked: 783 times
- Been thanked: 223 times
- Contact:
Re: Cancel Command ?
WoW Enamul that has done the trick, what the heck is an open drain output and why is it just on that port ?
Cheers
Acestu
Cheers
Acestu
Laptop Mac Book Pro i7 retina El Capitan //// Tower/Intel i7-Windows 7 64 Bit, Toshiba i5 Laptop Windows 10
Computers are like air conditioners. They work fine until you start opening windows.
Computers are like air conditioners. They work fine until you start opening windows.
- Enamul
- Posts: 1772
- Joined: Mon Mar 05, 2012 11:34 pm
- Location: Nottingham, UK
- Has thanked: 271 times
- Been thanked: 814 times
- Contact:
Re: Cancel Command ?
This is not in all PIC..but present in some PIC ICs specially in RA4..This open drain is useful if you want to drive any device with higher or lower than PIC power supply voltage..
For example,
If you want to drive any circuit directly from PIC which takes input 12V you can do that using this pin..simply put pull-up resistor connected to 12V not 5V output will be 0 to 12V.
For example,
If you want to drive any circuit directly from PIC which takes input 12V you can do that using this pin..simply put pull-up resistor connected to 12V not 5V output will be 0 to 12V.
- acestu
- Posts: 1720
- Joined: Thu Dec 01, 2011 9:36 pm
- Location: Macclesfield UK
- Has thanked: 783 times
- Been thanked: 223 times
- Contact:
Re: Cancel Command ?
Thats interesting, although I am not sure how pull up resistors work really
ie why is the LED not lit all the time if it has a connection through the resistor to +5 ? and what is the pin doing when it is triggered ?
thanks
Acestu
ie why is the LED not lit all the time if it has a connection through the resistor to +5 ? and what is the pin doing when it is triggered ?
thanks
Acestu
Laptop Mac Book Pro i7 retina El Capitan //// Tower/Intel i7-Windows 7 64 Bit, Toshiba i5 Laptop Windows 10
Computers are like air conditioners. They work fine until you start opening windows.
Computers are like air conditioners. They work fine until you start opening windows.
- acestu
- Posts: 1720
- Joined: Thu Dec 01, 2011 9:36 pm
- Location: Macclesfield UK
- Has thanked: 783 times
- Been thanked: 223 times
- Contact:
Re: Cancel Command ?
Right, I will reconfigure the board tommorow and try the new cancel code
Thanks a Bunch again
Acestu
Thanks a Bunch again
Acestu
Laptop Mac Book Pro i7 retina El Capitan //// Tower/Intel i7-Windows 7 64 Bit, Toshiba i5 Laptop Windows 10
Computers are like air conditioners. They work fine until you start opening windows.
Computers are like air conditioners. They work fine until you start opening windows.
- Enamul
- Posts: 1772
- Joined: Mon Mar 05, 2012 11:34 pm
- Location: Nottingham, UK
- Has thanked: 271 times
- Been thanked: 814 times
- Contact:
Re: Cancel Command ?
So, why you need resistor in open drain can be described from this figure..without resistor FET drain is open and so drain voltage is floating and always 0V whatever the gate voltage is..ie why is the LED not lit all the time if it has a connection through the resistor to +5 ? and what is the pin doing when it is triggered ?
If you put a pull-up resistor satisfying maximum current condition, FET can switch properly with the gate drive, i.e., with high in gate drive FET will turn ON and drain voltage is close to 0V and with low gate drive FET will turn OFF and drain voltage is Vdd voltage.
That's why LED don't remain ON always although from outside the chip it seems that LED is connected to 5V. But it depends on FET switching..If FET OFF only then LED is ON.
But if you put LED in series with pull-up resistor LED will be ON when FET ON and will be OFF when FET OFF.
- Attachments
-
- PULL-up.png
- (4.73 KiB) Downloaded 6210 times