Hello,
I have recently compiled FF for a 18F26K20, using the last source code (ff-pic18.asm - 07.10.2017).
After power-up, the PIC sends the correct message ("FlashForth 5 PIC18F26K20 07.10.2017"). But when sending caracters from the terminal to the PIC there is no echo and no response to commands.
After some investigation, I have found that the problem is caused by these instructions inside WARM:
clrf TRISC, A
clrf LATC, A
Writing 0 to TRISC makes the pin RXD an output, so the UART can't receive. >From the datasheet:
For all modes of EUSART operation, the TRIS control
bits corresponding to the RX/DT and TX/CK pins should
be set to ‘1’. The EUSART control will automatically
reconfigure the pin from input to output, as needed.
I have commented the instructions and now everything works as expected.I suspect that this problem also affects other members of the family.
Previous versions of ff-pic18.asm didn't have these two lines of code (at least they were not included in version 19.01.2015). I would like to know what is its purpose.
Regards,
73, Pablo - EA4FUK
|