|
Hi,
I am new to at91sam9263, and I have a problem about using TWI to transmit. The problem is that it cannot transmit the data, but the Start,DADR,MREAD,ACK, and STOP signal was already viewable using logic analyzer.
Here are some of my observations: 1.) Sending or not sending START and STOP bit doesn't affect the output of the signal. 2.) Writing data to THR make the board transmit the signal from START up to STOP bit, but NO DATA on it. 3.) Continuously writing to THR, will just transmit a series of signal (same on 2. ) but still NO DATA is viewable. 4.) Internal address, when used, is also not visible in the signal.
Here is the code that I used for writing to the TWI registers:
static void __iomem *twi_base; #define at91_twi_read(reg) __raw_readl(twi_base + (reg)) #define at91_twi_write(reg, val) __raw_writel((val), twi_base + (reg))
where: twi_base = ioremap(AT91SAM9263_BASE_TWI ,0x40);
I am sure that this code is successful in writing the other registers. Please help...
Leone
P.S. I can provide the file and maybe some screenshots next.
|