Skip to main content

Posts

Atxmega board

      In my projects, I used the Atxmega128A3U microcontroller by Atmel. To do so and easier, I built a board with all ports connected to the exterior with a flat cable and power included in the board as well as  a crystall to operate at different frequencies.     This board has helped me greatly, and I connect all projects through it. The next picture shows the different parts and how the connectors are attached. Each one can have different distributions and they are also shown.     To program and debug I usually use the AVR, Jtagice3 as a PDI interface (1Mhz), but I have used as well and without problem the AVRISP mkII and the AVR Dragon.     If you are interested in buying one of these at 10€ including connectors boards without soldering parts, you can contact me at my email    linkntronix@gmail.com  and I will send it to you.          Ports and its pins' connections:     Finally I show you the different parts of the connector,
Recent posts

Magnetic sensor

  Reading potentiometer position or angle with AS5600 board      In this blog I will expose the way to read an angle or position (in my case wind direction) trhough the board AS5600-SO_EK_AB, bought from Digikey  https://www.digikey.es/product-detail/es/ams/AS5600-SO-EK-AB/AS5600-SO-EK-AB-ND/5066879           This is a fully mounted board, not equally as the picture, and I bought separatelly a magnet with a button which fits very well on top of the chip. If you turn the button, the value changes giving it a position. Link and picture of the button:  https://www.digikey.es/products/es?keywords=RMH05-DK-XX-1.0     This button includes the proper imant attached to the bottom of it. The connection to the microcontroller is done by a resistor divider and an analogue input. This divider is necessery because the voltage of its ouput is higher than de analogue input module.      Pin B0 of the microcontroller must be connected to 3.3V and pin B1 is the output of the sensor to be read. The maxim

Reading temperature

 Temperature measurement using PmodTMP2     One of the tings I wanted to do is to measure and read temperature with precission. I know there are lots of sensors and quite cheap, for example LM35, but I wanted a sensor which does all conversion and you just read the value, without the analogue problem as it can introduce error.     I have chosen this because it is small, measures positive and negative temperatures, interfers it with I2C protocol, its precission is better than 0.25ºC and its resolution is 0.0625ºC. Consult the inner chip  ADT7420 .      Obviously the chip is difficult to solder but they sell it with a small board and you only have to connect it through its pins. I bough it in Digikey, address  https://www.digikey.es/products/es?keywords=pmodTMP2     The following diagram shows how to connect this board to the Atxmega128A3U.           The value of the resistors R1 and R2 are not critical and they define the signals according to the speed. You should see those signals as a

SPI connecting two microcontrollers

      One of the things I wanted is connect and send data from a Master microcontroller to a Slave one via protocol SPI.         To do so, I have programmed both microcontrollers with the programs named "spi_Master" and "spi_Slave" respectively.     The master initiates the communication and transfers seven data gathered in an array called Dbuff[]. Each one has a different hexadecimal number which is transmitted through MOSI pin under the clock signal SCLK.     The slave uses high level interrupt instead of waiting any data to be received; Once the SPIC_INT_vect is executed, the micro waits for the 0x53 as it indicates the beginning of the block. When this is received, the indexm variable is incremented saving all data into Dbuff[indexm] array.     The hexadecimal number 0x53 prevents to read data in the middle of the block, always beginning at the same point or value. Master program: spi_Master.c Slave program: spi_Slave.c