0

I'm using a rabbit microcontroller. It uses the Dyanimc C language.

How can I read from a file in my PC and manipulate it or print it to the screen?

C or C++ methods are not working here.

Mat
  • 202,337
  • 40
  • 393
  • 406
Morano88
  • 2,047
  • 4
  • 25
  • 44
  • A little confused, is the file on your pc and you are trying to get it onto the microcontroller board for use? At first glance it seems you just need to use some serial i/o between the board and the pc. – zdav Jun 04 '10 at 22:17
  • No just reading the content of the file. like fgetc() in C language. – Morano88 Jun 04 '10 at 22:35
  • It's clear that you want to read a file, but @zdav's question was how you imagine the microcontroller gains access to the file. It typically won't have direct access to your PC's hard drive or filesystem. Or does the Rabbit have it's own storage, say flash memory, that you want to read from? – Stéphan Kochen Jun 05 '10 at 09:41

1 Answers1

1

If you read the Rabbit manual then you can see that the file system function calls from within the Dynamic-C language refer to files that are stored on local flash devices that are connected to the processor chip.

FAT version 1.02 supports SPI-based serial flash devices. FAT versions 2.01 and 2.05 also support SPIbased serial flash devices and require Dynamic C 9.01 or later. FAT version 2.05 introduces support for NAND flash devices. FAT version 2.10 extends μC/OS-II compatibility to make the FAT API reentrant from multiple tasks. FAT version 2.13 adds support for SD cards and requires Dynamic C 10.21 or later. In all versions of the FAT, a battery-backed write-back cache reduces wear on the flash device and a roundrobin cluster assignment helps spread the wear over its surface.

There is no way that the Rabbit can read or access a file on your pc directly. You must first provide a transfer mechanism to pass the file over from the pc to the flash storage device that you have designed into your hardware platform and use the file write function calls to store this data into the Rabbit file system. This would normally be by transferring the data over a serial link using some protocol of your choice or invention.

Next you seem to want to display some data on the screen. I assume that by this you mean the pc screen (although you could have a local screen connected to the Rabbit) Again the Rabbit has no direct method of accessing the screen. You will have to write a pc application that takes data messages from the Rabbit, possibly over the serial interface (other interfaces may be available), and interpret these as instructions to display some text or formatting on the pc screen.

uɐɪ
  • 2,540
  • 1
  • 20
  • 23