![]() |
produce a .txt file?
Hi everyone :banana:
I have done a bit of assembly programming for Motorola 68hc12...in a course for microcontrollers. But now I am helping someone on a project and have to figure out things not taught. Anyway....not going into too many details about the project... one of the tasks is to produce an text file after processing data from sensors. In class we outputted stuff to the terminal, so I know how to do that, but writting to a .txt I am not sure. Any hints are very much appreciated. If there's not enough information to understand what I want, let me know :) Thanks in advance. |
It is entirely implementation dependent. For instance, if you don't have some medium that will hold a .txt file, it's impossible. If you have a floppy, say, then you have to have circuits to connect to it and software to talk to it. That may seem silly, since they just magically appear, and work, on almost any desktop system you ever saw. Still, there you have it.
|
I'm assuming that the microcontroller is connected to your development machine via a serial cable or similar and you want to record its output?
|
My guess was different: that you wouldn't be able to devote the development system to the task. There's far too little information.
|
Quote:
Is there something else I am missing in information for the question? edit: I should say I know how to transmit data from microcontroller to the machine (computer) using SCI (serial communication interface) module. |
Yeah, what OS. Proprietary won't give you the same leg up as, say, a Unix variant, usually. Check the documentation and see what utilities it gives you in the way of recording files. It may have one already that will copy the serial port to a file. It may have the ability to treat the serial port as a sort of stdin and copy it to a file via redirection. It may have an API that lets you talk to a disk in a relatively simple manner, without worrying about the file system and it's organization. In a case like that, you might only have to read the serial port, buffer it up, and pop it to the disk. If your data acquisition is something that takes significant time, you probably aren't going to want to block the normal operation of the development system. Serial ports usually give you the ability to run off of interrupts. Your OS, if multiprocessing (not a given, depends on the development system), can relieve you of that task.
Read the documentation for your system. The answers might be right there. If not, post back with the kind of system it is, with some details. Or, if it's not a one-off, give the model number or something and we can delve into it a little bit. |
| All times are GMT -5. The time now is 8:28 PM. |
Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC