View previous topic :: View next topic |
Author |
Message |
gomond
Joined: 05 Nov 2008 Posts: 18
|
Vinculum vdip1 on second serial port of 18f8722 giving grief |
Posted: Sat Sep 12, 2009 3:53 am |
|
|
Hi I am using the CCS supplied Vinculum drivers that come with the USB Master dev kit.
And they work great if I hook everything up to use the first serial port for STREAM=USB and assign the CTS RTS lines etc.
But I want to use the VDIP1 module on one of Fred Eady's Frame Thrower II boards and UART 1 is already wired for console I/O, so I want to use the second uart for the VDIP1.
I have made the following alterations to USBMaster.h and would assume that swapping the STREAMS and Baudrates all would be well but it isn't.
I have verified the VDIP module also on a PC comm port and flashed it to the latest firmware. So I can discount the module.
Code: |
#ifdef EDTP_TT_2_8722
// Serial Library defined for User stream - Used with SIOW
#use rs232(baud=9600, UART2, stream=USB, ERRORS)
// Serial Library defined for USB stream - 18F67J10 to VNC1L chip
#use rs232(baud=19200, UART1, stream=USER, ERRORS)
// Generic pin layout
#define USB_RTS PIN_D2
#define USB_CTS PIN_D3
#define USB_RESET PIN_E0
#define USB_PROG PIN_F2
#endif
|
Thanks
Greg Omond |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Sun Sep 13, 2009 3:56 pm |
|
|
Quote: |
I would assume that swapping the STREAMS and Baudrates all would be well but it isn't.
|
Post your compiler version. |
|
|
gomond
Joined: 05 Nov 2008 Posts: 18
|
|
Posted: Tue Sep 15, 2009 2:44 am |
|
|
Hi the compiler version is PCWHD v 4.096
Thanks. |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Tue Sep 15, 2009 2:02 pm |
|
|
I installed vs. 4.096 and compiled the test program shown below.
The ASM code in the .LST file looks OK for the UART2 stream (USB).
It's talking to all the correct registers. The constants loaded into the
registers look correct.
Code: |
#include <18F8722.h>
#fuses XT,NOWDT,PUT,BROWNOUT,NOLVP
#use delay(clock=4000000)
#use rs232(baud=19200, UART1, stream=USER, ERRORS)
#use rs232(baud=9600, UART2, stream=USB, ERRORS)
//===========================================
void main()
{
char c;
c = fgetc(USER);
fputc(c, USER);
c = fgetc(USB);
fputc(c, USB);
while(1);
} |
|
|
|
Guest
|
|
Posted: Thu Sep 17, 2009 3:19 pm |
|
|
Thanks .....
All fixed it was an issue with the sp233/max233 level translator.
They appear extremely fragile I have found that the receive side of the chip is very intolerant and blows easily.
this was causing me to believe that the software was not working.
because the fault occurred on three separate boards.
I have since McGyver'd a "futurlec" translator board to it and the problem is solved.
###########################
A good tradesman never blames his tools?
########################### |
|
|
|