![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Hobbyist Programmer
Join Date: May 2005
Location: Indiana
Posts: 130
Rep Power: 4
![]() |
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. |
|
|
|
|
|
#2 |
|
Resident Grouch
![]() ![]() ![]() ![]() ![]() ![]() Join Date: Jun 2005
Posts: 6,453
Rep Power: 10
![]() |
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.
__________________
Abstraction doesn't make it impossible to write bad code; it makes it possible to write superior code. Contributor's Corner: Grumpy on C++ Exceptions DaWei on Pointers |
|
|
|
|
|
#3 |
|
Troll
Join Date: Apr 2005
Location: Texas
Posts: 730
Rep Power: 4
![]() |
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?
__________________
MD5(sig) = bcef75433db02e9ad9bf81d6f7c5c270 |
|
|
|
|
|
#4 |
|
Resident Grouch
![]() ![]() ![]() ![]() ![]() ![]() Join Date: Jun 2005
Posts: 6,453
Rep Power: 10
![]() |
My guess was different: that you wouldn't be able to devote the development system to the task. There's far too little information.
__________________
Abstraction doesn't make it impossible to write bad code; it makes it possible to write superior code. Contributor's Corner: Grumpy on C++ Exceptions DaWei on Pointers |
|
|
|
|
|
#5 | |
|
Hobbyist Programmer
Join Date: May 2005
Location: Indiana
Posts: 130
Rep Power: 4
![]() |
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. Last edited by EverLearning; Aug 20th, 2006 at 8:54 PM. |
|
|
|
|
|
|
#6 |
|
Resident Grouch
![]() ![]() ![]() ![]() ![]() ![]() Join Date: Jun 2005
Posts: 6,453
Rep Power: 10
![]() |
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.
__________________
Abstraction doesn't make it impossible to write bad code; it makes it possible to write superior code. Contributor's Corner: Grumpy on C++ Exceptions DaWei on Pointers |
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| OnlineTextEditor.Com! | Sane | Show Off Your Open Source Projects | 43 | Jun 16th, 2006 8:55 AM |
| How much can a C++ programme extract from a .txt file? | Ade | C++ | 14 | May 4th, 2006 6:46 AM |
| After execution - Error cannot locate /Skin File? | wchar | Visual Basic | 1 | Mar 5th, 2005 9:04 PM |
| airport Log program using 3D linked List : problem reading from file | gemini_shooter | C++ | 0 | Mar 2nd, 2005 4:12 PM |
| Structure char field to a disk file | ehab_aziz2001 | C++ | 0 | Feb 10th, 2005 2:42 PM |