Code: Pascal [Select] 0x005 bcf PORTB, 5In case if 1 on PORTB.4, output PORTB.5 will make fast pulsation? Is it right?I think will be right to make any changes in result only AFTER checking of input value.Tried to simulate in Proteus, and found my laptop have not enough power to simulate this fast pulsation Am I right?PS We can see it in ASM Debugger if we change the string to PORTB.5 := not PORTB.4;PORTB.5 blinking because there bcf PORTB, 5 before btfss PORTB, 4
You are right. The code to copy bit PORTB.4 to PORTB.5: 0x005 bcf PORTB, 5 0x006 btfsc PORTB, 4 0x007 bsf PORTB, 5 Could cause a fast pulse on PORTB.5. It's usually not important, but It could be problematic in some cases....I think It can be defined as an additional optimization parameter that in mode "fast" use this algorithm and in mode "slow" can use a more secure code.
If that code was in a loop, then there would be a constant "pulsing" which would result in a pulse width modulated output and lower average voltage.Maybe something like this which only adds one instruction: 0x001 btfsc PORTB, 4 0x002 bsf PORTB, 5 0x003 btfss PORTB, 4 0x004 bcf PORTB, 5I think this should be the normal operation. And, an optimization switch could be to enable your original method of speed while sacrificing output consistency.
PicPas has been updated to the version 0.6.0 . All bit operation implemented, more optimization code included, tree syntax improved, parameters of procedures implemented, interfaz modified, and many other features more.
I know it's not a good question, but I often wonder why people use PIC controllers. What keeps you using them?They aren't really cheap, and the architecture is not suited for compilers or humans.Some say they are great for noisy environments, but anything running that slow will work in a noisy environment.Creating a compiler for it is a great feat for sure. So kudos for the project
What is the graphical emulator you are using in the background? Is that a third party tool?The debugger is fantastic. What more could you want?Bravo!
Hi Edson,Here is a translation to English of the excellent UART example. Hope it helps.
Hi Edson,Do you plan on implementing the set type or are sets to high level for the PIC?
PicPas, my cross-platform Pascal compiler for Microchip PIC, is growing. Now in the version 0.8.3, it improves the disassembling and includes some adiitonal optimizations in RAM use. https://github.com/t-edson/PicPas