10-21-2011 01:41 AM
Dear all,
I am new to GPIB. Can anyone give example source code for data transfer from taker to listener for the controller TNT4882?
10-23-2011
11:39 PM
- last edited on
04-11-2025
03:04 PM
by
Content Cleaner
Hi Bharath,
Thank you for contacting National Instruments.
You can find examples to get started with TNT4882 at the following links-
http://zone.ni.com/devzone/cda/epd/p/id/3272
http://zone.ni.com/devzone/cda/epd/p/id/253
Also you can find additonal material regarding NI TNT4882 at-
https://www.ni.com/en-us/shop/model/tnt4882.html
I hope this is helpful.
Have a great day.
01-17-2012 09:05 AM
I am using theESP software on a PIC Microcontroller, and I am not able to program the Count Registers. I can send to each register individually, and read back the data correctly (i.e. write to R-cnt0, read from Rcnt0 looped 0-255, then repeat for Rcnt1, Rcnt2, Rcnt3 and that works). However, whenever I try to program Rcnt0,Rcnt1,Rcnt2,Rcnt3 in that order, I always read back the value sent to Rcnt3 in all 4 registers??? This is being used in the code to control the count of databytes sent/received in 2's complement.
This is my test code below:
while (1)
{
TNT_Out(R_cnt0, 0xAA);
TNT_Out(R_cnt1, 0x55);
Delay10KTCYx(200);//Delay 20K cycles
TNT_Out(R_cnt2, 0xF0);
TNT_Out(R_cnt3, 0xFF);
LATD = 0x00;
Delay10KTCYx(200);//Delay 20K cycles
Delay10KTCYx(200);//Delay 20K cycles
Delay10KTCYx(200);//Delay 20K cycles
Delay10KTCYx(200);//Delay 20K cycles
Delay10KTCYx(200);//Delay 20K cycles
Delay10KTCYx(200);//Delay 20K cycles
TNT_In(R_cnt0);
LATD = Data_Bus; Reads 0xFF here
Delay10KTCYx(200);//Delay 20K cycles
Delay10KTCYx(200);//Delay 20K cycles
TNT_In(R_cnt1);
LATD = Data_Bus;Reads 0xFF here
Delay10KTCYx(200);//Delay 20K cycles
Delay10KTCYx(200);//Delay 20K cycles
TNT_In(R_cnt2);
LATD = Data_Bus;Reads 0xFF here
Delay10KTCYx(200);//Delay 20K cycles
Delay10KTCYx(200);//Delay 20K cycles
TNT_In(R_cnt3);
LATD = Data_Bus;Reads 0xFF here
Delay10KTCYx(200);//Delay 20K cycles
Delay10KTCYx(200);//Delay 20K cycles
}
If I reverse Rcnt0 and Rcnt3:
while (1)
{
TNT_Out(R_cnt0, 0xFF);
TNT_Out(R_cnt1, 0x55);
Delay10KTCYx(200);//Delay 20K cycles
TNT_Out(R_cnt2, 0xF0);
TNT_Out(R_cnt3, 0xAA);
LATD = 0x00;
Delay10KTCYx(200);//Delay 20K cycles
Delay10KTCYx(200);//Delay 20K cycles
Delay10KTCYx(200);//Delay 20K cycles
Delay10KTCYx(200);//Delay 20K cycles
Delay10KTCYx(200);//Delay 20K cycles
Delay10KTCYx(200);//Delay 20K cycles
TNT_In(R_cnt0);
LATD = Data_Bus; Reads 0xAA here
Delay10KTCYx(200);//Delay 20K cycles
Delay10KTCYx(200);//Delay 20K cycles
TNT_In(R_cnt1);
LATD = Data_Bus;Reads 0xAA here
Delay10KTCYx(200);//Delay 20K cycles
Delay10KTCYx(200);//Delay 20K cycles
TNT_In(R_cnt2);
LATD = Data_Bus;Reads 0xAA here
Delay10KTCYx(200);//Delay 20K cycles
Delay10KTCYx(200);//Delay 20K cycles
TNT_In(R_cnt3);
LATD = Data_Bus;Reads 0xAA here
Delay10KTCYx(200);//Delay 20K cycles
Delay10KTCYx(200);//Delay 20K cycles
}
01-17-2012 09:10 PM
Thank you very much..:)