LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

PIC 18F4550 LABVIEW VISA USB ROW communication

   In the following project the 4550 microcontroller is connected via the USB bus to a PC. At the same time with the use of the SPI bus is communicating with the other Digital Signal Processor a dsPIC30F6010A.

On the dsPIC30F6010A an 10bit AD converter in utilized with the analogue input pin set at AN2 (RB2) and the sampling frequency defined by the timer1 interrupt period, witch in it’s term is defined by the instruction period Tcy=4*Tosc, the timer preload register (TMR1) and the TCKPS<1:0> Timer Input Clock Prescale Select bits.

       For the USB driver is used the USB VISA row scheme from LabView. The user interface is build also in LabView. The user first sent two bytes 0000 through USB Endpoint 1 OUT to PIC18F4550, then PIC18F4550 requests the 704 bytes from dsPIC30F6010A witch in it's turn is sent back the data if it's RAM is full and ready. PIC18F4550 receives and stores the data to the Endpoint 1 IN buffer. Then through USB Endpoint 1 IN pipe transmits the data to the user interface (11 packets of 64bytes each).

As next steep I am searching the possibility for an automatic initiation of the request/sent data sequence from LABVIEW application, without hence the need of the user interaction.

You can download the required firmware from here http://users.dod.sch.gr/nichrist/18f4550_dspic30.htm

Regards Nick

0 Kudos
Message 1 of 4
(9,042 Views)

Hey Nick,

 

I just want to confirm my understanding of your application. Are you having your microcontroller relay the dsp device data to your PC buffer? What hardware is involved in sending the dsp data to the microcontroller? Can you explain a little more in detail what you are trying to accomplish? What is the automatic initiation of the data sequence request?

 

Thank you,

Ryan

National Instruments
Applications Engineer
0 Kudos
Message 2 of 4
(8,972 Views)

Hi Ryan I am just using 4550 as a USB bridge. The hardware interconnection between 4550 and 6010a dsp is accomplished through the SPI port as follows:

 PIC18F4550 dsPIC30F6010A

SCK (RB1) SCK1 (RF6) pin 45

SDI (RB0) SDO1 (RF8) pin 43

SDO (RC7) SDI (RF7) pin 44

In a few words the firmware do this: • User interface writes the two bytes to be transferred via USB EndPoint1 Out. • 4550 receives the two bytes at memory address 0x0490 & 0x0491. The first byte is used to enter a select case contained at ProcessOutToken routine and the second byte is transmitted through SPI bus to 6010A, hence an SPI transaction is now initiated. • 6010A responds with an SPI interrupt and use the transmitted value (the second one of the two bytes entered by user) to enter a select case contained on the SPI interrupt handler. If 6010A needs to continue the SPI communication with 4550, must write to SPI1BUF a byte to be transferred to 4550 (For more details you can read my code) The goal is to transfer to PC (LABview application) 352 samples taken with the 6010A ADC (10bit each hence 704bytes) The goal is to find an alternative method to initiate (from LABVIEW user interface application) the transfer sequence (6010A adc data SPI4550USBUSER interface) instead of the user to have to press a button. Maybe with a timer this is possible?

0 Kudos
Message 3 of 4
(8,962 Views)

nick7,

 

From what I can tell, you are currently using a Push Button boolean to start this process.  If you want to switch to a timer, I suggest the Elapsed Time Express VI.  This VI will output a boolean value after a specified number of seconds and could be wired to the same terminal that the Push Button currently is.

 

Regards,

Ben

National Instruments
Certified LabVIEW Associate Developer
Certified TestStand Developer
Message 4 of 4
(8,931 Views)