PDA

View Full Version : USB to USB flash Drive File Copier



emildownloads
- 6th December 2008, 09:38
Please help me my thesis is USB to USB file copier with out using Computer
i had read for compatible IC the VINCULUM
can you help me i need to use microcontroller the my problem is the source code
like for the display and commands for how to communicate that both IC can i ask for the codes or sample codes for file transfer and viewing the file tru LCD? thank you hope any one can help me

mackrackit
- 6th December 2008, 10:01
Please help me my thesis
What is your degree going to be in?

emildownloads
- 6th December 2008, 10:15
Electronics and commucation engineering
i am student can you help me for my thesis?

mackrackit
- 6th December 2008, 17:22
Yes, I and others here will help if you have a direct question, but do not look for someone doing your project for you.

That being said, I have played with a VDIP1 some and two of them connected to a PIC might do the job.

BrianT gave a nice starter example here, it is what I used to get started with the VDIP1.
http://www.picbasic.co.uk/forum/showthread.php?t=7700

emildownloads
- 11th December 2008, 06:43
im sorry
i mean just a little things to help me
thank you very much
can I ask for VNC1L firmware then it is needed to burned it to the IC like PIC microcontroller?
and it can be burned only for 1 firmware?

mackrackit
- 11th December 2008, 09:57
I can only talk about the VDIP1 as that is the only one I have used so far.

The VDIP1 comes with firmware burned in from the factory. The firmware can be modified / customized somewhat.

Here is a good page to start
http://www.vinculum.com/

This page has the different firmwares available
http://www.vinculum.com/downloads.html#vfirmware

Near the bottom of that page in applications and utilities. there is a program called
Vinculum Firmware Customiser (V1.1b)

This allows to modify some of the main settings of the firmware. Once the firmware has been modified, if using the VDIP1, copy the firmware to the root of a USB "thumb drive". Placs the drive into the VDIP1, at power up the VDIP1 will load the new firmware from the "thumb drive". This all can also be accomplished via serial port connected to the VDIP1 but the flash/thumb drive is so easy.

emildownloads
- 12th December 2008, 09:23
thank you mackrackit
soh it means only 1 firmware can be loaded for every VNCL IC
for my project that IC to transfer a files and i will put an LCD how can i acmmunicate that it is not easy to put a program on PIC rigth? any way
how can i use the PIC microcontroller and VNCL IC?
how they can communicate?
for VNCL firmware i know it has a free defined commands like in VDFC firmware
how can i control that commands if I use PIC microcontroller?
for example i use PIC18F458 how can i configure the output pins of the pic?
since the VNCL can accept the FIFO, UART or SPI. what is the examples codes for the pic like if i use picbasic commands? can i write the codes to manipulate the commands of VNCL but how can i control it to the pins of PIC microcontoller?
thanks, , ,

mackrackit
- 12th December 2008, 19:28
Up in post #4 I gave you a link showing how to WRITE to the VDIP1.

Here is the code from a project where I am READING from the VDIP1.
The VDIP1 part looks a lot like the writing example from BrianT. I used his same methods.

You should be able to connect two VDIP1s to the same PIC and with a little imagination do the copy.

Have you progrmed a PIC to do anything yet???



'#####################
'16F877A
DEFINE OSC 20
'####################
@ __config _HS_OSC & _WDT_OFF & _LVP_OFF & _CP_OFF &_BODEN_OFF
INCLUDE "modedefs.bas"

'LCD SET UP
DEFINE LCD_DREG PORTC
DEFINE LCD_DBIT 0
DEFINE LCD_RSREG PORTD
DEFINE LCD_RSBIT 1
DEFINE LCD_EREG PORTD
DEFINE LCD_EBIT 0
DEFINE LCD_BITS 4
DEFINE LCD_LINES 2
DEFINE LCD_COMMANDUS 2000
DEFINE LCD_DATAUS 50
'#####################
NUMS VAR BYTE[16]
VDAT VAR BYTE[96]
X1 VAR BYTE
X2 VAR BYTE
X3 VAR BYTE
X4 VAR BYTE
X5 VAR BYTE
X6 VAR BYTE
X7 VAR BYTE
X8 VAR BYTE
V1 VAR BYTE
V2 VAR BYTE
V3 VAR BYTE
V4 VAR BYTE
V5 VAR BYTE
V6 VAR BYTE
V7 VAR BYTE
V8 VAR BYTE
VinRXD VAR PORTD.7 'DATA TO VDIP
FLOWIN VAR PORTD.6 'FLOW CONTROL FROM VDIP

'#####################
PAUSE 1000
LCDOUT $FE,1,"MACKRACK"
LCDOUT $FE,$C0,"IT BV2"
PAUSE 1000


RUN:
'LCDOUT $FE,1,X1,X2,X3,X4,X5,X6,X7,X8
SERIN2 PORTB.5,24972,[WAIT("GRAM:"),STR NUMS\8] '7, Even, INVERTED
X1 = NUMS[0]
X2 = NUMS[1]
X3 = NUMS[2]
X4 = NUMS[3]
X5 = NUMS[4]
X6 = NUMS[5]
X7 = NUMS[6]
X8 = NUMS[7]
HIGH PORTD.2
PAUSE 100
LOW PORTD.2
PAUSE 100
LCDOUT $FE,1,X1,X2,X3,X4,X5,X6,X7,X8
PAUSE 100

'#########################
'START STICK
HIGH VinRXD
PAUSE 5
SEROUT2 PORTB.3, 24972,["MACKRACKIT",13,10]
SEROUT2 VinRXD,8588,["ECS",13] '7,E = 8588 , TRUE
HIGH VinRXD
PAUSEUS 10
SEROUT2 VinRXD,8588,["IPA",13]
HIGH VinRXD
PAUSEUS 10
WAIT11:
IF FLOWIN = 1 THEN WAIT11
SEROUT2 VinRXD,8588,["OPR ",X1,X2,X3,X4,X5,X6,X7,X8,".DAT",13]

WAIT12:
IF FLOWIN = 1 THEN WAIT12
SEROUT2 VinRXD,8588,["RDF 1000",13]
SERIN2 PORTB.4,8588,[STR VDAT\96]
V1 = VDAT[0]
V2 = VDAT[1]
V3 = VDAT[2]
V4 = VDAT[3]
V5 = VDAT[4]
V6 = VDAT[5]
V7 = VDAT[6]
V8 = VDAT[7]
PAUSEUS 10

WAIT13:
IF FLOWIN = 1 THEN WAIT13
SEROUT2 VinRXD,8588,["CLF ",X1,X2,X3,X4,X5,X6,X7,X8,".DAT",13]
WAIT14:
LCDOUT $FE,1,"FINISH"
IF FLOWIN = 1 THEN WAIT14
LCDOUT $FE,1,X1,X2,X3,X4,X5,X6,X7,X8
LCDOUT $FE,$C0," SENT"
'SEROUT2 PORTB.3, 24972,[V1,V1,V2,V3,V4,V5,V6,V7,V8,10,13]
SEROUT2 PORTB.3, 24972,[STR VDAT,10,13]
SEROUT2 PORTB.3, 24972,["DONE",10,13]
PAUSE 2000
GOTO RUN

newbie
- 24th November 2009, 10:33
guys...what compiler do you use for this code posted above by mackrackit?

mackrackit
- 24th November 2009, 10:49
I use Pic Basic Pro for the compiler and MPASM for the assembler.

newbie
- 25th November 2009, 13:53
thanks for the quick reply...

are these compilers and assemblers downloadable for free? i can only find a demo version and it is just capable of compiling 30 lines.

could you please give me the procedure on how to program the vinculum(vdip2) using pic microcontroller? i'm kind of confused. will the command set of the vinculum be included in the program that will be burned to the pic just like in the code above? i'm new at this so please help me...thank you very much.

mackrackit
- 25th November 2009, 17:24
Everything is free except PicBasicPro.

This sounds like a first project for you. Start with someting like blinking a LED at the push of a switch... Then come back to this, but up in post #4 there is a link showing how to write to the module.

newbie
- 26th November 2009, 13:18
you are right, this is the first project for me, so i'm really starting from scratch. ive seen post #4 but i have one question, what will i do with that code after compiling it, whats next? will i burn it to the pic? i really need your answer on this to start. thank you.

mackrackit
- 26th November 2009, 14:30
Most that use Pic Basic are probably writing the code using Micro Code Studio, you can use any text editor though MCS is pretty good.

When the code is written and the compile button is clicked MCS starts PBP which is a comand line program. PBP will turn the BASIC code into Assembly code. Then either PM or MPASM starts, this is selectable. PM or MPASM will turn the Assembly file into a HEX file.

The HEX file is what gets written to the PIC.

To get the HEX into the PIC a piece of hardware called a programmer is used. There are many to pick from. The programmer will have software to control the flow of data into the PIC and read back what was written to verify the code on the PIC.

Now the PIC is ready to power up and run.

What all do you have so we can help you get started with some learning code?

newbie
- 27th November 2009, 08:40
i have downloaded the pbp compiler but its just in a demo, it can only compile 30 lines. do you know any alternative compiler?

as for the materials that i have, i have here a pic16f877a and a programmer module for that pic. the vdip2 that i have ordered will be arriving soon.

newbie
- 27th November 2009, 08:49
please correct me if i'm wrong,

i will burn the program to the pic, then, i will connect the pic to the vinculum using uart mode. then the pic will be the one to issue commands to the vinculum and there is no need for the 232 connections. is that right?

also, how i'm i going to apply the vinculum command sets such as WRF and CLF ? will the compiler be able to understand them?

mackrackit
- 27th November 2009, 11:34
please correct me if i'm wrong,

i will burn the program to the pic, then, i will connect the pic to the vinculum using uart mode. then the pic will be the one to issue commands to the vinculum and there is no need for the 232 connections. is that right?

also, how i'm i going to apply the vinculum command sets such as WRF and CLF ? will the compiler be able to understand them?
Have you read the code examples posted here? How to read and write are both here.

As for a compiler, PBP is the only one I will recommend.
Practice blinking LEDs with the demo version and other small things first. Then try something bigger later.

You will not be able to make this work as a first project even if you had the full version of PBP.

newbie
- 28th November 2009, 01:20
about the shorts programs like the blinking leds, i have done that already. i already know how to program and burn in pic micro controller. my only problem is to connect it to the vdip, since this is my only first time to use the vinculum so.. was i right with this statement? :

"i will burn the program to the pic, then, i will connect the pic to the vinculum using uart mode. then the pic will be the one to issue commands to the vinculum and there is no need for the 232 connections"

mackrackit
- 28th November 2009, 02:27
I thought you said this was your first project...

If you know all the basics and read the examples you would have seen that the RS232 chip is not needed if you are bit banging the serial.

newbie
- 29th November 2009, 11:24
sorry for the misunderstanding...what I meant was this is my first project using the vinculum not the pic.

can you please tell me what you know about controlling the vinculum using a pic microcontroller. i need to know more info about this topic.

mackrackit
- 29th November 2009, 17:04
Pretty much what I have done with these are posted above. The above example is a data logger for a GPS. The link to the post from Brian T has the writing example. You can see on the GPS example how to collect data and save it to the module.

To be honest, the VDIP thing works well but is a pain in the _ _ _ .
I purchased two and ended up with one in the logger and the other is collecting dust. The data sheet is hard to follow and if it was not for Brian's post I do not think I could have made it work or would have given up.


If you are having a specific problem I am sure we can work though it.
Let us know.

newbie
- 30th November 2009, 12:37
alright thank you.. i will be working on my project and i will be posting the questions if there will be any problem while doing it (which i know there will :) )

newbie
- 10th December 2009, 14:20
Sir do you think it is possible to connect an external dvd drive to the vdip2? Since it is in usb interface can i write data to the external dvd using the vdip2?

mackrackit
- 10th December 2009, 17:07
Interesting idea.
My first thought was no, I do not think it would be possible.
But if you could find the commands from the drivers that normally run these things then why not??

I bet it will not be easy....

newbie
- 11th December 2009, 13:29
so im still gonna be needing driver commands to do it?
i wasn't as easy as i thought, i was thinking that since it has been converted to a usb interface, it would be able to interact with the vdip just like a flash drive with the writing as the burning to the dvd.

mackrackit
- 11th December 2009, 13:45
A couple of things off the top of my head that I am sure you will have to send to the burner somehow is
multi-write ?
finalize disk ?

I have never written a burning program for any platform so I am just guessing.

newbie
- 12th December 2009, 03:49
sir i tried to compile the program that you posted in post no.8, it didn't show any errors but in the middle of assembling the file, the MPASM prompted that there was an error (but didn't say what it is) and the progress bar for the asm file turned red. Did this program work for you? you used 16f877a right?

about the external dvd drive i will work on that as soon as i get my vdip2 working ... thanks!

mackrackit
- 12th December 2009, 11:36
Yes, that was a working program, with a 16F877A. Check your project directory and see what the *.ER and *.ERR files have in them.

A friend brought up the buffering problem with CD burners. Just does not seem like a good project for a PIC.

And another could be problem... You have to tell the VDIP exactly how many characters you will be sending though it.

newbie
- 13th December 2009, 06:59
sir this is what was inside the vinculum.err file

Error[118] C:\PBP\SAMPLES\LABXUSB\VINCULUM.ASM 198 : Overwriting previous address contents (2007)

what does this mean?

mackrackit
- 13th December 2009, 07:20
That is from the configuration line in the code.


@ __config _HS_OSC & _WDT_OFF & _LVP_OFF & _CP_OFF &_BODEN_OFF

Remove or comment out the above line and give it a try.

This tells about setting the "configs" in your code.
http://www.picbasic.co.uk/forum/showthread.php?t=543

You will be better of just writing you own code from scratch and use my code for an example. Then you know how everything is set up.

newbie
- 14th December 2009, 15:52
the program has been successfully assembled now. Thank you very much.
I will follow your advice and write my own program from scratch.

i was just wondering...did you use any simulator software for this program before burning it to the pic or you just burned it to the pic right after successfully assembling it?

mackrackit
- 14th December 2009, 16:08
I do not use any simulating programs, never ran across one that I trusted except the one built into MPLAB.
A bread board or two and parts are my simulator :)

newbie
- 28th December 2009, 15:34
sir do you use the software hyperterminal with the vdip? Are all the commands applicable for the hyperterminal for issuing commands to the vdip also applicable for vdip uart pic programming?

mackrackit
- 28th December 2009, 19:07
I do not use hyperterminal much. The serial communicator built into MCS is what I have been using.
Yes the commands are the same as you would send with a PIC.

newbie
- 29th December 2009, 17:01
sir can you please explain me this part of your code:

SEROUT2 PORTB.3, 24972,["MACKRACKIT",13,10]
SEROUT2 VinRXD,8588,["ECS",13] '7,E = 8588 , TRUE

what do you mean by the numbers such as 24972 and 8588 in this statement? also 13 and 10...

Ive been reading the comments in the code but still im confused..

Archangel
- 29th December 2009, 17:27
sir can you please explain me this part of your code:

SEROUT2 PORTB.3, 24972,["MACKRACKIT",13,10]
SEROUT2 VinRXD,8588,["ECS",13] '7,E = 8588 , TRUE

what do you mean by the numbers such as 24972 and 8588 in this statement? also 13 and 10...

Ive been reading the comments in the code but still im confused..

13 , 10 are linefeed and return, look at an ascii table for which is which, good thing to study anyway. The number 24972 tells the compiler what baud rate to use, it's in the book, near the back under tables, very near the ascii table . . .hint, hint. . .

newbie
- 31st December 2009, 06:34
thank you very much for that info...

have you used the command DIR and then printed the list of files to the the LCD?

mackrackit
- 31st December 2009, 15:26
thank you very much for that info...

have you used the command DIR and then printed the list of files to the the LCD?

I was "printing" to a terminal window, but a LCD would work also.

newbie
- 1st January 2010, 07:06
sir can you please tell me about the whole pin connections of the program back in post #8...

i could not see in there that you used the tx and rx pins of the pic16f877a..

mackrackit
- 1st January 2010, 08:10
Well, I did not use the TX/RX pins. I did not use the hardware ports.

VinRXD VAR PORTD.7 'DATA TO VDIP
FLOWIN VAR PORTD.6 'FLOW CONTROL FROM VDIP
and
PORTB.4 is data from the VDIP.

The other serial connections are to and from a PC. I was to lazy to rig a keypad so I was using a terminal to send data to the PIC to send commands to the VDIP.

You do not need to use the hardware serial ports from the PIC for this. SERIN2/SEROUT2 are fine for reading and writing to the VDIP. Have one other pin from the VDIP for FLOW control, this lets the PIC know if the VDIP is ready for another command.

I never did a schematic for this or I would post it.

newbie
- 3rd January 2010, 10:31
about the DIR command, how will i be able to display the data that the vdip will return? will i also use an array of bytes like in your program? or there will be a different approach?

mackrackit
- 3rd January 2010, 10:49
Are you wanting to display the output on a LCD? If so then you will need to break the array up to fit on the screen and maybe do "line by line" refresh using the array parts that will fit...

Below I was dumping the whole array to a PC terminal.


'Read from the VDIP
SERIN2 PORTB.4,8588,[STR VDAT\96]
'Send to PC terminal
SEROUT2 PORTB.3, 24972,[STR VDAT,10,13]

newbie
- 4th January 2010, 13:39
you mean right after i send the command

SEROUT2 VinRXD,8588,["DIR",13]

the commands that you wrote above will follow?

mackrackit
- 5th January 2010, 15:37
Yes, almost instantly after the command to do something is sent to the VDIP it will respond.
So you need to be ready to receive.

I am wondering about the direct copy from one device to another the more I think about it. The VDIP will send data all at once but you have to tell the VDIP how much data it is to receive. So you will somehow have to figure that part out.

Maybe there is a built in copy command with the VDIP?

newbie
- 6th January 2010, 13:14
there is a CPS command which i have read in the manual that will copy the source disk to the target disk
and the CPS-file which will copy a particular file from the source to the target disk. these are available only for the VDFC firmware..

have you tried these commands already? do you think that using these commands, i will still be needing to tell the vdip how much data to recieve?

mackrackit
- 6th January 2010, 13:49
No, I have not tried it. But if it is there it should work.
Changing the firmware is easy. So give it a try.

newbie
- 7th January 2010, 16:13
yes i would definitely do that.. but just to double check, after i have downloaded the reflash(ftd) for the VDFC firmware, will there be a need to rename it or do anything to it before saving it to the root of a flash disk?

mackrackit
- 8th January 2010, 01:08
The file needs to be named FTRFB.FTD
Put that file on the root of a USB stick and the VDIP should see it and re-do the firmware.

newbie
- 9th January 2010, 03:50
this is the name of the file that i downloaded in the website: ftrfb_main_03_65VDFC.ftd, so i will rename it to FTRFB.FTD...

now i will be redoing the firmware, i wii just be powering the vdip by its ground and vcc pins and i dont need to connect anything to the vdip yet right? how do i know if the firmware had already been installed?

mackrackit
- 9th January 2010, 07:01
I always had the VDIP outputting to a terminal so I could see what was going on.
There are two LEDs on board that blink in different sequences for different things. I do not remember the sequence but it is in the documentation.

Yes, I know the docs are hard to find and not well organized. That is one of the things that is bothersome about the company that makes them.

newbie
- 9th January 2010, 16:19
you are so right about that. They have a lot of PDF files about the vinculum but their contents are in a disorder. Anyway I have found the table of led behavior that indicates the status of the vdip but nothing i there indicates that a firmware had been installed.

I also did the firmware installation already, i powered the vdip on and then inserted the flash drive containing the firmware at its root. the led behavior indicated that it went to power on and then USB Disk Initialization then USB Disk Ready and then just stayed like that.

i do not have a level converter to connect the vdip to the computer so i do not have a view if my installation was a success.

i was thinking, since i have an lcd module, can i view the responses of the vdip through it?

mackrackit
- 9th January 2010, 16:35
You could use a PIC and the LCD, but it would be much easier to use a MAX232 or similar.
If you are going to be working with this stuff you need the tools.

newbie
- 10th January 2010, 08:56
ok i will get a max232 as soon as possible but for the mean time i will try to display the vdip's responses through my lcd module since i also need that in my projects.

about your program, you were using the array of bytes to display the name of the file but for the file extension, you just used ".DAT" right? my project is a file transfer device using the vdip so i have to recognize all kinds of file extensions that are there. so do you think something like this would work?

["OPR ",x1,x2,x3,x4,x5,x6,x7,x8,"."x9,x10,x11,13]

mackrackit
- 10th January 2010, 09:07
You have to tell the VDIP what to do at all times. It will read the files but then you have to have someway to "remember" what the file name and extension is if you want to do anything with it.

So that is why I used an array. The app I was doing all of the files were DAT so I did not have to worry about that part of it.

newbie
- 13th January 2010, 01:37
I've finally bought a max232 but i cannot find any schematic to connect it to the vdip and and also its connection to the computer. do you have any schematics that you can share with me? even just pin connections will do..

mackrackit
- 13th January 2010, 09:07
Google must have been down for awhile when you tried to find the info. It is working now though. Here is one of the things that came up.
Look at post #34
http://www.todopic.com.ar/foros/index.php?topic=24289.20

And the data sheets for almost any part can be found on google too.

newbie
- 15th January 2010, 11:34
Ive finally connected it into the computer's serial port and the vdip2 responded very well. i can already issue copy commands and the files were indeed copied from the source disk to the target disk. the problem is when i try to enter a sub directory, it only prints $00 $00 $00 $00... have you encountered this? I really need to view the files in the sub folders for file browsing.

mackrackit
- 15th January 2010, 13:43
Cool!!! You are making progress.

I did not play with sub directories much, I was just writing file to the root directory. But I do remember trying it.

Are you using the Extended Command Set with your firmware?

Looking at the
Vinculum Firmware User Manual
Version: 2.3
Issue Date: 2007-12-03

On page 30 section 6.2.1 Directory (DIR)
This statement is made:


Note that if the specified file is a directory, a size of zero will be displayed rather than a listing of the files in that directory.
So maybe you are there and do not know it???

newbie
- 15th January 2010, 14:38
I should thank you because you shared your knowledge with me that's why my project is developing. However, knowing the note from the firmware really hurt my feelings. how will i ever manipulate the file names for the file transfer if i cannot view them? Ive read in one of their manuals that the vdip can go down to 16 sud directories, how can they say that if they would only print zeroes? :mad:

mackrackit
- 15th January 2010, 14:53
However, knowing the note from the firmware really hurt my feelings.
Are you saying that I hurt your feelings?
I only ran across that note about five minutes before I posted it after looking through the manual for clues to your problem.

If I knew how to do what you are wanting I would gladly tell you how.

After you receive the zeros, what happens if you send another DIR command?

The manufacturer also has tech support if all else fails.

newbie
- 16th January 2010, 14:17
oh no you got me misunderstood.. that just meant that i think I'm in a little bit of a trouble not being able to view the sub directories. I will ask the vinculum's customer support about this matter, and for the mean time i will be concentrating on the files located on the root..i wasn't successful the first time i interfaced the vdip2 to the pic16f877a. I could not get any response from the vdip. all i get are weird characters printed in the lcd even when the vdip is turned off. have you encountered this?

mackrackit
- 16th January 2010, 14:34
OK. I get what you mean.

Contact teck support and see what they say.

In the mean time post your code and configs along with a schematic here and maybe if we are lucky someone will see the problem.

newbie
- 16th January 2010, 16:01
DEFINE OSC 20
INCLUDE "modedefs.bas"

DEFINE LCD_DREG PORTC
DEFINE LCD_DBIT 0
DEFINE LCD_RSREG PORTD
DEFINE LCD_RSBIT 1
DEFINE LCD_EREG PORTD
DEFINE LCD_EBIT 3
DEFINE LCD_RWREG PORTD
DEFINE LCD_RWBIT 2
DEFINE LCD_BITS 8
DEFINE LCD_LINES 4
Define LCD_CHARS 20
DEFINE LCD_COMMANDUS 2000
DEFINE LCD_DATAUS 50

VTXD VAR PORTB.0
VRXD VAR PORTB.1
Flowin VAR PORTB.2

Pause 500

Lcdout $fe,$C0, " Please Insert Your "
Lcdout $fe,$94, " Flash Drive "
Pause 100

RESP VAR BYTE[16]

X1 VAR BYTE
X2 VAR BYTE
X3 VAR BYTE
X4 VAR BYTE
X5 VAR BYTE
X6 VAR BYTE
X7 VAR BYTE
X8 VAR BYTE

checkvin:

SEROUT2 VRXD,8588,["ECS",13]
HIGH VRXD
PAUSEUS 10
SEROUT2 VRXD,8588,["IPA",13]
HIGH VRXD
PAUSEUS 10

WAIT1
IF Flowin = 1 THEN WAIT1
SEROUT2 VRXD,8588,["DIR",13]
PAUSE 100
SERIN2 VTXD,8588,[STR RESP\8]

X1 = RESP[0]
X2 = RESP[1]
X3 = RESP[2]
X4 = RESP[3]
X5 = RESP[4]
X6 = RESP[5]
X7 = RESP[6]
X8 = RESP[7]
X9 = RESP[8]
X10 = RESP[9]
X11 = RESP[10]
X12 = RESP[11]

PAUSE 100
LCDOUT $FE,1,X1,X2,X3,X4,X5,X6,X7,X8,X9,X10,X11,X12
PAUSE 2000




As you can see I ripped a part of your code. pardon me for doing so. I just wanna see if the vdip would respond to the pic. This program is pretty short, I just wanted to display the first file it detects to the lcd. I wouldn't want to write a long program and then start wondering what part of the code went wrong after wards. Once I get a response even just one file name from the directory then will start to write my own program including the file browsing.

newbie
- 17th January 2010, 07:32
I can now view the files in the sub directories...this is my bad.. I was entering DIR (file), this command would only list the specified file and size. I did not see until now that these was another command that will change the current directory, its CD (folder). my bad sorry. now i can go on and make a program once i get responses from the vdip with the pic controlling it.

mackrackit
- 17th January 2010, 15:34
Great!!! Progress!!!

No problem ripping the code, that is what it is there for.

Writing a little and testing is the way to do it. That is why ICSP is so handy.

Keep us posted.

newbie
- 20th January 2010, 09:18
are there any string manipulation commands in picbasic pro?

mackrackit
- 20th January 2010, 09:59
are there any string manipulation commands in picbasic pro?
Yes and no.
The serial type commands can manipulate strings up to a point.
Using arrays you can do pretty much what ever you want.

newbie
- 20th January 2010, 12:34
regarding the arrays..does it support string arrays? I haven't found any examples about string arrays in picbasic pro. I tried do something similar to your code but instead of storing characters i tried to store strings. I received errors upon compiling the code. Do you have some sample codes you can share? Also, what do you mean by serial type commands?

mackrackit
- 20th January 2010, 13:36
A string can be saved to an array and the serial type commands are.....
SERIN
SERIN2
HSERIN

This is all in the manual.
More info is here
http://www.picbasic.co.uk/forum/showthread.php?t=544

And many examples are here
http://www.melabs.com/resources/samples.htm

newbie
- 20th January 2010, 14:23
thanks for the quick reply... so those are the serial type commands..I already know them and their functions I just didn't know that they are called that.

Ive already visited the links..these will be big help. thank you.

mackrackit
- 20th January 2010, 14:33
:)
I do not know if anyone else calls them that.... But it works for me.

newbie
- 23rd January 2010, 13:51
Are you wanting to display the output on a LCD? If so then you will need to break the array up to fit on the screen and maybe do "line by line" refresh using the array parts that will fit...


Any idea on how to do this? I was thinking to display arrays of 12 in every line so that it can support the 8.3 format set by the vinculum. the problem is, not all files follow the 8.3 format specially those with file names shorter than 8 characters. for example, i have a file named "pic.pdf" as you can see there will be 5 vacant array spaces for this line so the succeeding file's first 5 characters will occupy those vacant spaces then there will be a domino effect and the file names will be in a total disorder. do you have any idea on how i will know when it is the end of one file and the start of the next so that i can print it in a new line?

Archangel
- 23rd January 2010, 21:21
Any idea on how to do this? I was thinking to display arrays of 12 in every line so that it can support the 8.3 format set by the vinculum. the problem is, not all files follow the 8.3 format specially those with file names shorter than 8 characters. for example, i have a file named "pic.pdf" as you can see there will be 5 vacant array spaces for this line so the succeeding file's first 5 characters will occupy those vacant spaces then there will be a domino effect and the file names will be in a total disorder. do you have any idea on how i will know when it is the end of one file and the start of the next so that i can print it in a new line?If I follow you . . . 10 is line feed, 13 is carriage return, 32 is a space so . . . "pic.pdf",32,32,32 would display as pic.pdf and 3 spaces, which using serout you would just put 3 spaces after pic.pdf but within the "" marks, I have not used the 10,13 codes with an lcd so I do not know if they work, and my bench is upside down right now :) so anyway you could preload your array with all 32s and then write your file name into it . . . best way to me is to tell the lcd where to print it.

newbie
- 24th January 2010, 11:26
does the vdip issue a line feed and a carrage return in every end of a file?


. . . best way to me is to tell the lcd where to print it.
can i view it your way? how would you do it?

newbie
- 24th January 2010, 14:07
I still haven't been able to get a response from the vdip when I connect it to the PIC and LCD. Still weird characters come out of the LCD. I'm using a 4Mhz xtal oscillator right now because when I tried to use a 20Mhz xtal the pic would not respond to any program..Do you think the oscillator has got something to do with it?

If you could give me a schematic of vdip connected to the pic16f877a including the extra components, that would really help...

mackrackit
- 25th January 2010, 11:54
I do not have a schematic so I will have to refer you back to the post BrianT made.
http://www.picbasic.co.uk/forum/showthread.php?t=7700

Archangel
- 25th January 2010, 19:08
does the vdip issue a line feed and a carrage return in every end of a file?


can i view it your way? how would you do it?

Here is a Map of the LCD Display giving the address of each cell. simply do as the book says and use that address where you want the first character to appear.
example:
LCDOUT $fe, 128, "this example uses "
LCDOUT $FE,192,"the first 2 lines"

see the numbers 128, 192, find them on the chart.
It makes no difference if you use decimal or hex representations. 128 = $80, $FE = 254
LCDOUT 254,1 will clear all characters from the screen.

newbie
- 26th January 2010, 11:55
After a couple of tests I still have no success in interfacing the vdip to a pic16f877a microcontroller but i have found out that the program hangs whenever it reaches a serin2 command. I checked if the flowin was high but i wasn't...it was low the whole time the program was running so i'm pretty sure it wasnt trapped in an infinite loop. have any one encountered this?

mackrackit
- 26th January 2010, 12:46
Can you post the code?

When you setup the firm ware for the VDIP, what baud rate did you give it?

You were able to communicate with the VDIP using a terminal, correct?
What baud rate did you use then?

newbie
- 26th January 2010, 13:11
The code i used was same as the code that i posted above...

I used the default baud rate which is i think 9600...do you think i should change it to 2400?

I also found out that it can be risky for flash drives.. it broke my disk just now..

mackrackit
- 26th January 2010, 13:31
The baud rate in your code is not for 9600. The baud you are using is from my code.
You need 84, I think...

What do you mean broke? What happened?

newbie
- 26th January 2010, 16:55
I tried changing the baud rate of the vdip to 2400 using its SBD command but it does not work...the vdip only works properly when the computer terminal's baud rate is 9600. you used the 2400 baud rate in your program right? how about your vdip? what was its baud rate?

newbie
- 26th January 2010, 17:07
about my flash drive after using it for testing it suddenly could not be read by the computer. It can be detected normally and even assigns to a proper letter but when i open it, the computer prompts "please insert a disk in drive F " or something like that...

anyways moving on...
Ive read that 4Mhz oscillators are pretty much unreliable with 9600 baud rate so i might have to change it.. the problem is I cant get any program running in my pic when i change its clock to 20Mhz..is there any other component that needs to be changed?

mackrackit
- 26th January 2010, 17:16
When you set up the VDIP's firmware there is a place to set the baud rate and hand shaking. If I remember correctly this is on the first tab of the firmware set up program.

I had mine set for 4800 7E1.

The OSC needs to match the DEFINE in your code.

newbie
- 27th January 2010, 14:02
Ive changed the baud rate of the pic in the program to 84 and when nothing changed, i tried 8276. I based the baud rate codes from the table in this page:
http://melabs.com/resources/ser2modes.htm
..but still the program hangs up when it encounter a serin2 command. still the flowin is low so no infinite loop is happening.

any other suggestions?

mackrackit
- 28th January 2010, 08:10
Re-read this.
http://www.picbasic.co.uk/forum/showthread.php?t=7700

Post your current code and a schematic.

newbie
- 28th January 2010, 17:47
INCLUDE "modedefs.bas"

DEFINE LCD_DREG PORTB
DEFINE LCD_DBIT 0
DEFINE LCD_RSREG PORTD
DEFINE LCD_RSBIT 1
DEFINE LCD_EREG PORTD
DEFINE LCD_EBIT 3
DEFINE LCD_RWREG PORTD
DEFINE LCD_RWBIT 2
DEFINE LCD_BITS 8
DEFINE LCD_LINES 4
Define LCD_CHARS 20
DEFINE LCD_COMMANDUS 2000
DEFINE LCD_DATAUS 50

VinTXD VAR PORTC.7 'AD0
VinRXD VAR PORTC.6 'AD1
FlowIn VAR PORTC.5 'AD2

Pause 500 ' Wait for LCD to startup

mainloop:
Lcdout $fe, 1, "********************"
Lcdout $fe,$C0, " PORTABLE FILE "
Lcdout $fe,$94, " TRANSFER DEVICE "
Lcdout $fe,$d4, "********************"
Pause 3000 ' Wait 2 secondS



NUMS VAR BYTE[16]

X1 VAR BYTE
X2 VAR BYTE
X3 VAR BYTE
X4 VAR BYTE
X5 VAR BYTE
X6 VAR BYTE
X7 VAR BYTE
X8 VAR BYTE
X9 VAR BYTE
X10 VAR BYTE
X11 VAR BYTE
X12 VAR BYTE

StartDisk:


HIGH VinRXD
PAUSEUS 1000
SEROUT2 VinRXD,8588,["ECS",13]
LCDOUT $FE,1, "1"
HIGH VinRXD
PAUSEUS 1000
SEROUT2 VinRXD,8588,["IPA",13]
LCDOUT $FE,1, "2"
HIGH VinRXD
PAUSEUS 1000
SEROUT2 VinRXD,8588,["A:",13]
LCDOUT $FE,1, "3"
HIGH VinRXD
PAUSEUS 100
SEROUT2 VinRXD,8588,["DIR",13]
LCDOUT $FE,1, "4"
PAUSEUS 1000
WAIT1
IF FLOWIN = 1 THEN WAIT1
SERIN2 VinTXD,8588,[STR NUMS\12]
LCDOUT $FE,1, "5"

X1 = NUMS[0]
X2 = NUMS[1]
X3 = NUMS[2]
X4 = NUMS[3]
X5 = NUMS[4]
X6 = NUMS[5]
X7 = NUMS[6]
X8 = NUMS[7]
X9 = NUMS[8]
X10 = NUMS[9]
X11 = NUMS[10]
X12 = NUMS[11]

PAUSE 100
LCDOUT $FE,1,X1,X2,X3,X4,X5,X6,X7,X8,x9,x10,x11,x12
PAUSE 2000
goto StartDisk



here is my code. its almost the same as the one that i posted earlier..

i changed the baud rate back to 8588 in the program and tried to change the vdip's baud rate to 4800 in the comport monitor using the SBD $710200 (change baud rate to 4800) command but the monitor just printed weird characters and then the comport monitor stopped responding. When i restarted the connection, the vdip was still working properly in 9600 baud rate and not in 4800.

i also tried to change the baud rate of the vdip using a newly modified firmware with 4800 set as its baud rate. I saved it in a flash drive and inserted it to the vdip but when I entered the command FWU ftrfb.ftd (firmware upgrade ftrfb.ftd), the monitor printed "No Upgrade". obviously that was a failure.

I haven't made a circuit diagram yet since im still testing with breadboards. I do have a working PIC development board where i interfaced the lcd and the vdip..here are the pin connections.

LCD DATA LINES - PORTB
LCD RS BIT - PORTD.1
LCD RW BIT - PORTD.2
LCD E BIT - PORTD.3

VinTXD(AD0) - PORTC.7
VinRXD(AD1) - PORTC.6
RTS(AD2) - PORTC.5
CTS(AD3) - GND

OSC 4MHZ

mackrackit
- 29th January 2010, 14:27
I had a little extra time so I dug out my VDIP1.

Where to start...
I see you are running the PIC at 4Mhz so 9800 baud may be a bit fast so lets work with 4800 baud.

We need to get your VDIP working at 4800, 8, N, 1.
The zip file attached has FTRFB.FTD in it. Unzip the zip and put the FTD file on a blank USB stick. The VDIP should see this file and do a firm ware upgrade. You do not need to send any commands at this point.

I have the VDIP1 connected to a terminal to see what is going on.
VDIP connections:
PIN1 = 5VOLT
PIN6 = PIN11 on a MAX232 PIN14 on the MAX goes to PC serial PIN2
PIN7, 10, and 18 = GROUND (ZERO VOLTS)
You can take PIN22 LOW to reset the VDIP1

A screen shot of the VDIP running at 9800 changing to 4800.
http://www.picbasic.co.uk/forum/attachment.php?attachmentid=3938&stc=1&d=1264774277

And a screen shot of the VDIP running at 4800 rebooted to the same USB stick.
http://www.picbasic.co.uk/forum/attachment.php?attachmentid=3939&stc=1&d=1264774277

I will try to get more time later this weekend to play some more.

newbie
- 30th January 2010, 14:14
does the serial communicator automatically change the firmware at the start of the connection? no need to enter any commands?

mackrackit
- 30th January 2010, 14:28
To upgrade the firmware you do not need to send any commands. If the VDIP sees a new firmware it will upgrade to it. When a new firmware is "built" a three character ID is given to it. The ID is whar the VDIP looks at.

The firmware I gave you has NE1 as the ID. If the ID is the same the VDIP will return "No Upgrade".

Go down to post #19 here.
http://www.picbasic.co.uk/forum/showthread.php?p=83888#post83888

newbie
- 30th January 2010, 18:27
I use the hyper terminal for serially communicating the vdip to the rs232. ive attached the level converter circuit that i used here in this post. you might as well take a look at it and see if it differs from the one that you know. that circuit worked very well when i used the hyper terminal but when I tried to use the microcode's serial communicator, it didn't respond to anything that i did. i reconfigured the circuit according to you pin assignments but the results were the same. does this have anything to do with me using vdip2 and you using vdip1? but then im pretty sure that i carefully reassigned the pins in the vdip2 that are equivalent to the vdip1.

since microcode's serial communicator does not work for me, i switched back to hyper terminal but when i inserted the flash disk with the new firmware in it(with a different 3 letter ID), it did not detect any upgrade. so i was forced to use the command used for upgrading the firmware. I typed in FWU FTRFB.FTD. after that it prompted:

ChangeMAINTD
Reflasher Active
Rebooting

for a moment i look like the one in your printscreen but then after a few seconds it displayed the previous firmware with the previous firmware ID and the vdip2 was still working at 9600 baud rate. Ive also attached the printscreen of that event in this post. you may see it for yourself.

what can you say? should i stop trying to change the vdip2's baud rate and make the pic micro controller adapt to it instead?

mackrackit
- 30th January 2010, 21:16
I this point I would say yes, run at 9600. I do not have a VDIP2 to test so I am at a loss.
9600 normally requires an OSC faster than 4Mhz though.

newbie
- 31st January 2010, 16:36
i already have the microcontroller working with a 20MHZ cystal. I had to follow this line of your code

__config _HS_OSC & _WDT_OFF & _LVP_OFF & _CP_OFF &_BODEN_OFF

and set it in the icprog's configuration before burning the program.

after that, i went back to interfacing the pic16f877a to the vinculum and burned the program back in post #87 (with 84 as the code for the baud rate) to the pic . but then the same problem occurs. the operation halts when the pic encounters a serin2 command.

I know im doing something wrong because the vdip works perfectly with the max232.

i was thinking about you code. you were using the code 8588 which is equal to 2400 as the baud rate for your pic right? and you mentioned that the baud rate you used with your vdip was 4800. can you tell me that reason behind that? why does your vdip and your pic have different baudrates?

also, did you notice anything wrong in my code in post #87?
I have to say thank you for all your help.

mackrackit
- 31st January 2010, 23:10
What are the settings for the serial port with hyper-terminal? 9600, 8, N, 1?
If so the 84 should work. If "E"ven then try 8276.

The code you posted has the wrong baud. But lets start over, sort of.

With the VDIP connected to the PC as you had it just sen a couple simple commands to the VDIP with the PIC and see if the PC will display the return.
The below should cause the VDIP to diplay on the terminal a
D:\>
every 1.5 seconds..
At least it is here...


VinRXD VAR PORTD.7 'DATA TO VDIP PIN #8 OM VDIP1
FLOWIN VAR PORTD.6 'FLOW CONTROL FROM VDIP PIN #9 ON VDIP1

START:
HIGH PORTD.2 'LED
PAUSE 250
LOW PORTD.2
PAUSE 250
SEROUT2 VinRXD,84,["ECS",13] '9600 TRUE
HIGH VinRXD
PAUSEUS 10
SEROUT2 VinRXD,84,["IPA",13]
HIGH VinRXD
PAUSEUS 10
WAIT111:
IF FLOWIN = 1 THEN WAIT111
PAUSE 1000
GOTO START

newbie
- 1st February 2010, 14:10
i have tried what you suggested. I burned your program to the pic and then had the tx of the vinculum to the max232 connected to the pc.
what happened was the pc just printed this:

Ver 03.66-123VDFCF On-Line:

the LED did go high as stated in the program but the vinculum commands seemed that they may not have been recognized.

what do you think is the problem with this? Im running out of clues on why its still not working but i think that the problem is just within the pic microcontroller since the pc had been able to send and receive commands through the max232 or maybe its still the baud rate..

about the hyper terminal's config, yes, it was indeed 9600,8,N,1.

mackrackit
- 1st February 2010, 17:48
ok,

Lets back up a bit and make sure the PIC is communicating properly.
Connect the PIC to the PC without the MAX232, we will be using inverted mode.
The below code will send to the terminal only when "SOS" is sent to the PIC, from the terminal.

If this does not work then we know the problem is with the PIC... being you can communicate with the VDIP via the PC terminal.


X VAR BYTE
X = 0
TXOUT:
X = X + 1
SERIN2 PORTC.5,16468,[WAIT("SOS")]
SEROUT2 PORTC.4,16468,["MESSAGE RECEIVED!!!",13]
SEROUT2 PORTC.4,16468,["THIS IS A TEST",13]'9600 INVERTED
SEROUT2 PORTC.4,16468,[DEC X,13]
PAUSE 250
GOTO TXOUT

http://www.melabs.com/resources/ser2modes.htm

newbie
- 2nd February 2010, 10:54
how will i be able to connect the pic16f877a to the rs232 without the use of level coverter? will the pic and the pc be able to understand each other?
and most importantly, wont that be dangerous for my pc?

i will do the interfacing of the pic directly to the pc once i get a reply from you.

knowing that my pc will be safe with the max232., i gave it a try and connected it to the pic. I burned you program and set the config that you've given me to the hyper terminal. the result was, there was no response..i was even having a hard time typing the word SOS because the hyperterminal was slow to respond with every key pressed.

mackrackit
- 2nd February 2010, 13:16
One of the nice things about SERIN2 and SEROUT2 is a 232 is not needed. That is what inverted mode is for. Look in your PBP manual for details for the connection.

You can use a 232 but you will have to change the mode to TRUE.

Hyperterminal..... I do not use it.
I have been using the terminal app that comes with MCS. For this kind of thing it works well.

newbie
- 2nd February 2010, 13:22
when i used the max232 i changed the baudrate code to 84...

so you mean i will just have to connect the PORTB.4 and PORTB.5 to the pins 2 and three of the rs232? nothing more as far as hardware are concerned?

mackrackit
- 2nd February 2010, 13:33
I am not sure what you mean by pins 2 and 3 on the 232?
And I was using portC in my code.

The purpose of this exercise is to make sure the PIC is comunicating properly. So look at the PBP manual for the digram to connect the PIC without a 232.

This way we have eliminated a "variable" in the system that could be causing trouble.

One PIC and one PC with a couple resistors.

newbie
- 2nd February 2010, 13:41
Im sorry about that..what i meant was PORTC.4 and PORTC.5
and will they be connected to the pins 2 and 3 of the rs232 which i believe is the receive and transmit pins.
what will be the values of the resistors and where will i be putting them?

newbie
- 2nd February 2010, 16:44
Ive did what you told me to do but i had no response from the pc. i even found a code which i think is the simplest serial communication code there is in this page:
http://www.cornerstonerobotics.org/code/serout2_hello.pbp
though had to do some changes since the code requires PIC16F88
but still i have no response from the pc...

i also tried to use serout and serin to see if the pic would work with them but still no success..

how can this be when the pic works normally with LCDs, pushbuttons, leds etc...

Archangel
- 3rd February 2010, 08:27
Hi Newbie,
I am guessing, you do not have the manual. Just put a 1k resistor in series with your PIC ports to the PC. This is to protect the PIC from excessive current, due to the different voltages present in the PC. I suggest you download Realterm (it's free ) and use instead of the Miserable hyperterm in WinDoZE . Send your data inverted without the RS232 converter or if you ARE using it, send your data TRUE.
Example: serout PortC.4,N9600,["Hello World"]
You will have to include modedefs.bas if you use the mode aliases T9600, N9600 . . . . and make sure whatever terminal program you use is connected to the same serial port you are using, that alone may be your problem.

newbie
- 4th February 2010, 15:22
it was already too late when i found the right schematic for interfacing the pic to the pc. my pic was already not working with any program probably because i failed to put a 1k resistor like what Joe said the first time i interfaced it. I will purchase a new pic16f877a right away and get going with my project once again.

newbie
- 8th February 2010, 18:23
finally something good happend...
i can already print the file names inside the flash drive to the LCD :)
the cause of why i could not print anything earlier was maybe because of the timing of the execution of the command. there where probably times when the vdip was already sending data to the pic but the pic was still busy of doing another thing like printing welcome notes to the lcd (or something like that..) so the data could not the printed to the the lcd.so what i can is, the PAUSE command plays a major role.

as for the printing of the file names, im having trouble arranging the files line by line to the lcd..primarily because they do vary in length and also other weird characters come in between some of the words which i guess are due to the line feed or carriage return..

does anyone have any idea of how i can save a string into a different variable each time a line feed of carriage return is encountered?
or are there any alternative way...id like to see it...

cyrus88
- 9th February 2010, 06:52
hi, izzit possible to connect vdip2 with hyper terminal using max233 instead of max232

mackrackit
- 9th February 2010, 11:49
finally something good happend...
Glad to hear you have something working..

i can already print the file names inside the flash drive to the LCD :)
the cause of why i could not print anything earlier was maybe because of the timing of the execution of the command. there where probably times when the vdip was already sending data to the pic but the pic was still busy of doing another thing like printing welcome notes to the lcd (or something like that..) so the data could not the printed to the the lcd.so what i can is, the PAUSE command plays a major role.

as for the printing of the file names, im having trouble arranging the files line by line to the lcd..primarily because they do vary in length and also other weird characters come in between some of the words which i guess are due to the line feed or carriage return..

does anyone have any idea of how i can save a string into a different variable each time a line feed of carriage return is encountered?
or are there any alternative way...id like to see it...


Joe's idea http://www.picbasic.co.uk/forum/showpost.php?p=83447&postcount=73 is probably the way to do this. Just have the string terminate when EOF is returned.

mackrackit
- 9th February 2010, 11:52
hi, izzit possible to connect vdip2 with hyper terminal using max233 instead of max232
Do you know the difference between the two parts?

newbie
- 9th February 2010, 16:32
line feed is 10 right? if i would have the line feed to an IF statement, how would i get the compiler to understand that I am pertaining to 10 as the line feed and not the number itself? would i need to put a preceding sign like # or $ or should i just put 10 without the "" marks?


Just have the string terminate when EOF is returned.
are you talking about the array of bytes as the string in here? or is there a way to save the group of characters into one string constant?

newbie
- 17th February 2010, 18:31
hi! here's what has happening to my project so far... ive been interfacing a vdip2, a pic16f877a and a 4x20LCD. i can already print the responses of the vdip to the LCD..but my problem is that some characters appear in between the file names which do not appear when the vdip is connect to the pc. ive searched the ascii tables http://www.ascii-code.com/ to see if these characters have an equivalent hex code so that i can use it for the wait() command in picbasic pro..but i did not find the characters in the table. i first thought that it was a line feed but when i used the code $0A(line feed) for the serial wait() command, it did not work... do you have any idea on these characters are? ive attached some images, you might want to take a look on what these characters look like...4004

4006

4007

4008

4009

mackrackit
- 17th February 2010, 19:24
Looks like you about have it!!! Good job!!!

Look at the data sheet for the display and there should be a "Character Font Table". Those characters show up there.

Why the commands are being sent to your display and how to fix it I do not know...
Thinking....

newbie
- 18th February 2010, 19:12
i have a data sheet of the display...some of the characters of the are found in there but some aren't. these reason i have my eyes set on these weird character is because i think they would be the key to sorting the file names since the appear in between them.basing on the pictures above, do you have any idea on how i can sort the file names so that i can print only one file name per line? ive been trying joe's suggestion but so far i have no success.

Archangel
- 19th February 2010, 01:09
i have a data sheet of the display...some of the characters of the are found in there but some aren't. these reason i have my eyes set on these weird character is because i think they would be the key to sorting the file names since the appear in between them.basing on the pictures above, do you have any idea on how i can sort the file names so that i can print only one file name per line? ive been trying joe's suggestion but so far i have no success.Hi Newbie,
Sometimes weird characters are due to the clock or baud being off. They can occur if the LCD's power is not bypassed adequately with a capacitor. What I do to check things like this is to make a counter loop which outputs a count from 0 to xxx and also outputs a space after and also outputs the counter variables actual count, and I watch for the character to appear and see what number makes it so.

Archangel
- 19th February 2010, 02:21
Something like this


B var word
counter var word
main:
counter = 0
b = 0
lcdout $FE,1 ' Clear LCD
for counter = 0 to 255


LCDOUT $fe,$2,b," ",#counter
PAUSE 250
b = b + 1
next counter
goto main

mackrackit
- 19th February 2010, 06:06
About a year ago I had the bright idea of using a PIC and a VDIP1 to transfer file to a Burny 2.5 CNC controller. I could never get it working properly and gave up.

The Burny was never happy with the data being sent to it. My simulation software worked fine. I wonder if what newbie is seeing was the problem with the Burny?

Somehow the VDIP is sending "ghost" info??

newbie
- 20th February 2010, 13:01
hi guys thanks for the replies but i think i got it...
the weird characters were carriage returns ($0d).
4025
i used this code..


CRET VAR BYTE
CRET = $0D
SERIN2 VinTXD,84,[WAIT(CRET),STR FILE1\12 \CRET,WAIT(CRET), STR FILE2\12 \CRET,WAIT(CRET),STR FILE3\12 \CRET,WAIT(CRET),STR FILE4\12 \CRET]

as you can see i waited for every occurrence of the carriage return and saved the characters found between them into an array of string.

the weird characters that you can see at the end of some files names in the lcd are i think blank or null arrays since i allocated 12 array places for every file name found but not all of them would be 12 characters long..some are less.

now could you suggest any better way of storing these file names?
because i think if i do it this way, my pic microcontroller would quickly run out of space to save all of the characters from the file names and if the flash drive inserted is very populated then the files names not saved in the array would not be displayed.

Archangel
- 20th February 2010, 19:13
If the file names are always the same, you could assign them each a number, and store the names in eprom, or if they have all the same name with a number, even easier, just display the name followed by the number received. Unless I am missing something due to inadequate supply of coffee :) .

mackrackit
- 20th February 2010, 22:49
You might try what Joe suggested before and pre-populate the arrays with a known value.

newbie
- 21st February 2010, 11:14
If the file names are always the same, you could assign them each a number, and store the names in eprom, or if they have all the same name with a number, even easier, just display the name followed by the number received.
here is the rule about the files from the vinculum:
Filenames are made up of an 8 character main part and an optional 3 character extension. The presence of a ’dot’ character in the filename indicates the boundary between the main part and the extension. The name may be up to 12 characters long, including the ‘dot’ character.

can you give me a sample code about this? I'm not that familiar with eproms.


You might try what Joe suggested before and pre-populate the arrays with a known value.
ive been thinking about doing that..but the thing is if the length of the file names is less than 12, i might have trouble retrieving only the arrays that were inserted with the file name characters. if i include the arrays that were not over written by the file name characters and still contains the pre loaded value, the vdip2 would respond "command failed".

mackrackit
- 21st February 2010, 11:47
ive been thinking about doing that..but the thing is if the length of the file names is less than 12, i might have trouble retrieving only the arrays that were inserted with the file name characters. if i include the arrays that were not over written by the file name characters and still contains the pre loaded value, the vdip2 would respond "command failed".
What if you populate the array with a character that would probably not be used in a file name, (~), and parse the array for that before the array is used again.

Or, have a "working" array. This would be one that stored arrays are parsed into for using.

Stored array with (~) character
Stored array re-written into sandbox array
Sandbox array is sent to VDIP
Start over with next stored array.

Maybe....

newbie
- 21st February 2010, 13:44
What if you populate the array with a character that would probably not be used in a file name, (~), and parse the array for that before the array is used again.

Or, have a "working" array. This would be one that stored arrays are parsed into for using.

Stored array with (~) character
Stored array re-written into sandbox array
Sandbox array is sent to VDIP
Start over with next stored array.

Maybe....
are saying its like this:
say you have an array named FILE1 with 12 array places, i will pre-load it with (~) so...
FILE1 = [~][~][~][~][~][~][~][~][~][~][~][~]

and then when i receive a file named "vdip.txt" from the vdip serially, then the array would be like:
FILE1 = [v][d][i][p][.][t][x][t][~][~][~][~]
am i right with this? please correct me if im wrong...

then when i want to send command to the vdip that i want to copy that particular file, i will be sending the "CPS" command plus the array of bytes stored in FILE1 including the bytes that contains [~] back to the vdip, but the vinculum is very strict with the spelling...if i include these bytes it will respond with "command failed" if only i could remove those unneeded bytes before sending it back to the vdip...

am i getting your idea right?

mackrackit
- 22nd February 2010, 08:52
Thinking more about this the "~" will not do you any good. Still need to re-write the array but...

Assume file names should only contain letters and numbers. The problem is other characters are showing up..
So when the file name is read from the VDIP say it is saved into "arrayF". Before "arrayF" is used again it needs checked for bad characters. Right?

Again have a working array that will be used and/or reused to send back to the VDIP, "arrayW".

The bad characters are at the end of the name?
What if you check each bit of "arrayF" and IF the bit equals A-Z or 0-9 then that bit will be written to "arrayW". When the first bad character bit is found the re-write loop stops.
Now "arrayW" should only contain valid characters.

This thread should give you some ideas on how to process the arrays.
http://www.picbasic.co.uk/forum/showthread.php?t=8876

I hope this is on the correct track.

newbie
- 23rd February 2010, 15:05
this is so unfortunate..my vdip2 is suddenly not working...

the status LEDs do not light when i turn the circuit on.. it also does not respond when i insert flash drives...

i tried connecting it to the pc's serial port to see if the LEDs are just busted, but nothing happend. its as if there's nothing connected to the serial port.

i've measured the voltage supplied and i saw that the voltage was correct.

did anyone experience this? can there still be a remedy for this module?

mackrackit
- 23rd February 2010, 16:52
On the VDIP1 there is an active low reset pin. Can not remember the exact pin but I think it is 22. Double check for the VDIP2 and give that a try.

newbie
- 23rd February 2010, 17:16
ive been connecting that pin(rs#) to the ground using a push button. still nothing happend...no lights from the LEDs.

Archangel
- 24th February 2010, 03:09
ive been connecting that pin(rs#) to the ground using a push button. still nothing happend...no lights from the LEDs.
And it gets to high state by . . . a Pullup ? WPU ? Fear ? Which is to ask, can it get there ? Or is it locked to reset in perpetuity ?

newbie
- 24th February 2010, 16:01
And it gets to high state by . . . a Pullup ? WPU ? Fear ? Which is to ask, can it get there ? Or is it locked to reset in perpetuity ?
are you suggesting to try pullup instead of pull down? done that...didn't work..

Archangel
- 25th February 2010, 07:13
are you suggesting to try pullup instead of pull down? done that...didn't work..
If I understood you correctly, and I am not sure I did, your push button switches ground the ports. If that is true, then yes, a pull up resistor, either internal (wpu) or external would seem to be in order. If your push buttons make the ports go high, then a pull down resistor would be required.

mackrackit
- 25th February 2010, 08:02
The VDIP2 might be different but on the VDIP1 the reset pin is left floating when not in use. Seems strange yes but....

Sounds like a bad conection or the magic smoke got out.

newbie
- 27th February 2010, 15:59
i tried what joe said and used a pull up resistor,. still nothing happend.. that made me hopeless about my module and began thinking that mackrackit was right..may be magic smoke did got out. so i ordered another vdip2 module and its on its way here..

for the mean time, i'm in the middle of programming the push buttons for browsing the files. how do i program the buttons to execute the command only after releasing the button from being pressed. the reason i want it that way is because if i execute the command(e.g. scrolling the lcd with the file names) while the button is being pressed,some files names would be skipped due to very quick execution.

mackrackit
- 27th February 2010, 21:50
If the button pin is pulled LOW in an idle state ,active HIGH. You could use WHILE/WEND.


WHILE
BUTTON = 1
DO SOMETHING
WEND

newbie
- 1st March 2010, 17:21
sir, in my program which is similar to the code back in post #63,
the LCD prints:

Ver 03.66-123VDFCF On-Line:

then clears the display and then finally displays the filename that i wanted to display. I saved the characters sent by the vdip2 into an array right after the "DIR" command so the "Ver 03.66-123VDFCF On-Line:" should not be included in those characters because they were sent at the time the vdip2 turned on and long before the "DIR" command was made..but how come they are still being displayed?

how do i effectively display only the characters that are the response to the current command and not display the characters that were sent by the vdip2 long before the command was made?

mackrackit
- 1st March 2010, 17:32
That is interesting. Please post your current code so we are sure to be talking about the same thing.

Just a thought...
You might try more than one array and or clear the the array at given points. It should over write it but...

Need to see the code...

Dave

newbie
- 2nd March 2010, 18:20
INCLUDE "modedefs.bas"

DEFINE LCD_DREG PORTC
DEFINE LCD_DBIT 0
DEFINE LCD_RSREG PORTD
DEFINE LCD_RSBIT 2
DEFINE LCD_EREG PORTD
DEFINE LCD_EBIT 1
DEFINE LCD_RWREG PORTD
DEFINE LCD_RWBIT 0
DEFINE LCD_BITS 8
DEFINE LCD_LINES 4
Define LCD_CHARS 20
DEFINE LCD_COMMANDUS 2000
DEFINE LCD_DATAUS 50

VinTXD VAR PORTD.4 'AD0
VinRXD VAR PORTD.3 'AD1
FlowIn VAR PORTD.5 'AD2

Pause 500

FILE1 VAR BYTE[12]
FILE2 VAR BYTE[12]
FILE3 VAR BYTE[12]

X1 VAR BYTE
X2 VAR BYTE
X3 VAR BYTE
X4 VAR BYTE
X5 VAR BYTE
X6 VAR BYTE
X7 VAR BYTE
X8 VAR BYTE
X9 VAR BYTE
X10 VAR BYTE
X11 VAR BYTE
X12 VAR BYTE
X13 VAR BYTE
X14 VAR BYTE
X15 VAR BYTE
X16 VAR BYTE
X17 VAR BYTE
X18 VAR BYTE
X19 VAR BYTE
X20 VAR BYTE
X21 VAR BYTE
X22 VAR BYTE
X23 VAR BYTE
X24 VAR BYTE
X25 VAR BYTE
X26 VAR BYTE
X27 VAR BYTE
X28 VAR BYTE
X29 VAR BYTE
X30 VAR BYTE
X31 VAR BYTE
X32 VAR BYTE
X33 VAR BYTE
X34 VAR BYTE
X35 VAR BYTE
X36 VAR BYTE

CRET VAR BYTE
CRET = $0D
StartDisk:

HIGH VinRXD
PAUSEUS 1000
SEROUT2 VinRXD,8588,["ECS",13]
LCDOUT $FE,1, "1"
HIGH VinRXD
PAUSEUS 1000
SEROUT2 VinRXD,8588,["IPA",13]
LCDOUT $FE,1, "2"
HIGH VinRXD
PAUSEUS 1000
SEROUT2 VinRXD,8588,["A:",13]
LCDOUT $FE,1, "3"
HIGH VinRXD
PAUSEUS 100
SEROUT2 VinRXD,8588,["DIR",13]
LCDOUT $FE,1, "4"
PAUSEUS 1000
WAIT1
IF FLOWIN = 1 THEN WAIT1
SERIN2 VinTXD,8588,[WAIT(CRET),STR FILE1\12 \CRET,WAIT(CRET),STR FILE2\12 \CRET,WAIT(CRET),STR FILE3\12 \CRET]
LCDOUT $FE,1, "5"

X1 = FILE1[0]
X2 = FILE1[1]
X3 = FILE1[2]
X4 = FILE1[3]
X5 = FILE1[4]
X6 = FILE1[5]
X7 = FILE1[6]
X8 = FILE1[7]
X9 = FILE1[8]
X10 = FILE1[9]
X11 = FILE1[10]
X12 = FILE1[11]
X13 = FILE1[0]
X14 = FILE1[1]
X15 = FILE1[2]
X16 = FILE1[3]
X17 = FILE1[4]
X18 = FILE1[5]
X19 = FILE1[6]
X20 = FILE1[7]
X21 = FILE1[8]
X22 = FILE1[9]
X23 = FILE1[10]
X24 = FILE1[11]
X25 = FILE1[0]
X26 = FILE1[1]
X27 = FILE1[2]
X28 = FILE1[3]
X29 = FILE1[4]
X30 = FILE1[5]
X31 = FILE1[6]
X32 = FILE1[7]
X33 = FILE1[8]
X34 = FILE1[9]
X35 = FILE1[10]
X36 = FILE1[11]


PAUSE 100
LCDOUT $FE,1,X1,X2,X3,X4,X5,X6,X7,X8,x9,x10,x11,x12
LCDOUT $FE,$C0,X13,X14,X15,X16,X17,X18,X19,X20,X21,X22,X2 3,X24
LCDOUT $FE,$94,X25,X26,X27,X28,X29,X30,X31,X32,X33,X34,X3 5,X36


PAUSE 2000
goto StartDisk

Here is the code..i haven't been able to add other functions yet because im still addressing to the problem that i stated earlier..

oh and one more question, is it really necessary to save the the array values into another byte like for this instance the x's? cant i directly use these array values to be printed to the LCD?

mackrackit
- 2nd March 2010, 22:17
I do not see why the firmware info is being sent to the display...

What does this do?


SEROUT2 VinRXD,8588,["A:",13]


This is not the answer but it might be worth a try since it looks like you are now able to change the firmware. Un-check "Show Prompt" and "Show Version...".
http://www.picbasic.co.uk/forum/attachment.php?attachmentid=4052&stc=1&d=1267567854


oh and one more question, is it really necessary to save the the array values into another byte like for this instance the x's? cant i directly use these array values to be printed to the LCD?
The one array will do, I just thought it would be easier to parse the first array into the second for the info you want. But if you can get good data into the first array then the second is not needed at all.

There is also a "skip" function in the SERIN2 command that might help.

newbie
- 3rd March 2010, 01:17
thanks! that gave me more options to address to that problem..


What does this do?
Code:

SEROUT2 VinRXD,8588,["A:",13]



what this does is select drive A: of the vdip2. i used this because the vdip2 swiches to the drive where a flash drive is last inserted so just to make sure in case a drive is last inserted to drive B:, the vdip2 would still go back to port A:. I'm doing this because i want to set drive A: as the source drive and B: as the target drive.

arunkumar
- 3rd March 2010, 09:16
i am doing in vinculum ic project..i want to copy the files as well as view the pen drive content on LCD display.. i bought VDIP2 modules.. we inserted rom files 3.66...if it possible reply sir....we are using pic to interface with VDIP2....

reply as soon as possible.....

mackrackit
- 3rd March 2010, 11:38
what this does is select drive A: of the vdip2. i used this because the vdip2 swiches to the drive where a flash drive is last inserted so just to make sure in case a drive is last inserted to drive B:, the vdip2 would still go back to port A:. I'm doing this because i want to set drive A: as the source drive and B: as the target drive.
OK, that is why I did not know, it is for the VDIP2.

You code loops back to "StartDisk:". Does the firmware version show up all of the time of just on the first time trhough?

newbie
- 4th March 2010, 00:28
the firmware only show up at the start of the program. and doesn't show up anymore unless you reset the vdip2. what do you think about this?

mackrackit
- 4th March 2010, 03:33
what do you think about this?
I think I am glad I gave up on the VDIP1! :)

My only guess is the VDIP buffer is not clearing till a DIR is sent.
Maybe at startup have a dummy routine that does everything but display to clear it up?

newbie
- 4th March 2010, 17:32
I guess unchecking the show prompt and show version would do the trick :)
thank you very much.

fokus_1116
- 8th March 2010, 19:54
HELO..

i am using pic18f4550,VDIP2 and 2line LCD ,20MHz, 9600 BAUD RATE and connect hyperterminal to monitor the result of the VDIP

but the hyperterminal only show Ver 03.66VDFC On-line...

anyone can help? my code is almost same with newbie

INCLUDE "modedefs.bas"

DEFINE OSC 20
DEFINE LCD_DREG PORTA
DEFINE LCD_DBIT 0
DEFINE LCD_RSREG PORTD
DEFINE LCD_RSBIT 5
DEFINE LCD_EREG PORTD
DEFINE LCD_EBIT 4
DEFINE LCD_RWREG PORTD
DEFINE LCD_RWBIT 6
DEFINE LCD_BITS 4
DEFINE LCD_LINES 2
DEFINE LCD_COMMANDUS 2000
DEFINE LCD_DATAUS 50

TXD VAR PORTC.7 'AD0 TXD VDIP2 connect RX
RXD VAR PORTC.6 'AD1 RXD VDIP2 connect TX
Flow VAR PORTC.0 'AD2 RTS

Start:
HIGH RXD
PAUSEUS 10
SEROUT2 RXD,8276,["ECS",13]
HIGH RXD
PAUSEUS 10
SEROUT2 RXD,8276,["IPA",13]
HIGH RXD
PAUSEUS 10
SEROUT2 RXD,8276,["A:",13] 'choose source disk
HIGH RXD
PAUSEUS 100
SEROUT2 RXD,8276,["DIR",13]
GOTO Start

mackrackit
- 8th March 2010, 20:03
Looks like you need to check your baud rates.
Those are not 9600

fokus_1116
- 8th March 2010, 20:08
u means the mode no of"8276" not 9600 baudrate? or the VDIP2 firmware not 9600 baudrate?

mackrackit
- 8th March 2010, 20:24
No, I mean what you had was not 9600


Start:
SEROUT2 VinRXD,84,["ECS",13] '9600 TRUE
HIGH VinRXD
PAUSEUS 10
SEROUT2 VinRXD,84,["IPA",13]
HIGH VinRXD
PAUSEUS 100
SEROUT2 VinRXD,8588,["DIR",13]
GOTO Start


And I have no idea what your firmware on the VDIP is.

fokus_1116
- 8th March 2010, 20:25
i ready the the firmware...no prob...
did u means change the mode no to 84?

fokus_1116
- 8th March 2010, 20:33
me already change to 84 but...also the same no respond for the hyperterminal...

mackrackit
- 8th March 2010, 20:47
Sorry, been a long day.
Either 84 or 16468 depending on if the PIC is connected to the VDIP with an inverter chip or not.

fokus_1116
- 8th March 2010, 20:50
the pic didt connect any inverter chip...the pic TX pin connect to the RXD pin of VDIP2 and RX pin connect to the TXD pin of the VDIP2

mackrackit
- 8th March 2010, 20:54
How is the VDIP connected to hyper-terminal?

fokus_1116
- 8th March 2010, 20:57
using rs232..like the diagram you post before

mackrackit
- 8th March 2010, 21:04
Can you make a schematic or exactly describe how everything is connected?
It might help with the guessing game:)

fokus_1116
- 8th March 2010, 21:11
thx for your help..

pic18f4550pin VDIP2pin RS232 pin

RC.7 RX AD0 TXD PIN11
RC.6 TX AD1 RXD
RC.0 I/O AD2 RTS
AD3 CONNECT TO GND


GOT ANY IDEA WHERE GOES WRONG?

mackrackit
- 8th March 2010, 21:26
Another thing I forgot to ask that could be a concern.

What are you using for an OSC at the PIC and how are the configuation bits set?
Can you connect the PIC directly to Hyper-Terminal and receive text correctly ? If so then you know the PIC is running at the expected speed.

Try inverted mode with out a 232 chip and then try true mode with a 232 chip.
Doing these test should help find the problem.

fokus_1116
- 8th March 2010, 21:39
i am using 20Mhz
and may i know how to set the config bit for picbasic pro because
'__config _XT_OSC & _WDT_OFF & _PWRTE _ON & _CP_OFF'
content error when build it.

how i try connect the tx pin of the pic to hyper terminal
thank for your suggest..

fokus_1116
- 8th March 2010, 21:47
is that just connect the TX pin of the pic to the max232 pin11 ? because i cant get the output from hyperterminal..

fokus_1116
- 9th March 2010, 02:20
my configuration bits is set as the picture.. but still cant make the pic it display thing on the hyperterminal...still got any suggestion?

mackrackit
- 9th March 2010, 05:10
The first thing we need to do is make sure the PIC is running at the speed you think it is, or know what speed it is running at.

These USB chips can be confusing ( for me anyways ) when it comes to setting the PLL and all. Bruce has a good explanation here that I refer to.
http://www.picbasic.co.uk/forum/showpost.php?p=19785&postcount=4
So if you set the configs as he has them the PIC should be running at 48MHz.
DEFINE OSC 48

To check the speed write a code that will blink an LED at one second on and one second off.

Then refer to the PBP manual under SEROUT2. There it shows how to connect the chip to a PC. Send some text to a terminal.

When this is all working we can "talk" to the VDIP.

fokus_1116
- 9th March 2010, 07:01
for me also confuse for that part...so i change the pic 18f4550 to pic16f873A..this will more easy (i think)...now i try make it working on hyperterminal ....

fokus_1116
- 10th March 2010, 13:26
i still cannot display on the hyperterminal...still got any solution?

mackrackit
- 10th March 2010, 13:32
Darn...

Check the pick with a one second blink to see if it is running at the expected speed?

Using a 232 type chip between PIC and PC?

Post the exact code and configs you are testing with.

Maybe we will see some thing.

fokus_1116
- 10th March 2010, 13:47
i testing with the code i post b4..i got connect to 232 using max232..i already test the mode with 84,8276

INCLUDE "modedefs.bas"

DEFINE OSC 20
DEFINE LCD_DREG PORTA
DEFINE LCD_DBIT 0
DEFINE LCD_RSREG PORTB
DEFINE LCD_RSBIT 5
DEFINE LCD_EREG PORTB
DEFINE LCD_EBIT 4
DEFINE LCD_RWREG PORTB
DEFINE LCD_RWBIT 6
DEFINE LCD_BITS 4
DEFINE LCD_LINES 2
DEFINE LCD_COMMANDUS 2000
DEFINE LCD_DATAUS 50

TXD VAR PORTC.7 'AD0 TXD VDIP2 connect RX
RXD VAR PORTC.6 'AD1 RXD VDIP2 connect TX
Flow VAR PORTC.0 'AD2 RTS

Start:
HIGH RXD
PAUSEUS 10
SEROUT2 RXD,84,["ECS",13]
HIGH RXD
PAUSEUS 10
SEROUT2 RXD,84,["IPA",13]
HIGH RXD
PAUSEUS 10
SEROUT2 RXD,84,["A:",13] 'choose source disk
HIGH RXD
PAUSEUS 100
SEROUT2 RXD,84,["DIR",13]
GOTO Start

mackrackit
- 10th March 2010, 13:58
I would like to see you test a simple "hello world" to the PC without the VDIP involved.
At this point we do not know where the problem is. Need to narrow it down.

fokus_1116
- 10th March 2010, 16:03
i did not connect to the VDIP..just connect with max232...
HIGH RXD
SEROUT2 RXD,84,["ECS",13]

and i change to
HIGH RXD
SEROUT2 RXD,84,["hello",13]

fokus_1116
- 10th March 2010, 18:53
DEFINE OSC 20
TXD VAR PORTC.7 'AD0 TXD VDIP2 connect RX
RXD VAR PORTC.6 'AD1 RXD VDIP2 connect TX
FlowIn VAR PORTC.0 'AD2 RTS

StartDisk:
RXD=1
SEROUT2 VinRXD,84,["hello"]
pauseus 1000
GOTO StartDisk


now i testing with this code...and i wan to ask is after i set the configuration bit..the hex code will become 24kb...and the pic16f873A program memory only 4k is this got problem?

mackrackit
- 10th March 2010, 19:54
There is no way that little bit of code would make a hex that large.

The data sheet says the program memory is 7.2K Bytes.

I really have no idea what you are doing or looking at.

Can you make a LED blink with this chip?

fokus_1116
- 11th March 2010, 01:59
i know so a little bit cant have so large hex code....

before i set the configuration bit.. the hex code size is small..after i export it..it become large...

mackrackit
- 11th March 2010, 10:23
Looking at your code you have the TX and RX mixed up and here
SEROUT2 VinRXD,84,["hello"]
VinRXD does not exist.

Try this code without the VDIP. Connect as shown in the comments.


@ __config _HS_OSC & _WDT_OFF & _LVP_OFF & _CP_OFF
DEFINE OSC 20
TXD VAR PORTC.6 'CONNECT TO MAX232 PIN #11
'MAX232 PIN#14 TO DB9 #2
RXD VAR PORTC.7

StartDisk:
SEROUT2 TXD,84,["hello",$d,$a]
pauseus 1000
GOTO StartDisk

fokus_1116
- 12th March 2010, 18:52
when i add in this line

@ __config _HS_OSC & _WDT_OFF & _LVP_OFF & _CP_OFF

and compile .. get error

Error[118] C:\USERS\DESKTOP\PIC16F873A\PIC TO HYT\ABC.ASM 157 : Overwriting previous address contents (2007)
Error[118] C:\USERS\DESKTOP\PIC16F873A\PIC TO HYT\ABC.ASM 157 : Overwriting previous address contents (2007)

mackrackit
- 12th March 2010, 19:34
Ok. You must be setting the configuration bits in the *inc file.
Commnt that line and use those settings.

Fir more of what I am talking about
http://www.picbasic.co.uk/forum/showthread.php?t=543

fokus_1116
- 13th March 2010, 04:04
follow the code u given already success print hello to hyperterminal...

is that means if i modified the code n connect to VDIP2 module..

mackrackit
- 13th March 2010, 04:26
Yes, we are going now!!!

Connect the VDIP to the PC with the MAX232 chip like you had when you saw the firmware message.

Connect the VDIP's input to the same wire you now have connected to the PC from the PIC.

What we will do is send commands to the VDIP from the PIC and have the VDIP send the response to the PC...
We do need to add another connection for flow control. The "FLOWIN" signal from the VDIP will tell the PIC it is OK to send another command. I am using the VDIP1 so check the VDIP2 pin out. I think they are the same...
Try to connect FLOWIN on a non ADC pin for now. Change the code below to your pin.
The below should cause the VDIP to diplay on the terminal a
D:\>
every 1.5 seconds..


VinRXD VAR PORTC.6 'DATA TO VDIP PIN #8 ON VDIP1
FLOWIN VAR PORTD.6 'FLOW CONTROL FROM VDIP PIN #9 ON VDIP1

START:
HIGH PORTD.2 'LED
PAUSE 250
LOW PORTD.2
PAUSE 250
SEROUT2 VinRXD,84,["ECS",13] '9600 TRUE
HIGH VinRXD
PAUSEUS 10
SEROUT2 VinRXD,84,["IPA",13]
HIGH VinRXD
PAUSEUS 10
WAIT111:
IF FLOWIN = 1 THEN WAIT111
PAUSE 1000
GOTO START

fokus_1116
- 13th March 2010, 04:39
thx..
i wan to ask..this
"HIGH PORTD.2 'LED
PAUSE 250
LOW PORTD.2
PAUSE 250"

line is for ?

and why need put this "HIGH VinRXD"line?

because i test on without the HIGH VinRXD it also can send to the VDIP2 and display to the hyperterminal..
if that this HIGH VinRX necessary?

mackrackit
- 13th March 2010, 04:44
because i test on without the HIGH VinRXD it also can send to the VDIP2 and display to the hyperterminal..
if that this HIGH VinRX necessary?
So you got it working???

The LED is something I like to do to see it the PIC is running. A heart beat. . . .

The HIGH VinRXD is just a little insurance to put the pin in the correct state before transmitting data. Yes, it is not always needed.

fokus_1116
- 13th March 2010, 04:50
ya thankyou very much...i get it work and succes send comment to the VDIP2.now working on the 2 line LCD..because it cant display the file name correctly...

mackrackit
- 13th March 2010, 04:56
ya thankyou very much...i get it work and succes send comment to the VDIP2.now working on the 2 line LCD..because it cant display the file name correctly...

COOL :) Glad to have helped.

For the LCD problem maybe it is the same as newbie was having?

fokus_1116
- 13th March 2010, 05:00
ya almost the same...

mackrackit
- 13th March 2010, 05:03
If you can not figure it out from what we did with newbie let us know and we will try to figure it out.

Good luck!

fokus_1116
- 13th March 2010, 05:05
i think another prob is ..i using 4bit....i will try using 8bit to test it..

fokus_1116
- 14th March 2010, 18:52
i follow the way newbie show to the LCD...but i only can show 1 or 2 file name only..then keep on repeat the second file name..

mackrackit
- 14th March 2010, 19:38
Hey, at least you are getting something :)

I do not think newbie ever showed us his last code so I am not sure what you are using. Sounds like a loop problem but to be sure post your current code so we can have a look at it.

fokus_1116
- 15th March 2010, 04:53
INCLUDE "modedefs.bas"
@ __config _HS_OSC & _WDT_OFF & _LVP_OFF & _CP_OFF
DEFINE OSC 20
DEFINE SER2_BITS 8
DEFINE LCD_DREG PORTA 'LCD Data line
DEFINE LCD_DBIT 0
DEFINE LCD_RSREG PORTB 'RS bit
DEFINE LCD_RSBIT 5
DEFINE LCD_EREG PORTB 'E bit
DEFINE LCD_EBIT 4
DEFINE LCD_RWREG PORTB 'RW bit
DEFINE LCD_RWBIT 6
DEFINE LCD_BITS 4
DEFINE LCD_LINES 2
DEFINE LCD_CHARS 20
DEFINE LCD_COMMANDUS 2000
DEFINE LCD_DATAUS 50


VinTXD VAR PORTC.7 'AD0 TXD VDIP2 connect RX
VinRXD VAR PORTC.6 'AD1 RXD VDIP2 connect TX
FlowIn VAR PORTC.0 'AD2 RTS
T VAR PORTC.0 'push button
D VAR PORTC.1 ' PUSH BUTTON FOR DISPLAY


FILE1 VAR BYTE[12]
FILE2 VAR BYTE[12]
FILE3 VAR BYTE[12]

X1 VAR BYTE
X2 VAR BYTE
X3 VAR BYTE
X4 VAR BYTE
X5 VAR BYTE
X6 VAR BYTE
X7 VAR BYTE
X8 VAR BYTE
X9 VAR BYTE
X10 VAR BYTE
X11 VAR BYTE
X12 VAR BYTE
X13 VAR BYTE
X14 VAR BYTE
X15 VAR BYTE
X16 VAR BYTE
X17 VAR BYTE
X18 VAR BYTE
X19 VAR BYTE
X20 VAR BYTE
X21 VAR BYTE
X22 VAR BYTE
X23 VAR BYTE
X24 VAR BYTE
X25 VAR BYTE
X26 VAR BYTE
X27 VAR BYTE
X28 VAR BYTE
X29 VAR BYTE
X30 VAR BYTE
X31 VAR BYTE
X32 VAR BYTE
X33 VAR BYTE
X34 VAR BYTE
X35 VAR BYTE
X36 VAR BYTE

CRET VAR BYTE
CRET = $0D

StartDisk:
pause 3000
HIGH VinRXD

SEROUT2 VinRXD,84,["ECS",13]
LCDOUT $FE,1, "1"
pause 2500
PAUSEUS 1000
HIGH VinRXD
PAUSEUS 3000
SEROUT2 VinRXD,84,["IPA",13]
LCDOUT $FE,1, "2"
pause 2500
HIGH VinRXD
PAUSEUS 1000
SEROUT2 VinRXD,84,["A:",13]
LCDOUT $FE,1, "3"
pause 2500
HIGH VinRXD
PAUSEUS 1000
SEROUT2 VinRXD,84,["DIR",13]
LCDOUT $FE,1, "4"
'pause 2500
PAUSEUS 1000
WAIT1
IF FLOWIN = 1 THEN WAIT1
SERIN2 VinTXD,84,[WAIT(CRET),STR FILE1\12 \CRET,WAIT(CRET),STR FILE2\12 \CRET,WAIT(CRET),STR FILE3\12 \CRET]
LCDOUT $FE,1, "5"
'pause 2500

X1 = FILE1[0]
X2 = FILE1[1]
X3 = FILE1[2]
X4 = FILE1[3]
X5 = FILE1[4]
X6 = FILE1[5]
X7 = FILE1[6]
X8 = FILE1[7]
X9 = FILE1[8]
X10 = FILE1[9]
X11 = FILE1[10]
X12 = FILE1[11]
X13 = FILE1[0]
X14 = FILE1[1]
X15 = FILE1[2]
X16 = FILE1[3]
X17 = FILE1[4]
X18 = FILE1[5]
X19 = FILE1[6]
X20 = FILE1[7]
X21 = FILE1[8]
X22 = FILE1[9]
X23 = FILE1[10]
X24 = FILE1[11]



PAUSE 100
LCDOUT $FE,1,X1,X2,X3,X4,X5,X6,X7,X8,x9,x10,x11,x12


"actually i not really understand for this line "SERIN2 VinTXD,84,[WAIT(CRET),STR FILE1\12 \CRET,WAIT(CRET),STR FILE2\12 \CRET,WAIT(CRET),STR FILE3\12 \CRET]" "

the code of this can display only 1 file name...but if i add another line LCDOUT the LCD display 2 same file name...

fokus_1116
- 15th March 2010, 06:41
dear mackrackit,
i already figure out..how to make it display..but the array part need got some prob.. it that got other way to make the file store at X

X1 = FILE1[0]
X2 = FILE1[1]
X3 = FILE1[2]
X4 = FILE1[3]
X5 = FILE1[4]
X6 = FILE1[5]
X7 = FILE1[6]
X8 = FILE1[7]
X9 = FILE1[8]
X10 = FILE1[9]
X11 = FILE1[10]
X12 = FILE1[11]
X13 = FILE2[0]
X14 = FILE2[1]
X15 = FILE2[2]
X16 = FILE2[3]
X17 = FILE2[4]
X18 = FILE2[5]
X19 = FILE2[6]
X20 = FILE2[7]
X21 = FILE2[8]
X22 = FILE2[9]
X23 = FILE2[10]
X24 = FILE2[11]

mackrackit
- 15th March 2010, 09:37
"actually i not really understand for this line "SERIN2 VinTXD,84,[WAIT(CRET),STR FILE1\12 \CRET,WAIT(CRET),STR FILE2\12 \CRET,WAIT(CRET),STR FILE3\12 \CRET]" "

This line WAITS for a carriage return (CRET) then will take the next 12 character and place then in the array FILE1 or FILE2 and so on.




other way to make the file store at X

The X~ array is just a dummy array to give a place to play with things, parse if needed. It is not really needed.

fokus_1116
- 16th March 2010, 09:26
mackrackit,

can i use 2D array in picbasic pro compile or the pic16f873A can support the 2D array?

mackrackit
- 16th March 2010, 10:55
This should answer your question
http://www.picbasic.co.uk/forum/showthread.php?t=12870

fokus_1116
- 21st March 2010, 12:39
dear sir..

i plan to use 2d array to store the file name and then display it to the LCD..

but cant make it success ... is that any suggestion to make it the array work?

mackrackit
- 21st March 2010, 12:52
The best I can do is tell you to start a new thread about the 2D array problem. I have not tried them myself.

Be sure to post your code when you start the new thread...

fokus_1116
- 21st March 2010, 13:20
i already tired to try the 2d array but it still cannot work....

is that any way to store the file name except using the 2d array?

mackrackit
- 21st March 2010, 15:40
If you do not want to post your code and ask about why it does not work I guess there is not much anyone can do to help. You have not even explained exactly what you are trying to do.

It seems like you now have the VDIP running. So if you want help with arrays or something else start a new thread as suggested.

fokus_1116
- 22nd March 2010, 05:25
so sorry,
i got post my coding..but dunno y cant display...

now the coding not at me..later i will post again for the coding...thank for your inform

fokus_1116
- 22nd March 2010, 15:24
dear sir,

y when i put the line @Put2D(X,Y) then cannot compile got error

Error[108] C:\USERS\PIC16F873A\ARRAY TEST 2\ARRAY2.ASM 311 : Illegal character (()

fokus_1116
- 25th March 2010, 19:03
dear mackrackit
below is my code..it like stuck at some where please help..
INCLUDE "modedefs.bas"

@ __config _HS_OSC & _WDT_OFF & _LVP_OFF & _CP_OFF
;----------------------------------------------------------------
DEFINE OSC 20
DEFINE LCD_DREG PORTA 'LCD Data line
DEFINE LCD_DBIT 0
DEFINE LCD_RSREG PORTB 'RS bit
DEFINE LCD_RSBIT 5
DEFINE LCD_EREG PORTB 'E bit
DEFINE LCD_EBIT 4
DEFINE LCD_RWREG PORTB 'RW bit
DEFINE LCD_RWBIT 6
DEFINE LCD_BITS 4
DEFINE LCD_LINES 2
DEFINE LCD_CHARS 20
DEFINE LCD_COMMANDUS 2000
DEFINE LCD_DATAUS 50
;---------------------------------------------------------------
VinTXD VAR PORTC.7 'AD0 TXD VDIP2 connect RX
VinRXD VAR PORTC.6 'AD1 RXD VDIP2 connect TX
FlowIn VAR PORTC.0 'AD2 RTS
T VAR PORTC.0 'push button
D VAR PORTC.1 ' PUSH BUTTON FOR DISPLAY
;----------------------------------------------------------------
X VAR BYTE SYSTEM
Y VAR BYTE SYSTEM
;----------------------------------------------------------------
;----------------------------------------------------------------
; -- Working with 2D arrays ---

Width CON 8 ; Number of bytes in a Row
Length CON 10 ; Number of Rows in the array
;---------------------------------------------------------------------------
ArraySize CON Width * Length ; Total size of the array
MyArray VAR BYTE[ArraySize] ; The Array

Idx VAR BYTE ; Index, points to 1D array locations
Xidx VAR BYTE ; 2D column Index
Yidx VAR BYTE ; 2D row Index
ArrayData VAR BYTE ; holding register for array data

;----[Get a value from the 2D array]----------------------------------------
Get2D:
Idx=(Yidx*Width+Xidx) MIN (ArraySize-1) ; find Index, limit to ArraySize
ArrayData = MyArray(Idx) ; retrieve value from the array
RETURN

;----[Put a value in the 2D array]------------------------------------------
Put2D:
Idx=(Yidx*Width+Xidx) MIN (ArraySize-1) ; find Index, limit to ArraySize
MyArray(Idx) = ArrayData ; store the value in the array
RETURN

;----[Set entire array to 0's]----------------------------------------------
Clear2D:
FOR Idx = 0 TO ArraySize-1
MyArray(Idx) = 0
NEXT Idx
RETURN

;----[Turn the Subroutines into Functions]----------------------------------
ASM
#Get2D macro X, Y
MOVE?BB X, _Xidx ; copy users X value to Xidx
MOVE?BB Y, _Yidx ; copy users Y value to Yidx
L?CALL _Get2D ; call the Get subroutine
endm ; value is returned in ArrayData
#define Get2D(X, Y) #Get2D X, Y ; allows paretheses in macro
;-----------------------
#Put2D macro X, Y ; value should be in ArrayData
MOVE?BB X, _Xidx ; copy users X value to Xidx
MOVE?BB Y, _Yidx ; copy users Y value to Yidx
L?CALL _Put2D ; call the Put subroutine
endm
#define Put2D(X, Y) #Put2D X, Y ; allows paretheses in macro
;-----------------------
#Clear2D macro
L?CALL _Clear2D ; call the Clear subroutine
endm
#define Clear2D() #Clear2D
ENDASM

;----------------------------------------------------------------
;a var BYTE[12]

FILE1 VAR BYTE[12]
FILE2 VAR BYTE[12]
FILE3 VAR BYTE[12]
;X VAR BYTE


CRET VAR BYTE
CRET = $0D
;----------------------------------------------------------------
StartDisk:
pause 3000
HIGH VinRXD

SEROUT2 VinRXD,84,["ECS",13]
LCDOUT $FE,1, "1"
PAUSEUS 1000
HIGH VinRXD
PAUSEUS 1000
SEROUT2 VinRXD,84,["IPA",13]
LCDOUT $FE,1, "2"

HIGH VinRXD
PAUSEUS 1000
SEROUT2 VinRXD,84,["A:",13]
LCDOUT $FE,1, "3"

HIGH VinRXD
PAUSEUS 1000
SEROUT2 VinRXD,84,["DIR",13]
LCDOUT $FE,1, "4"

PAUSEUS 1000
;------------------------------------------------------------
WAIT1
IF FLOWIN = 1 THEN WAIT1
SERIN2 VinTXD,84,[WAIT(CRET),STR FILE1\12 \CRET]
LCDOUT $FE,1, "5"
@ Clear2D ; clear the array
FOR Y = 0 TO Length-1 ; fill the array with data
FOR X = 0 TO Width-1
ArrayData =FILE1[X] ; value to put in array
@ Put2D(X,Y)
NEXT X
NEXT Y

;--------------------------------------------------------------------------------
PAUSE 1000
FOR Y = 0 TO Length-1
FOR X = 0 TO Width-1
@ Get2D(X,Y)
NEXT X
LCDOUT $FE,1,ArrayData
pause 500
NEXT Y
goto StartDisk

mackrackit
- 25th March 2010, 19:11
So you got the new version of PBP?

Where did you get it?

fokus_1116
- 26th March 2010, 02:33
u use the 2.46version...
the code i use it like stuck only can run until the code below then stop
INCLUDE "modedefs.bas"

@ __config _HS_OSC & _WDT_OFF & _LVP_OFF & _CP_OFF
;----------------------------------------------------------------
DEFINE OSC 20
DEFINE LCD_DREG PORTA 'LCD Data line
DEFINE LCD_DBIT 0
DEFINE LCD_RSREG PORTB 'RS bit
DEFINE LCD_RSBIT 5
DEFINE LCD_EREG PORTB 'E bit
DEFINE LCD_EBIT 4
DEFINE LCD_RWREG PORTB 'RW bit
DEFINE LCD_RWBIT 6
DEFINE LCD_BITS 4
DEFINE LCD_LINES 2
DEFINE LCD_CHARS 20
DEFINE LCD_COMMANDUS 2000
DEFINE LCD_DATAUS 50
;---------------------------------------------------------------
VinTXD VAR PORTC.7 'AD0 TXD VDIP2 connect RX
VinRXD VAR PORTC.6 'AD1 RXD VDIP2 connect TX
FlowIn VAR PORTC.0 'AD2 RTS
T VAR PORTC.0 'push button
D VAR PORTC.1 ' PUSH BUTTON FOR DISPLAY
;----------------------------------------------------------------
X VAR BYTE SYSTEM
Y VAR BYTE SYSTEM
;----------------------------------------------------------------
;----------------------------------------------------------------
; -- Working with 2D arrays ---

Width CON 8 ; Number of bytes in a Row
Length CON 10 ; Number of Rows in the array
;---------------------------------------------------------------------------
ArraySize CON Width * Length ; Total size of the array
MyArray VAR BYTE[ArraySize] ; The Array

Idx VAR BYTE ; Index, points to 1D array locations
Xidx VAR BYTE ; 2D column Index
Yidx VAR BYTE ; 2D row Index
ArrayData VAR BYTE ; holding register for array data

;----[Get a value from the 2D array]----------------------------------------
Get2D:
Idx=(Yidx*Width+Xidx) MIN (ArraySize-1) ; find Index, limit to ArraySize
ArrayData = MyArray(Idx) ; retrieve value from the array
RETURN

;----[Put a value in the 2D array]------------------------------------------
Put2D:
Idx=(Yidx*Width+Xidx) MIN (ArraySize-1) ; find Index, limit to ArraySize
MyArray(Idx) = ArrayData ; store the value in the array
RETURN

;----[Set entire array to 0's]----------------------------------------------
Clear2D:
FOR Idx = 0 TO ArraySize-1
MyArray(Idx) = 0
NEXT Idx
RETURN

mackrackit
- 26th March 2010, 02:48
Sorry, I have not used arrays like that.
You may want to go here
http://www.picbasic.co.uk/forum/showthread.php?t=12870

fokus_1116
- 26th March 2010, 04:07
what array you using? can show it?

mackrackit
- 26th March 2010, 04:20
I have shown it several times starting in post#8 of this thread.

fokus_1116
- 26th March 2010, 04:26
using this way of array...if i got 10 file..then need to copy the X1X2 until X120? this way of array i have try it..it simple and easy...if i dunno the pendrive have how many file?

newbie
- 28th March 2010, 09:31
you can try storing storing all the file names that your PIC's array is capable of storing then when your cursor goes down to the last file name, do another serin but this time use the waitstr function and wait for the last file name in your list. you will then receive an new batch or list of file names. You can do this again and again if there are too many file names in your flash drive. As for going up to view the previous files names., you can save the last file name every batch and when you want to get to a specific batch, do a serin and wait for the last file name of the batch before that particular batch where you want to get to. i would advice that you lessen the file names per batch because based on my experience, the pic hangs when for example you are set to receive 8 files but receives only 7 or less. This is just my idea. its not yet complete though.. there are so many other ways to address to the problem of getting all the file names from a flash drive printed in you lcd.

mackrackit
- 28th March 2010, 10:55
Hi newbie,
Looks like a good solution.

fokus_1116
- 28th March 2010, 18:11
the SERIN2 can put like this?

WAIT1
IF FLOWIN = 1 THEN WAIT1
@ Clear2D ; clear the array
FOR Y = 0 TO Length-1
SERIN2 VinTXD,84,[WAIT(CRET),STR FILE1\12 \CRET]
FOR X = 0 TO Width-1
ArrayData =FILE1[X]
@ Put2D(X,Y)
NEXT X
NEXT Y

mackrackit
- 28th March 2010, 18:24
That should work for the SERIN2.
But you will probably want to get rid of the 2D stuff.

newbie
- 29th March 2010, 09:36
hi mackrackit, it been a while..

about the 2D arrays, i agree. you should get rid of those..its just making things complicated..all you need to do is simply save the file names in arrays of 12 characters like this:
SERIN2 VinTXD,84,[SKIP 20, WAIT(CRET),STR FILE1\12 \CRET,WAIT(CRET), STR FILE2\12 \CRET,WAIT(CRET),STR FILE3\12 \CRET,WAIT(CRET),STR FILE4\12 \CRET]

skip 20 is to avoid saving unnecessary prompts such as "device detected" or something like that.

cret is where i saved $0D (carriage return). files are separated by carriage returns in between them so what i did was wait for its occurrence for me to be able to know when it is the end of a file and the start of another so that i can save it to another array.

if you want to view a new batch of files, do something like this:
SERIN2 VinTXD,84,[WAITSTR FILE4\12, WAIT(CRET), STR FILE1\12 \CRET,WAIT(CRET), STR FILE2\12 \CRET,WAIT(CRET),STR FILE3\12 \CRET,WAIT(CRET),STR FILE4\12 \CRET,WAIT(CRET)]

you will then receive a new set of file names saved in FILE1 to FILE4.

fokus_1116
- 3rd April 2010, 07:39
hi,
may i ask..if i wan to use battery to replace the power supply, what battery to recommend?

mackrackit
- 3rd April 2010, 13:18
hi,
may i ask..if i wan to use battery to replace the power supply, what battery to recommend?
That is a difficult one to answer.
The VDIP requires 5 volts. Four re-chargeable "AA" batteries will give ~4.8 volts, close enough but for how long. Then if someone were to use regular batteries now there is ~6 volts present, not good, the MCU will "smoke".

Could use a 7805 regulator with a ~9 volt or higher battery pack but then you need to carry around a "brick" of batteries. And the 7805 requires a heat sink and is not the most efficient thing out there, reliable yes... LM317 could also be used but has some of the same problems.

You may want to use a switching regulator. Could have one that works with a battery input from 3 to 6 volts, then four "AA" batteries of any type will work. Depending on the circuit the efficiency can be very good.

Not knowing the load of the finished project, you may not know yet either, the best I caqn do is point you here
http://www.national.com/analog
Look at the "WEBENCH DESIGNER". Input your parameters and see what come up.

I have also hear some talk about off the shelf DC to DC converters.

Byte_Butcher
- 3rd April 2010, 15:38
That is a difficult one to answer.
The VDIP requires 5 volts. Four re-chargeable "AA" batteries will give ~4.8 volts, close enough but for how long.

Be cautious with your battery types here... 4 NiCad AA's will give about 4.8v, but 4 rechargeable ALKALINE AA's can give over 5.6V +

For linear regulators, these aren't too bad...
http://ww1.microchip.com/downloads/en/DeviceDoc/21991c.pdf
Only a couple hundred mV dropout voltage, so they work OK on 5 v circuits from a 6v battery.



You may want to use a switching regulator. Could have one that works with a battery input from 3 to 6 volts, then four "AA" batteries of any type will work. Depending on the circuit the efficiency can be very good.

If you need to run off a wide supply range, including sucking batteries down "to the last drop" then a good switching supply is THE way to go....


steve

Dave
- 3rd April 2010, 21:25
Byte_Butcher, Where do you find rechargable ALKALINE AA's ? I have never heard of such a thing.... I'm curious...

Dave Purola,
N8NTA

Byte_Butcher
- 3rd April 2010, 22:20
Byte_Butcher, Where do you find rechargable ALKALINE AA's ? I have never heard of such a thing.... I'm curious...


/Cough/ err... well, they do exist, and a quick google search should find you some. But I was MISTAKEN about the ones that I have. I was sure it said Alkaline on the package when I got them, but on closer inspection, these say NiMH on the side of the battery.

So I guess I meant to say that" 4 rechargeable NiMH AA's can give over 5.6V +" Sorry...

steve

mackrackit
- 3rd April 2010, 22:52
What is the brand of the NiMH and AH of the batteries you use?
The NiMH I use are 1.2 volts at 2500 AH.

mackrackit
- 4th April 2010, 00:44
OPPSS!
That should be 2500 mAh

Byte_Butcher
- 4th April 2010, 00:54
Duracell, 2650mAh.

They're rated at 1.2V, but terminal voltage on a freshly charged one exceeds 1.4V


steve

Keanlee411
- 14th May 2010, 04:09
soh it means only 1 firmware can be loaded for every VNCL IC
for my project that IC to transfer a files and i will put an LCD how can i acmmunicate that it is not easy to put a program on PIC rigth? any way
how can i use the PIC microcontroller and VNCL IC?
how they can communicate?
for VNCL firmware i know it has a free defined commands like in VDFC firmware
how can i control that commands if I use PIC microcontroller?
for example i use PIC18F458 how can i configure the output pins of the pic?
since the VNCL can accept the FIFO, UART or SPI. what is the examples codes for the pic like if i use picbasic commands? can i write the codes to manipulate the commands of VNCL but how can i control it to the pins of PIC microcontoller?

Jacques
- 21st May 2010, 19:19
Can Anyone verify when you spark up a vdip module with 5v in fifo mode, attach an flash the led 2 will go on after the alternating led 1 and 2.

In my case this only happens for the uart mode which programming through hyper terminal/putty is fairy simple.

I require it in fifo mode though...

Thx

mackrackit
- 22nd May 2010, 06:46
I have not tried FIFO and it looks like a waste of MCU pins to me.
Can I ask why you need to use that mode?

I also looked through the docs I have and did not see anything that would answer your question about the status LEDs.

Jacques
- 24th May 2010, 10:18
Hi mackrackit,

I am actually using it with an fpga, but after a chat with the support guys in the US they said don't even bother with fifo on this chip its to flaky, rather stick to uart. FIFO will be upgraded in the 2nd gen ic VN2. So in the mean time i wrote a uart for the fpga and it seems to work.

Well I could not have done it witout the help of this forum.

Kind Regards

amuthuhd
- 28th June 2011, 03:58
hi
can any one post circuit diagram to connect VDIP to PIC ??

newbie
- 3rd July 2011, 13:38
5731
read the comments in this thread. and download pdf files from http://www.ftdichip.com/index.html to gain more knowledge about the vdip...goodluck.

newbie
- 3rd July 2011, 14:03
sorry about that., this is a better picture

newbie
- 3rd July 2011, 14:19
5734
..........

amuthuhd
- 4th July 2011, 19:24
thank you very much newbie :)

marky07
- 25th October 2011, 02:30
Newbie, what is the easiest mode in interfacing the VDIP1 Module and PIC microcontroller,,, UART or SPI?

I have seen in this site(http://www.pic_examples.byethost3.com/VDIP.html) that he used SPI mode in interfacing the PIC and VDIP2 module...
But, I'm planning to buy VDIP1 because it is more cheaper than VDIP2 module.
Do you have any circuit diagram just like in that site using UART mode in interfacing the PIC and the VDIP1 module not the PIC and VDIP2 module???

mackrackit
- 27th October 2011, 01:23
I think the easiest way to get started with this device is to follow this
http://www.picbasic.co.uk/forum/showthread.php?t=7700

(http://www.picbasic.co.uk/forum/showthread.php?t=7700)