Just resurrecting this. I'm using an 18F2620/80 chip.
Let's assume I must use serin2 and serout2 for some serial stuff so can't use DT interrupts to create a timer.
How can I implement a 100ms or 1S tick timer with the above restriction?
Just resurrecting this. I'm using an 18F2620/80 chip.
Let's assume I must use serin2 and serout2 for some serial stuff so can't use DT interrupts to create a timer.
How can I implement a 100ms or 1S tick timer with the above restriction?
I guess this is a good place to start. Why not? You can use DT_INTs with every single Interrupt your PIC is capable, and all at the same time. You can have a Timer Interrupt and also multiple UART Interrupt Handlers, all with DT_INTs.
...so can't use DT interrupts to create a timer.
If you haven't already, read the book a few members assembled as a tutorial on DT_INTs:
http://dt.picbasic.co.uk/Site/Introduction
My understanding is Interrupts interrupt software based serial routines like Serin2 and break them..
Have I missed something? I can't use hardware serial in this application due to pinout constraints.
no , thats pretty right any software timed function is compromisedMy understanding is Interrupts interrupt software based serial routines like Serin2 and break them..
Have I missed something? I can't use hardware serial in this application due to pinout constraints
if you use an asm timer interrupt to set a flag to be processed in main code when needed and your serial baud rate is not too high
you may get away with it. i would use define int rather than dt ints to minimise overheads
another option is to disable the int when serial transactions are being carried out
better still use a modern chip like k42 series with peripheral pin management , nearly any pin can be any function
and they have 2 esuarts
this ticker , what sort of range does it need , i tend to use a 4mS timer counting a 16 bit counter , allows me to measure
65535x4mS periods a 4 minute-ish rollover
Warning I'm not a teacher
Bookmarks