USART terminal in debugger

Post your requests and ideas on the future development of mikroBasic PRO for PIC.
Post Reply
Author
Message
puffeltje
Posts: 48
Joined: 29 Aug 2010 19:06

USART terminal in debugger

#1 Post by puffeltje » 04 Aug 2017 00:09

in mij project i connected the usart with some peripherals. when i am debugging i can't see what data is sent to or received from the peripherals.

is it possible to 'connect' the USART terminal to the Tx an Rx pins of the PIC so you can see then sended and received data when debugging?

User avatar
darko.ilijevski
Posts: 581
Joined: 21 Mar 2017 16:57

Re: USART terminal in debugger

#2 Post by darko.ilijevski » 05 Aug 2017 17:47

Hello,

Yes, it is possible. I have used that many times, but I don't know what happens if you step into the UART function (F7). I'll try that and inform you - if you want that line of code to be displayed, just press F8 (step over) and it will output the string to the TX pin.

Best regards
BR,
Darko

puffeltje
Posts: 48
Joined: 29 Aug 2010 19:06

Re: USART terminal in debugger

#3 Post by puffeltje » 15 Aug 2017 22:37

Darko,

Can you show me how i can connect the usart terminal to the TX and RX pins of the PIC while debugging? i can only connect to the available COMports.

User avatar
darko.ilijevski
Posts: 581
Joined: 21 Mar 2017 16:57

Re: USART terminal in debugger

#4 Post by darko.ilijevski » 16 Aug 2017 14:42

Hi,

Let me first check if I understood you correctly:
You want to output some data on UART, while you debugging, is that correct ? If so - first I need to know what development system you have. If it's not one of our development systems and you do not have any USB to UART converters , I strongly suggest you to get one, since it will ease up your development greatly. If you do have some of our development systems, there's a chance that you already have it integrated. In any case, take a look HERE With that device you will be able to directly connect TX and RX pins and have it opened in your terminal, via the virtual port created by the FT232 IC

All you need to do afterwards is to start the debug and then open up the terminal, connect to the port and watch your UART messages while debugging.

Regards
BR,
Darko

puffeltje
Posts: 48
Joined: 29 Aug 2010 19:06

Re: USART terminal in debugger

#5 Post by puffeltje » 16 Aug 2017 19:57

Darko,

The development system i am using is 'EasyPIC V7'.

I use the PIC18F45K22. I am writing a library for the Nextion displays ( https://nextion.itead.cc ). These are displays wich are connected by RS232. From the display i connect the Tx and Rx wires straight to RC6 and RC7 of the PIC. I can now write the instructions to the LCD, or receive the answer from the LCD. when debugging i want to see the sended commands and received answers. Because the Tx and Rx aren't connected to the RS232 connector on EasyPIC V7 i can't use the USART Terminal

Because i use the UART-library the debugger already knows which pins are used for Tx an Rx. Because i have connected the hardware at TTL-level and not at RS232-level the UART Terminal is of no use. It would be a nice option to 'connect' the UART Termial straight to the debugger.

The only option i see for now is to connect TX parallel to then RS232 circuitry, and the RX parallel to the USB-RS232 circuitry. On the PC i must open 2 terminal applications: one for the sended commands, and one for the received answers.

User avatar
darko.ilijevski
Posts: 581
Joined: 21 Mar 2017 16:57

Re: USART terminal in debugger

#6 Post by darko.ilijevski » 17 Aug 2017 17:40

Hello

Well yes, I see what you are trying to do... It is not possible to show your UART lines in any terminal unless you connect them to your computer. You have an option either to use the FT232 converter I have suggested, or use another one for the PC's RS232 port. Now - the problem is - you can't 'split' UART lines just like that, since it will introduce errors in the signal... So you have either to "mirror" your uart messages on another UART port (UART2 which would be connected to the terminal) or use some circuitry to split up your UART signal...

Best regards
BR,
Darko

Post Reply

Return to “mikroBasic PRO for PIC Wish List”