This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Serial Input for the KitCon 167

hi-
I am trying to use the serial port for input and output. I first tried to use the interupts but the Keil software's monitor overwrites our interupt.
We've switched to scanning for data. I have seen references on this forum to using scanf. I have tried this but I can never type in the serial window for the simulator or in a hypertermal window when running on the board itself. How have people been able to use serial input? Thanks

-John
UC Berkeley
Solar Car Team

Parents
  • Hi Mike, thanks for the reply. I'm the EE guy on the team working on this with John.

    We overcame the monitor/serial conflict before by flashing the board and calling printf. That worked well.

    Now we're trying to call printf and then read any input up to a CR, with no success. The board executes the printf command, but doesn't respond to any keypresses.

    Would you have any suggestions as to how to read things off of the serial port when running flashed code? Some sample code perhaps?

    Finally, I think it's worth mentioning that we're only reading input right after writing output, so scanf() should be safe.

    Many thanks,

    -james
    UCB Solar Car

Reply
  • Hi Mike, thanks for the reply. I'm the EE guy on the team working on this with John.

    We overcame the monitor/serial conflict before by flashing the board and calling printf. That worked well.

    Now we're trying to call printf and then read any input up to a CR, with no success. The board executes the printf command, but doesn't respond to any keypresses.

    Would you have any suggestions as to how to read things off of the serial port when running flashed code? Some sample code perhaps?

    Finally, I think it's worth mentioning that we're only reading input right after writing output, so scanf() should be safe.

    Many thanks,

    -james
    UCB Solar Car

Children
  • Hi James,

    Keil's C166 package includes some sample code. Look in Keil\C166\EXAMPLES. The Measure example contains simple serial IO with transmit/receive flag polling. The Traffic example contains code for interrupt-driven buffered serial IO (it uses RTX Tiny OS).

    We overcame the monitor/serial conflict before by flashing the board and calling printf.

    That means you can't use the monitor to debug your application in target hardware. That's too bad. I would still recommend that you configured Monitor166 in simulated serial mode and used another serial port for debugging. This way you would be able to debug serial IO as well. Reconfiguring the monitor requires reading manuals and can't be done without some trial and error, but it's well worth it. Unless you are confident that you don't need debugger, of course.

    Best luck,
    - mike

  • Hi,
    I'm try to read some data from the serial plug P2 of my KC 167-CR LM.
    I search everywhere, but I don't find what I have to configure.
    I try to read data from a GPS Antenna (GPS 910).
    I try to configure SSC Part of Dave genrating code, no result...
    I tried ASC0, for plug P1, no result...
    Can someone help me, please??????