Connect with us

Need More Memory

Discussion in 'Microcontrollers, Programming and IoT' started by Horn, Jul 23, 2012.

Scroll to continue with content
  1. Horn

    Horn

    42
    0
    Jun 4, 2012
    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?
     
  2. Harald Kapp

    Harald Kapp Moderator Moderator

    9,632
    2,013
    Nov 17, 2011
    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
     
  3. Horn

    Horn

    42
    0
    Jun 4, 2012
    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!
     
Ask a Question
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.
Electronics Point Logo
Continue to site
Quote of the day

-