Thanks again Darrel,
I never even thought to try DEBUGIN and I certainly did not realize how compact it is.
Another entry in the note book.
Thanks again Darrel,
I never even thought to try DEBUGIN and I certainly did not realize how compact it is.
Another entry in the note book.
Dave
Always wear safety glasses while programming.
For the longest time I completely ignored the DEBUG/DEBUGIN statements because it just seemed too much like a Basic Stamp command.
Then I saw Bruce using them a lot and took another look.
They really are better than SERIN/OUT, SERIN2/OUT2.
As long as you only need one baud rate and fixed pins ... which fits probably 90% of the usual serial programs.
Smaller, faster ... better.
DT
Hi Darrel, with a loop of 10 cycles the last MyData will contain the desired byte saving one line instruction. (Assume something less than 75 words)
Code:DEFINE DEBUGIN_REG PORTB ' Debugin pin port DEFINE DEBUGIN_BIT 3 ' Debugin pin bit DEFINE DEBUGIN_MODE 0 ' Debugin mode: 0 = True, 1 = Inverted DEFINE DEBUG_BAUD 2400 ' Debug baud rate B0 VAR BYTE MyData VAR BYTE DEBUGIN [WAIT(85)] ' wait for 85 FOR B0 = 0 TO 9 DEBUGIN [MyDATA] ' skip 9 bytes NEXT B0 'Last MyDATA will contain the desired byte
All progress began with an idea
If you're not using Timer0, set it up for external clock, strap T0CKI to ground, and you have yourself a spare byte variable.
Wow! Gentlemen,
Thank you for such great help. This saved me 94 of 512 words of memory, so I now can think about adding some other features. Will try how it works in reality this week and let you know.
Another option could be going with another chip and additional driver chip to interface to a 14 Volt serial I/O line, but this makes the electrical schematic bigger, so I prefer to stay with this chip if possible.
My understanding is that using DEBUG I will still be able to use the same pin as output before and after the DEBUG.
Will need to learn more about the TIMER0 and how to configure to save space for one more variable because although I can live without it, it is still good to have. I have to use resonator for having precision timing, not sure it makes a difference or not.
Thanks again!
Thanks again
Hello Gentlemen,
Checked the Debugin with PIC16F540 and yes, your advise works great, I could read the port and output high and low impulses into it between the serial input.
Could not find out so far how to reduce use of RAM to get space for one more variable, but at least have enough memory for code now.
Thank you very much
Bookmarks