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.
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.
Dave
Always wear safety glasses while programming.
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?
Last edited by newbie; - 27th January 2010 at 15:16. Reason: additional info
Re-read this.
http://www.picbasic.co.uk/forum/showthread.php?t=7700
Post your current code and a schematic.
Dave
Always wear safety glasses while programming.
here is my code. its almost the same as the one that i posted earlier..Code: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
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
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.
And a screen shot of the VDIP running at 4800 rebooted to the same USB stick.
I will try to get more time later this weekend to play some more.
Dave
Always wear safety glasses while programming.
does the serial communicator automatically change the firmware at the start of the connection? no need to enter any commands?
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/show...3888#post83888
Dave
Always wear safety glasses while programming.
Bookmarks