News:

Let's find out together what makes a PIC Tick!

Main Menu

Serial monitor without PC

Started by TimB, Jan 20, 2023, 04:07 PM

Previous topic - Next topic

TimB


Hi all

Does anybody know of a standalone serial monitor that runs without a PC. Perhaps a Raspberry Pie that has a display and a prog that will enable you to set the baud rate clear the screen and log the data

I find it a pain to drag my PC around to where my RD kit is to see data coming out. It would be great to just have a remote display

Also working with TTL rather than having to use a TTL - RS232

Debugging would be easier also just rsout from a spare data pin

Thanks

Tim

TimB


Another option perhaps is a dongle for an old Android tablet


See_Mos

How much data do you need to store / see?

One of my first projects with Proton was Les' code for a PIC16F84 and an LCD display to capture and display some serial data

TimB


Well in the current project a simple 2 line LCD would be ideal I can use the RSOUT print at routines to format it.

The ideal solution would be say a 7" display with an app that enables a customised display where you specify a packet and have conversions done on that data as part of it.

eg
Packet = 4 bytes of Mchip format data and display on a box x big in x font at x,y position.
Next 2 bytes are Word data ........

I'm going to look if I can find a pre built pic / lcd screen. Then build a case with a battery compartment etc.

Thanks

TimB

#4
One thing to add is that doing rsout Dec float etc is CPU consuming I have interrupt driven hrsout and its very simple and fast with minimal CPU usage. Since I may send 8 floats I really do not want to spend time converting it to Dec before

I may develop a pic GLCD where in the format of data it will specify where to print and what data is being sent

eg

hrsout 33,myfloat,3,0

Where the 33 indicates it is a float to be displayed to 3 places so next 4 bytes are the float data and 3 = x pos 0 = y line

I can use a time out to cover for lost data to keep in sync

Tim

shantanu@india

ESP8266/ESP32 based modules can be driven from an OTG cable of a mobile phone(I haven't tried it).You can write a small script in C/Micropython to read the serial data and store it in a variable. These modules can be configured as a WiFi access point and a webserver listening on port 80. Connect your mobile phone to the Wifi created by the ESP and read the data by means of an simple Html code that runs on the webbrowser.
Regards
Shantanu

joesaliba

Tim,

Does converting your float to string consume more time?

keytapper

For logging data, I think it's good using a HC-06 and connected anything that can receive the data.
For an instance there is an App for android "Serial Bluetooth Terminal".
Ignorance comes with a cost

shantanu@india

Tim's problem has come at the ripe moment indeed!
Just switched on the ESP through the OTG cable of my phone. Works absolutely fine.
Can think of various applications of a ESP + phone combination.
Regards
Shantanu

TimB

#9
Quote from: joesaliba on Jan 21, 2023, 11:40 AMTim,

Does converting your float to string consume more time?

Yes unfortunately it does and its the same as hrsout Dec float

Sending float as Mchipformat is 4 bytes converting to string or dec not only takes time it also increases the data load

Myfloat = 123.45678
eg hrsout Myfloat would occupy 4 bytes but sending hrsout Dec5 myfloat  is 9 bytes

I see I can use an  terminal app and with a USB A to mini USB converter use my ttl to USB cable to an old tablet I have. It has limitations though

What I like about the LCD and pic board is that I can buffer a lot of data and parse it to be displayed as I want. It can also be modified so I can send command sentence to say do the following;-

$55,$AA ' Enter command mode
$57     ' Special packet info incoming
$4      ' 8 bytes in the packet
$4      ' First 4 is a block
$54      ' It is a float and print to 4 dec places
$00,$0A  ' Display at y line 0 and x poss 10
$0A     ' clear past number to 10 places
$AA,$55 Exit command mode

Thereafter until the unit is reset it will take the next 4 bytes (within timeout values) and display them as a float at position 0 Y line 10 X poss as a float to 4 places (print DEC4 float) and pre clear 10 places from 0 Y , 10 X to 0Y to 20X to ensure no spurious chars are left

As I get more time and my needs change I can add more commands like pre printing the screen with info like

Hrosut $44,$66  'Enter pre print mode
Hrsout $00,$00, "TimerA", $FF    Print at Y0 X0 the string and then notify the string for that poss has ended

A terminal prog is nice but you do not get options to do float or Dword conversions on specific packets of data   

top204

#10
The KS0108 LCDs do have some speed issues for the toggling of them, but not so it will cause a problem. I have used KS0108 LCDs on PIC24 devices and they have operated perfectly when running at around 140MHz.

You may be mistaking the problem because of the extremely bad simulation of the KS0108 LCD in the Proteus simulator Tim. If the microcontroller is running above 8MHz, the simulated KS0108 LCD falls over all the time, and has done since it was added to the simulator about 18 years ago, but this is not what happens in real life with real KS0108 displays. :-)

The KS0108 LCDs do have a latency in the screen update because of the timing of the LCD material, so animated graphics do not work as well as they should and show a smudge like image on the display if things move too quickly, but for a serial terminal, this is not a problem. Also, make sure the serial interface is using an interrupt buffer, so even when the LCD is not ready for new commands or text, they are sitting in the serial buffer and will be accessed when they can be. Make the serial buffer as large as possible so you can send loads to the terminal and they will be updated to the LCD when they can be.


John Lawton

Good ideas. Some indication on the LCD of the used proportion of the input buffer might be useful so you can see if you are in danger of overloading the terminal with data.

TimB


Thanks for the info

The amount of data the system needs to buffer will not actually be large. The reason for the terminal is to to reduce the data that needs transmitting by sending raw data. Not pre converted strings.

I decided to go for the PIC18F27Q10 as I can actually order some with about a 1 month delivery data. It also has 127k of Flashram and 3.8k of ram. I aim to make the GLCD board + 5 keys a GP display board use for everything and keep 10+ in stock.

It will give me the chance to build up a library of routines like menu scrolling, data entry etc etc

Below is from a 128 x 128 screen but you get the idea

The work load will be offloaded to the screen and the main pic will processing sensor data

Another attraction is that I can collect all the streamed data from the main board and display graphs etc without bothering the main pic.

I aim to start moving my code over to the 18F27Q10. I really hope I can purchase the chip in future. I have 10 on order I may order another 20 just for future stuff.

Menu.png



JonW

What package do you use Tim.  May have some 27k or 47k in the lab.

top204

I'll take a look as well Tim. I'm sure I got some samples when I was developing the compiler's code for them  a few years ago.

If I have, you are welcome to some.

TimB


Many thanks

If there is a SSOP28 Pic18f27Q10 that would be great. I was aiming to do some development in Labcenter VSM but it seems the rcall mnemonic has issues so no go until they fix it.

Tim

JonW

Just looked at the old Bom Tim.  I have 18F24Q10, also got 26/27/24K42 or 47K42 in QFN or TSSOP. I've got the 27K42 in a dev board/basic stamp format with CP2102 on it, I sent John B and Dompie a few and they are good if you need DIP profile with USB


JonW

#17
QuoteIf there is a SSOP28 Pic18f27Q10 that would be great. I was aiming to do some development in Labcenter VSM but it seems the rcall mnemonic has issues so no go until they fix it.

Wouldn't bother.  I bought the latest version and its good for analog & mixed simulation with some basic MCU but the latest models of the MCU are SHOCKING..  I use emulators and basic code and trace functions using interrupt driven uarts and the NVMCON or FSR to return variables etc. Consider investing in an ARB for analog interface to the digital domain.  You can capture a trace from your analog front end and feed it into an ARB to get a real world feed to the MCU.  I (personally) just don't trust Labcenter now .

Oh before I forget and on this subject check out my latest post on some old software 100% free for Analog, some reason i forgot to post this 2 yrs ago OMG



Dompie

Quote from: JONW on Jan 25, 2023, 09:37 PMJust looked at the old Bom Tim.  I have 18F24Q10, also got 26/27/24K42 or 47K42 in QFN or TSSOP. I've got the 27K42 in a dev board/basic stamp format with CP2102 on it, I sent John B and Dompie a few and they are good if you need DIP profile with USB

..........yes, and those dev boards work great!!

Johan

John Lawton