Posts

Showing posts with the label 32-bit

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...

PIC32MX250F128B ipl7: odd shadow register set behavior and observations

This issue has now been solved. Scroll to the bottom for the update. I started working on a pure sine wave inverter based on the PIC32MX250F128B. The first stage was to just get the SPWM working and test that before proceeding to add the power stage, feedback and other control, etc. This led me to some interesting observations regarding the PIC32MX250F128B interrupts, especially the use of the shadow register set and a related problem. I set up Timer 2 to be the time base for sine wave generation (DDS/SPWM) using OC1. In the Timer 2 interrupt, the duty cycle update request is performed (OC1RS is updated). Timer 2 interrupt priority was set to 7. This all worked fine. The initial ISR definition was: void __ISR(_TIMER_2_VECTOR, ipl7) T2int(void) { ..... } However, when I used the ADC (input from potentiometer for amplitude control - a start at implementing feedback), accessing any of the ADC registers in the while (1) loop in main stopped the PIC32 from working.  I then added ...

PIC32 Proto Board: Details, Schematic, PCB and Pictures

Image
I previously showed you my PIC32 proto board I made on verroboard ( http://electel.blogspot.com/2016/02/pic32-development-proto-board-on.html ). To make the proto board “more of a product” and easy to reproduce, I was working to make the proto board on a PCB. I used ExpressSCH to draw the schematic, and used ExpressPCB to design the PCB. Once designed, Professor Bruce Land got the PCB made from ExpressPCB themselves. The PCB is just to be a basic board with the PIC32MX250F128B placed on it. The power supply connections are provided as are external oscillator connections (if needed). Additionally, there is a nice convenient power supply input connector (standard 2.5mm jack/plug). All the IO pins along with power (Vin and +3.3V) and ground are placed on a SIL connector at the edge of the board so that the board can be conveniently placed on a breadboard for experimenting and prototyping (see pictures below). It's a nice little 2-layer PCB measuring only 3.1 inches by 1.8 inches. I c...

A Comparative Study between two 32-bit microcontrollers - the Atmel AT91SAM3X8E and the Microchip PIC32MX250F128B

As previously mentioned ( http://electel.blogspot.com/2016/09/200000-views-ithaca-arm-and-dmips.html ) I’m doing an independent study under the supervision of Professor Bruce Land here at Cornell University. A semester has passed and I will be continuing my independent study next semester. The independent study (that I'm doing and will be continuing) is on exploring and comparing the peripheral modules of the Microchip PIC32MX250F128B (on the Microstick II platform) and the Atmel AT91SAM3X8E (on the Arduino Due platform). This semester, I've done a good amount of introductory exploration of the two 32-bit microcontrollers. Here are the links to the datasheets of the two microcontrollers on which my independent study is based: AT91SAM3X8E: www.atmel.com/Images/doc11057.pdf PIC32MX250F128B: http://ww1.microchip.com/downloads/en/DeviceDoc/61168E.pdf The Microchip PIC32MX250F128B is a 32-bit RISC microcontroller based on the MIPS M4K core. In this independent study, I have used the...