USB low-full-high speed peripherals Forum Discussions
Hi,
i try to use serial port, i done this before, but it's not working in this application. Serial port interrupts doesn't launch. Here is piece of my code:
void uart0_transmit(void)
{ tx_ptr = 0;
rx_ptr = 0;
//Serial port 0 settings
UART230 |= UART230_0; // Enable high-speed baud rate generator for Serial port 0
PCON &= ~SMOD0; // Disable doubling of the baud rate for Serial port 0 (115,2K instead 230K)
SCON0 &= ~SM0_0; // Set mode 1 (01)
SCON0 |= SM0_1; // for Serial port 0
SCON0 |= REN; // Serial port 0 receive enable
SBUF0 = uart0_tx_buf[tx_ptr];
// IOA ^= LIGHT0;
}
void uart0_close(void)
{
//Serial port 0 settings
UART230 &= ~UART230_0; // Disable high-speed baud rate generator for Serial port 0
SCON0 &= ~REN; // Serial port 0 receive disable
// IOA |= LIGHT0;
}
void uart0rxtx(void) interrupt 4
{
IOA &= ~LIGHT0;
if (bit_is_set(SCON0, TI) && (tx_ptr < BYTES2TX0-1)) // Receiving-Transmitting interruption solver for uart0
{
tx_ptr += 1;
SBUF0 = uart0_tx_buf[tx_ptr]; // appending next byte to transmitt
}
SCON0 &= ~TI; // clears transmitting flag
if bit_is_set(SCON0, RI) { // Receiving flag SCON0_RI exists => cought the receiving event
uart0_rx_buf[rx_ptr] = SBUF0; // pulling received byte from uart0 buffer
rx_ptr += 1; // counting received byte
}
SCON0 &= ~RI; // clears receiption flag
}
void exchange_232_data(BYTE *buf_o, BYTE *buf_i)
{
int i, k;
unsigned long m;
for (i = 0; i < BYTES2TX0; i++) uart0_tx_buf = buf_i; // Assembling bytes to transmitt
uart0_transmit();
while (tx_ptr < BYTES2TX0 - 1) k = tx_ptr; // Waiting for the end of transmittion
m = 0;
while((rx_ptr < BYTES2RX0) & (m < WAIT_FOR_RECEIVE)) m+= 1; // Waiting for the end of receiving
if (m < WAIT_FOR_RECEIVE)
for (i = 0; i < BYTES2RX0; i++) buf_o = uart0_rx_buf; //Assembling bytes to transmitt
else
buf_o[0] = error_eb_com; // Returning the error message if receiption failed
uart0_close();
}
in main file interrupt enabled:
IE = 0x00; // Disable all interrupts
IE |= EA; // Global interrupt enable
IE |= ES0; // Enable Serial port 0 interrupt
May be i forgot something, or doing wrong?
Show Lesshi , when we talking about the fifo in the slave fifo or gpif fifo, is the fifo means the end point buffer ? that is ,if i use slave fifo , when the extern cpu writes one byte to the slave fifo , is it the cpu directly writes the byte into the end point buffer ,or the extern cpu just writes the byte into the fifo and then some logic in the ez-usb get the byte out of the fifo and then write it to the end point buffer ?
thanks!
Show LessHi,
I'm interested on using FX2 on a device connected to Android platform.
I saw http://www.cypress.com/?rID=57610 and tried to run the code on a board with FX2 (not the LP version) and it failed.
I saw the document referes to FX2LP and FX3. Can you verify it doesn't work on FX2 and explain why?
Cheers
Show LessCypress' West Bridge Devices no longer need an NDA to access the Software Development Kit. Start your designs now! More information can be found at http://www.cypress.com/?rID=64819.
Thanks,
Anup
Show LessHello,
In many cases SPI devices have interrupt signal which is used to notify SPI master that some action is needed. I see that CY7C65211 have interrupt endpoint exposed so I wonder if it is possible to get nottification from CY7C65211 that GPIO line is triggered instead of constant polling of this device.
Thanks,
Damjan
Show LessHi.
I trying to analysis AN61345 F/W and FPGA. But i have still question about state machine of TD_Poll().
The following code is TD_poll() and i think it does not make sense.
if ((done_frm_fpga) && (IOC & 0x02)) in order true, IOC must have 0x02 from FPGA.
But firstly FPGA need to reset, and reset need IOC|=0x01; //output 1 on PC.0...SYNC signal is HIGH
Does it make sense?
Please Let me know What am i supposed to handle of this problem?
void TD_Poll( void )
{ // Called repeatedly while the device is idle
// ...nothing to do... slave fifo's are in AUTO mode...
/* if((IOC & 0x02 ))
{;}
else
{
//IOA&=0xFD;
IOC|=0x01;
}*/
if(!(IOC & 0x02))
{
done_frm_fpga = 1;
}
if ((done_frm_fpga) && (IOC & 0x02))
{
IFCONFIG = 0x03;
SYNCDELAY;
IOC|=0x01; //output 1 on PC.0...SYNC signal is HIGH
SYNCDELAY;
done_frm_fpga = 0;
}
}
Show LessPlease, i need software for out of stock development board
CY3654
There was links on site:
Documentation
CYDB Reference Guide 10577KB Nov. 16, 2001
CYDB Users Guide 19169KB Nov. 16, 2001
CYASM Assember User's Guide 265KB Nov. 16, 2001
Software
CY Debugger for CY3654 V1.4.3 2170KB Nov. 16, 2001
CY3654 Code Examples 1360KB Nov. 16, 2001
CYASM Assembler Software V1.96 277KB Nov. 16, 2001
Evaluation Version of Bytecraft CCompiler 1848KB Nov. 16, 2001
But now links are missing.
Please, if anyone has it upload it.
Thanks!
Show Less