I’ve been working with my Atmel FAE on the SAM4S-EK2 eval board. I’m trying to get a TWI master working and can’t seem to get it going. The board is pretty much the same as the SAM4S-EK, for which you have a demo application, except the CPU’s RAM and flash are different… other than that the registers and peripherals are identical.
The FAE mentioned to me that the ASF implementation of FreeRTOS TWI, SPI, USART, and PDC (DMA) peripherals were actually personally written by you (developed for Atmel).
I’ve run the example code in the comments of the freertos_twi_master.h file but don’t see any traffic on the bus. I’ve got an oscilloscope attached to the lines for TWI1 (PB4 and PB5) and see no signals. The same pins are shared by the JTAG on the peripheral mux and I do see JTAG traffic when using JTAG, so I’m certain they’re the right pins.
Also, the status code returned from freertos_twi_read_packet() is always “timed out”. We are using synchronous mode.
I have also done:
so the pins are certainly in the right mode.
I don’t see a working example of TWI master anywhere. Can you please point me in the right direction/do you have any idea of what might be going on?
Also, what are the distinct advantages of the FreeRTOS TWI layer? Is it just the mutexes so it can be used by multiple tasks easily or is there some other advantage/purpose apart from running the regular TWI driver in a task?