Swordfish has whatever interrupts you code it to have, just like C.
You pretty much have to do the exact same steps you would do using XC8.
.
I dont use XC8, not that it makes a difference to what i was asking. Actually i asked the question wrong! But you answered it in a way that gives me the info anyway
. I switched from pics to sil labs stuff, the nearest i get to XC8 now is Kiel when i use 8051 chips, so its very close close.
In C18, which was what i used to use, you set up the ISR and chose high or low vector. My understanding could be wrong but XC8 you dont do alot of the old set up? Anyway in Swordfish your saying things like the priorities etc are all catered for? From your answer to my badly framed question, unlike the old C18 there is no messing with putting a splodge (technical term) of ASM in then?
Tumbleweed I could go look, but I would prefer it if you would so kind to link me to the most recent docs to swordfish. I have a habit of finding out dated stuff! Anyone got any idea what the limits on the free version version are, in particular for the 18f4685 chip? I am tempted to give this a try, my little sister is 9 soon and smarter than me, i started at 11 and she is looking to make pink leds flash in Barbies car. Yes i could do it for her but she actually wants to do the clever bit and have me do the soldering.
I started with C, but i cant get mplabx working properly on my machine and dont really want it on the linux machines as they are not in the house. Also in some ways i think Basic might suite her better than C. Any pitfalls i need to know about? silly gotchas like X module dosnt work on a Sunday? I fancy a bit of play with this with my little sister. From vague long ago memory, can you still write your modules etc easily?
I used swordfish maybe 5-6 years ago, but i think it was at a time when the software wasnt mature like now. (yeah ironic compared to MPLABX!).
How much is the full version BTW?
Mr Deb, jons way is 100% correct, but sometimes the other way of doing a delay is just going through the program and adding a counter for each loop around, depends what your doing. I tend to use things like that mainly for heart beat leds, that way you know the program is actually looping and the led not just responding to a timer.
Interrupts are good, but its a walk and run thing, while your still crawling stay away from them. It isnt that they are difficult, but you need to follow sound logic and do things in specific ways, or it gets very easy to become locked up!
For a reaction timer you should have nailed this long ago, you have enough projects under your belt to be able to detect a switch and turn leds on and off. If your really having this much trouble then i suggest the following.
From memory you have a Junebug? And again from memory i think sword fish even had a junebug module?? Get yourself back on the Junebug and work your way through nice and easy simple things using the Bug as a dev board (its intended purpose). I am not being offensive but your running all over the place and learning nothing. Yes a reaction timer in man cave is ok, but your offering to do things you cant actually do. Take a step back and learn properly, its what EVERYONE did!
Every one turned a led on, the eventually off, then made it flashed in all manner of ways, start with easy stuff. I dont get why people think flashing leds is boring, you learn a great deal. A led is a great indicator, you can use program loops and timers and all maner of ways to flash them, but stick with each method until you have it nailed blindfolded . Interrupts for me would the last method i would use to flash it as its a bit more involved.
Then using the bug move on to the switches on the bug, again leave interrupts until last. Get a servo as well, some of the most helpful code ever on this forum was Mikes servo tester (although its in C). But study the code as its well explained line by line in the code. Once you can port that code over to swordfish (you dont need to know C to understand it), you will have a good understanding of code. Mike put a routine in the code that debouces by comparing what my memory thinks he called keys at the time.
He reads the ports and stores the value then compares it, the code dosnt move until the change stops. Its a real elegant way to debounce, the big problem with delays is literally time. Why bother running a micro at 8Meg when you stop it every few lines for a couple of seconds?
Going back to the Junebug and working through the board will help you no end, it even has the ability to act like a TV remote control! I know you say you got your way of learning, but truth is your not learning.
You get projects done because others pour code into threads, but that dosnt help you understand how to write code, I am saying this because considering the volume of projects you have done, turning leds on and off in sequence with a button press, should really be absolutely second nature by now. Infact that is my entire point, you cant do the number of projects you have done, then declare you learn your way. Leds are the first thing anyone learns so if you struggle doing it....... Time to change the learning