![]() |
Forum Index : Microcontroller and PC projects : MM Interrupts
Author | Message | ||||
palcal![]() Guru ![]() Joined: 12/10/2011 Location: AustraliaPosts: 1967 |
I had a program running on my MM and for no known reason the Interrupts stopped working. I wrote a small test program with an Interrupt and it wouldn't work either. I then wrote a small program to switch the Pins high and low and this was OK, so the connection is OK. Could this be a problem with the MM itself. Also should the Interrupt pins be held low with a pulldown and pulled high with a resistor. I have my pins floating and connect directly high. But it has always worked before. Paul "It is better to be ignorant and ask a stupid question than to be plain Stupid and not ask at all" |
||||
TassyJim![]() Guru ![]() Joined: 07/08/2011 Location: AustraliaPosts: 6224 |
Inputs floating is not a good idea. A 4.7 to 10k resistor to ground then switch the input to 3.3V is preferred. Jim VK7JH MMedit |
||||
Grogster![]() Admin Group ![]() Joined: 31/12/2012 Location: New ZealandPosts: 9502 |
Agreed. I tend to use 10k pull-up's or pull-down's for general I/O pins, but I hear that 4k7 is also a favorite value with many people. Not sure that there is really any benefit to using 4k7 over 10k - perhaps someone here can enlighten me on that one. ![]() As you are not wanting to actually pass any significant current to the pin, rather just give it a default high or low reference point, I don't think it matters that much, so long as you have one! ![]() I do note, however, that keyboards and I2C buses like 4k7 pull ups... Also something to remember - some pins on the PIC32 are 5v tolerant, and others are not - BE CAREFUL! 5v into a non-5v tolerant pin will likely kill the PIC32... I used to use voltage inputs, but of late, I have adopted the more standard method of pull-up's and grounding the pin if it is switches etc. I have had issues before in the past(with other PIC's) when ground-referencing the pin, and pulsing the pin high to trigger it. Once installed, if there is any induced voltage in the connecting wire to the switches, the PIC can respond to these as input pulses. This does not generally happen if the input is high-referenced, and you ground the pin to trip. I use a 1k series resistor on the input pins too(a-la PICAXE 1k/10k idea for any input pin), to limit any current into the pin. Smoke makes things work. When the smoke gets out, it stops! |
||||
BobD![]() Guru ![]() Joined: 07/12/2011 Location: AustraliaPosts: 935 |
If the resistor is acting as a pull-up and the line has some capacitance on it (don't they all?) then a lower value resistor will help signals to switch faster. Grogster, some time back you were getting problems with your keyboard(s). Was this part of the problem or has it just magically disappeared? |
||||
Grogster![]() Admin Group ![]() Joined: 31/12/2012 Location: New ZealandPosts: 9502 |
Cheers for that. ![]() Yes, still have the KB problems. As my development CMM is the CG one, the KB_CLK and KB_DTA pull-ups are SMD 10k ones, from what I can tell. Switching them to 4k7 is something I would like to try, but it is really beyond my soldering ability due to the fact that I think the resistors are 0603 type - they are TINY - too hard to hand solder that size. Smoke makes things work. When the smoke gets out, it stops! |
||||
palcal![]() Guru ![]() Joined: 12/10/2011 Location: AustraliaPosts: 1967 |
Thanks all, I was connecting 5v. to pin1 just didn't think. Have connected a pullup and using 3.3v. but the interrupt is very erratic and the micro eventually freezes. Tried other pins but the same happens. Have ordered a new micro, guess I learnt the hard way. Thanks Paul. "It is better to be ignorant and ask a stupid question than to be plain Stupid and not ask at all" |
||||
Grogster![]() Admin Group ![]() Joined: 31/12/2012 Location: New ZealandPosts: 9502 |
If by "Pin1" you mean I/O 1, then yes - that is a 3v3 I/O and is NOT 5v tolerant. I/O's 1 through 10 and 35 through 40 are not 5v tolerant. All the others ARE 5v tolerant. SOURCE: CGCMM datasheet, CGCOLORMAX1 Pin Outs and Function, page 469, manual version 1.3 Although this is for the CG CMM units, any CMM clone will be the same, as it is the same PIC32 chip. Smoke makes things work. When the smoke gets out, it stops! |
||||
bigmik![]() Guru ![]() Joined: 20/06/2011 Location: AustraliaPosts: 2946 |
Hi Groggy, As a suggestion, open your keyboard and add 10k pullups inside it (it will be a lot easier and the 2 sets of 10k will create a 5k pullup, you can experiment with values and see if a harder pullup is needed. I wouldnt like to go below the 1k mark though (not that any damage would occur) Regards, Mick Mick's uMite Stuff can be found >>> HERE (Kindly hosted by Dontronics) <<< |
||||
Grogster![]() Admin Group ![]() Joined: 31/12/2012 Location: New ZealandPosts: 9502 |
"Bloody Hell - now that's what I call thinking." - HitchHiker's Guide To The Galaxy. Brilliant idea, Mick - cheers, mate! ![]() Smoke makes things work. When the smoke gets out, it stops! |
||||
MicroBlocks![]() Guru ![]() Joined: 12/05/2012 Location: ThailandPosts: 2209 |
@Grogster, If above does not work you might want to put your keyboard signal through a schmitt trigger. It looks like the levels for 0 and 1 are 'shaky' and a schmitt trigger will clean that up. Microblocks. Build with logic. |
||||
Grogster![]() Admin Group ![]() Joined: 31/12/2012 Location: New ZealandPosts: 9502 |
Thanks TZA - another good idea. I will do the KB mod over the weekend, and try it for a while, and let the thread know. MODS: This thread seems to have been unintentioanlly hijacked. Perhaps it would be a good idea to split it into palcal's orignal question, and add the KB bits to my older thread about KB issues? ...I will leave it up to the moderators to decide on that one, it's just that this thread has deviated a little from palcal's original post - sorry... ![]() Smoke makes things work. When the smoke gets out, it stops! |
||||
![]() |
![]() |
The Back Shed's forum code is written, and hosted, in Australia. | © JAQ Software 2025 |