VDRIVE and BasicChip

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

Re: VDRIVE and BasicChip

Postby ronr » Fri Apr 08, 2016 7:55 pm

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: 759
Joined: Fri Oct 19, 2012 2:39 am
Location: Lake Tahoe, CA
Contact:

Re: VDRIVE and BasicChip

Postby basicchip » Fri Apr 08, 2016 9:48 pm

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: 759
Joined: Fri Oct 19, 2012 2:39 am
Location: Lake Tahoe, CA
Contact:

Re: VDRIVE and BasicChip

Postby basicchip » Fri Apr 08, 2016 9:51 pm

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: 759
Joined: Fri Oct 19, 2012 2:39 am
Location: Lake Tahoe, CA
Contact:

Re: VDRIVE and BasicChip

Postby basicchip » Fri Apr 08, 2016 9:55 pm

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: 19
Joined: Tue Nov 05, 2013 8:17 pm

Re: VDRIVE and BasicChip

Postby ronr » Mon Apr 11, 2016 8:56 pm

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: 759
Joined: Fri Oct 19, 2012 2:39 am
Location: Lake Tahoe, CA
Contact:

Re: VDRIVE and BasicChip

Postby basicchip » Mon Apr 11, 2016 9:10 pm

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.


Return to “Other Hardware interfaces”

Who is online

Users browsing this forum: No registered users and 1 guest