Author |
Message |
Topic: General Program Strategy / Architecture |
ChicoCyber
Replies: 9
Views: 75544
|
Forum: General CCS C Discussion Posted: Fri May 15, 2020 11:32 pm Subject: General Program Strategy / Architecture |
This is helping me in 2020
Thank you very much!
This opened my mind!
You need a cheap way to do multi-tasking.
Here's what I do:
1. Setup a main loop, that calls several "tasks" ... |
Topic: Port change interrupt mask (12F675) |
ChicoCyber
Replies: 10
Views: 27860
|
Forum: General CCS C Discussion Posted: Sun May 10, 2020 4:48 pm Subject: Port change interrupt mask (12F675) |
also...
CCS will(should) add the 'clear_interupt' automatically,so you don't need to ....
having delay_ms(100); inside the ISR is 'bad' programming.
ISRs are supposed to be short and fast. Set ... |
Topic: Port change interrupt mask (12F675) |
ChicoCyber
Replies: 10
Views: 27860
|
Forum: General CCS C Discussion Posted: Sun May 10, 2020 4:44 pm Subject: Port change interrupt mask (12F675) |
Your code is disabling the pull-up resistors.
The WPU comments below are wrong. You have it backwards.
void main()
{
set_tris_a(0b11011111); //0=saĆda 1=entrada
WPU = 0b0000 ... |
Topic: Port change interrupt mask (12F675) |
ChicoCyber
Replies: 10
Views: 27860
|
Forum: General CCS C Discussion Posted: Sun May 10, 2020 4:42 pm Subject: Port change interrupt mask (12F675) |
Enabling INT_RA, without specifying any pin, automatically sets
all the bits in the IOC register 'on'. Overrides what you have already
written to this register....
In fact you can 'OR' combine mu ... |
Topic: Port change interrupt mask (12F675) |
ChicoCyber
Replies: 10
Views: 27860
|
Forum: General CCS C Discussion Posted: Sat May 09, 2020 8:30 pm Subject: Port change interrupt mask (12F675) |
Nice! I got it!
But here is what is happening:
Cant make it work with the IOC register, it is triggered constantly (it is just curiosity):
#include <main.h>
#USE FAST_IO (A)
#by ... |
Topic: Port change interrupt mask (12F675) |
ChicoCyber
Replies: 10
Views: 27860
|
Forum: General CCS C Discussion Posted: Sat May 09, 2020 7:27 pm Subject: Port change interrupt mask (12F675) |
NICE! Thank you very much!
I was trying like this, but not worked, I would like very much to understand why.
#include <main.h>
#USE FAST_IO (A)
#byte WPU = 0x95 //Pullups 1=at ... |
Topic: Port change interrupt mask (12F675) |
ChicoCyber
Replies: 10
Views: 27860
|
Forum: General CCS C Discussion Posted: Sat May 09, 2020 6:11 pm Subject: Port change interrupt mask (12F675) |
Hello.
I'm trying to read 2 buttons with the port change interrupt with the PIC 12F675, but it is triggering with any pin change (INT_RA), which is expected. I have checked the datasheet, it says a ... |
|