VDRIVE and BasicChip

Questions on other types of hardware and getting it talking to the ARM CPU
ronr
Posts: 22
Joined: Tue Nov 05, 2013 8:17 pm

Re: VDRIVE and BasicChip

Post by ronr »

OK, the "removing comments" issue, I found, is caused by my text editor putting a strange control character at the end of any file it edits. I was lucky to find that one. Some things should go better now.
I get a "multiple include guards may be useful for:" message when I change the name of "vdriveinit" to something shorter, like "VINIT". How do I do anything about that? Thanks for any help.



basicchip
Posts: 1090
Joined: Fri Oct 19, 2012 2:39 am
Location: Weeki Watchee, FL
Contact:

Re: VDRIVE and BasicChip

Post by basicchip »

You must be removing more than just a comment, maybe the #include which is not a comment.

The "no newline" error comes out of the C pre-processor, and means just that. It is a warning that the last line of a file has more than a carraige return in it. To cure it, go to the end of the file in your test editor, type ENTER and save it.

As for debugging, check connections again. Do you have another USB-serial or TTL-Serial device? With that you can eavesdrop on the serial characters going between the BASICchip and the Vdrive.

basicchip
Posts: 1090
Joined: Fri Oct 19, 2012 2:39 am
Location: Weeki Watchee, FL
Contact:

Re: VDRIVE and BasicChip

Post by basicchip »

Again that is just a warning from the C pre-processor

In many C header files (included files) you will see

Code: Select all

#ifndef THIS_FILE_HAS_BEEN_INCLUDED_ALREADY
#define THIS_FILE_HAS_BEEN_INCLUDED_ALREADY

...  the rest of the file ...

#endif
You can ignore the warning, or most of these files people just #define something related to the name of the file, so that it can be safely included by other files also included in main.bas without casuing duplicate statements.

basicchip
Posts: 1090
Joined: Fri Oct 19, 2012 2:39 am
Location: Weeki Watchee, FL
Contact:

Re: VDRIVE and BasicChip

Post by basicchip »

OK, the "removing comments" issue, I found, is caused by my text editor putting a strange control character at the end of any file it edits.
PS what text editor are you using?

I would not recommend that one. We now install a version of NotePad++ with the other Coridium files

ronr
Posts: 22
Joined: Tue Nov 05, 2013 8:17 pm

Re: VDRIVE and BasicChip

Post by ronr »

Thanks for all the comments and advice.
I'm using an old text editor (from the mid '80s) that I really like, but I worked-around the editor troubles now. I wasn't removing good code lines - it's that any edit in the included file put that control chr at the end, causing the compiler to stop after the include file.

I still wonder about that "multiple include guards may be useful for:" error message, but I don't see it anymore.

I have the Vdrive fully working now at 9600 baud.
I checked the command strings being sent to the vdrive. Using code pieces from the supplied "Vdrive.bas" for read and write, I saw the vdrive and/or BasicChip lock-up.

------The following is only an attempt to explain the initial troubles and confusion:--------
Here is an example of strange operation: in VdriveFileWriteString, the statements:
vdriveString$ = "WRF " + str(len(outString$)) + CR
SEROUT (vdriveRXD, vdriveBAUD, 1, len(vdriveString$), vdriveString$)
were producing the string:
WRF 19
when the outString$ was just ABCDE plus a carriage return. This locks-up the vdrive in LED-blinking mode.
I don't know why - but after a while "why ask why?", just try something else.
So when I used the statements:
V=len(outString$)
XOUT$="WRF "+STR(V)
vdriveString$=XOUT$+CR
SEROUT (vdriveRXD, vdriveBAUD, 1, len(vdriveString$), vdriveString$)
I saw it produce the string:
WRF 6
which is correct, and the vdrive works without trouble.

So, rather than trying to convert functioning old ArmMite code for the BasicChip, I wrote stuff from scratch, checking things along the way.
I like the BasicChip.

basicchip
Posts: 1090
Joined: Fri Oct 19, 2012 2:39 am
Location: Weeki Watchee, FL
Contact:

Re: VDRIVE and BasicChip

Post by basicchip »

Please post your Vdrive.bas file when it is doing what you want.

As for changing editors, I understand that is a painful process, I have given up on an old one only when it stopped running on newer Windows. That is why in the IDEs we use allow you to use the editor of your choice. Iam slowly moving over to NotePad++, but I still miss a couple of the keyboard shortcuts from my old favorite.

For "multiple include guards may be useful for:", those or more often used in C, and the pre-processor we used is written for C but hacked to handle BASIC comments. When programs get very big it makes sense to break them into pieces that make sense, especially when more than one person is working on them (I often define myself as multiple people when I haven't looked at one section of code for 6 months or more). In BASIC the definition of a set of global variables might be a good use for multiple copies of #include files.

fotso
Posts: 1
Joined: Sat Sep 28, 2019 12:48 pm

Re: VDRIVE and BasicChip

Post by fotso »

I looked at my copy of Vdrive.bas and only found it uses the Serial.bas library.
Looks like you would need 4 pins for the serial - RTS & CTS are used by the Vdrive device
-
what kind of code conversion issues are you having??

Post Reply