Maker Pro
Maker Pro

Need More Memory

Horn

Jun 4, 2012
42
Joined
Jun 4, 2012
Messages
42
I am using multiple function in my code and am now wanting to have a way in which the user can use something similar to MATLABs help function where it will describe what the function is used for and how to use it. My problem comes from my limited memory. I was wondering if I could use my UARTs communication (SDA and SCL) to send my text over from my computer to the PIC16F1937 maybe from a text file? I am also using the UARTs to interface my keyboard to my board so not entirely sure that this will be possible. Any suggestions?
 

Harald Kapp

Moderator
Moderator
Nov 17, 2011
13,758
Joined
Nov 17, 2011
Messages
13,758
So you want to have two input devices (keyboard, PC) connected to one receiver (UART)?

As your keyboard very probably uses RS232 or TTL Level and the PC uses RS232, you cannot connect both keyboard and PC directly to one UART.

You could connect the keyboard to the PC and the PC to the UART (you will need RS232 level-shifters). Then you can send the input from the keyboard from the PC to the PIC using the serial connection. You can also send text from a file via the same connection.
You will have to devise a scheme that allows the PIC to distinguish between input from the keyboard and text from a file. You could use an escape character or escape sequence to mark the data accordingly (http://en.wikipedia.org/wiki/Escape_sequence http://www.trailing-edge.com/~bobbemer/ESCAPE.HTM).
For example you could send the string "ESC k" (ESC = 0x1B) to mark the following data as input from the keyboard and "ESC t" to mark the following data as coming from a text file.
Note that in order to avoid problems if a real ESC character is to be sent, you'll need to escape that, too, e.g. as "ESC ESC". This would be interpreted by the PIC as "ESC". So a data seqence "ESC ESC k" would be literally "ESC k" but would not serve as the "data from keyboard" commens for the PIC.

Harald
 

Horn

Jun 4, 2012
42
Joined
Jun 4, 2012
Messages
42
A dream within a dream? I am currently trying to get this to work may take a while before I get it up and working. Thanks again Harald!
 
Top