Posts

Showing posts from October, 2014

Interfacing a color TFT display with the PIC32MX250F128B

Image
I have been working on interfacing the PIC32MX250F128B with a small 2.2" TFT display from Adafruit. It's a nice little display that is fairly easy to communicate with, using SPI communication. The display I'm using is: http://www.adafruit.com/product/1480 Adafruit provides nice open-source libraries for their products. However, they are for Arduino and thus cannot be directly reused for the PIC32. I went through the library and ported it over for the PIC32, in C. I have attached my project file as a .zip file and you can download it to go through the library header and source files, as well as the demo code. I've tried heavily commenting the code so that it is self-explanatory. As far as hardware goes, with the demo code, the pin connections for the display are: BL (backlight): I left it unconnected, but you can connect it to 3.3V for backlight. SCK: connected to RB14 on the PIC MISO: left unconnected, since I'm not reading anything from the screen MOSI: connected

PIC32 DMA+SPI+DAC : Analog output synthesis with zero CPU overhead

Image
I have previously shown how to use the PIC32 SPI module to use the 12-bit DAC MCP4822: http://tahmidmc.blogspot.com/2014/10/pic32-spi-using-mcp4822-12-bit-serial.html . While that does allow you to generate analog outputs as desired, it requires you to use CPU cycles to process the timer interrupt and accordingly drive the SPI module. Since the PIC32 contains DMA channels, the process can be completely offloaded from the CPU. For an idea of the PIC32 DMA module, refer to my previously written article: http://tahmidmc.blogspot.com/2014/05/simple-pic32-dma-example.html Fig. 1 - The generated sine wave at fpwm = 400kHz and 32 elements in the sine table So, the simple way of offloading the SPI update to the DMA module would be to let the DMA channel transfer data to the SPI buffer. The SPI module is configured for 16-bit data transfer (since the MCP4822 write command requires 2 bytes). This means that the cell size for the DMA channel has been set to 2 (2 bytes to transfer once triggered).

PIC32 SPI: Using the MCP4822 12-bit serial dual DAC

Image
I recently got a few pieces of the MCP4822 DAC. You can check out the datasheet here: http://ww1.microchip.com/downloads/en/DeviceDoc/22249A.pdf I found them to be neat little devices. In a small 8-pin PDIP package, the MCP4822 comes with 2 12-bit DACs, which you can easily configure over SPI. This was a great opportunity to get a simple PIC32 SPI application going. I worked on this today to see how fast I can get the DAC output going. Here's the pinout of the MCP4822: Fig. 1 - MCP4822 pinout (taken from datasheet) The MCP4822 can be supplied a voltage in the range of 2.7V to 5.5V. Since I use 3.3V for my PIC32, I used the same 3.3V supply for the VDD for the MCP4822. Pin 5 is the active low signal LDAC that is used to synchronize the two DAC channels. When this pin is brought low, the data in the DAC's input register is copied to the output and both outputs are updated at the same time. I just had this tied to ground. VoutA and VoutB are the two output pins. The other pins are

Wireless Power Transmitter Circuit Diagram

Image
At present we can see people use wireless transmission now it has become a very famous electronic device  so today Free Circuit Diagrams 4U is going to give you a wireless power transmitter circuit diagram.This circuit can be operated with 5V power supply. You can use different coils with different Gage and test what gives the maximum power.Here we have used common transistor BD139. Note:        # Build this circuit on a PCB        # Don't supply over 5V

Simple Crystal radio

Image
This is a simple AM crystal radio.You can wind #22 enermale copper magnet wire on cardboard roll..Here we have used 1N34A Crystal diode.If you want to lessen well you can connect ear phone connection to the amplifier.You have to tap L2 and connect it with 20-80 feet antenna.and you have to ground the circuit use a mettle rod for that. Note:     # When you make this circuit be patient because you want be able to get the result at once