The blog of a dedicated radio amateur and electronics enthusiast

"Having fun on the air and in the workshop - communicating and creating"
Showing posts with label PIC. Show all posts
Showing posts with label PIC. Show all posts

20 January 2020

Upgrading my design tools for PIC projects

2020 has just begun, and here is my new year's  resolution, which I have already completed !
For my embedded control projects it was time to standardise on PIC microcontrollers, ( e.g., the PIC16F188** family ), belonging to a newer generation than some of those I had previously been using. PIC development in recent years has now led to devices typically having larger memory, supporting higher clock speeds, with more peripherals including core independent peripherals, and new features, such as peripheral pin select, device information area, configurable logic cell, integrated temperature sensors to name a few.

The new development platform for my embedded control projects
As result I have had to upgrade my hardware tools as well for compatibility; the most significant change being the MicroChip "Snap" programmer/debugger, to replace my obsolete ICD2, and a different prototyping board, which I could call MyDev3, ( see post dated 2 November 2010 ). The MCU featured in the image is a 40 pin 8-bit device, MicroChip PIC part PIC16F18875/P. ( Click on image to zoom ).
All is working fine. The PIC was a new unused blank device and successfully programed with my TEMPSENS-OLED firmware. ( See post dated 6 October 2019 ).
MCU = MicroController Unit, PIC = Programmable Integrated Circuit from MicroChip Inc.


  

27 August 2013

Analog Devices AD9850 frequency synthesiser

AD9850 evaluation board, 45mm x 26mm
Connected to MYDEV2 PIC MSSP module for programming
SINA and QP outputs
Another visit to an online auction site and another electronics purchase. This time I spent $9 on an evaluation board for the AD9850 frequency synthesiser chip. Surely the 125MHz 'can' oscillator and the chip itself are individually worth more than that. However it was made in China.
I mounted it on a larger piece of experimenter board and connected its programming inputs to a microcontroller PIC18F4550 on my MYDEV2 PIC development board. Before the AD9850 will produce an output signal it has to be programmed.
So I wrote a few lines of code to use the PIC's Master Synchronous Serial Peripheral ,( MSSP ), interface module to send the 40 bits of frequency, phase and control data to the AD9850.
The resultant output signals are a sine wave ( CH1 yellow trace ) of 1.04V peak-peak directly from the chip's digital-analogue convertor, ( DAC ), and a variable pulse-width square wave ( CH2 blue trace ) of 5V peak-peak via the chip's comparator for use as an external clock.
I have intentionally allowed plenty of space on the experimenter board to fit a dedicated PIC later; probably the PIC18F14K22 as I already have one.
The AD9850 will be a useful signal source and clock generator upto about 40MHz.

28 January 2012

Gradually moving forward

Having a lot of spare time recently has enabled me to progress with some unfinished PIC MCU related activities. For the first time I have been writing code in 'C' language and programming PIC MCUs using Microchip's MPLABX IDE and ICD3. So far I can write characters to a display, and also detect when any button on a particular row of a keypad has been pushed; all quite encouraging. But I still have much more programming to do in order to complete even the quite basic operation of keying-in and displaying numerical data.
I have also been experimenting with software, ( assembly language in this case ), to detect disconnecting the power source from a PIC microcontroller, ( PIC18LF4455 ). A variable low voltage power supply would be very useful here.
And finally, from a most unexpected source, I have obtained cut and engraved black plexi front and rear panels for the frequency synthesiser enclosure.

14 September 2011

MyDev2 enhanced

Schematic - note Vcc connection depends on usb-powered or self-powered application
I have upgraded to version 3 my PIC MCU development platform, MyDev2, ( first posted on November 2nd, 2010 ), with the addition of pull-down resistors R25-R28 for the keypad rows connections now that I have decided on the method I will use in coding the operation of the keypad and the interfacing required to the microcontroller. I have already started writing the code in 'C' programming language, instead of the 'Assembly' language which I have used for all my PIC projects until now. The keypad will be a 'telephone' style 4 row x 3 column, 0-9, # and * type.
I have also fitted a new microcontroller type, Microchip part PIC18LF4455-I/P, which, as well as being a few cents cheaper than the original PIC18F4550 and PIC18F4685, has an extended operating voltage range, ( denoted by the 'L' in the part number ), down to +2V, as I want to experiment with coding the detection of switching off the power !

12 July 2011

Then there were four

From time to time since the last post, ( 16 June ), I have been populating three more circuit boards; four are now complete. This is not quite the rate of 3 per week which should be achievable, single-handed; what an efficient production line that would be !
During this activity my soldering skills working with surface mount components, some minute, have quickly improved. Surprisingly, I didn't find the 44 pin microcontroller chip to be the most difficult to mount.
Now I will progress further with the case. I have already finished the technical drawings for the top, base, front and rear panels ready for their fabrication. And today a local firm precisely cut the extruded, anodised aluminium sides to the final length.

16 June 2011

Densely populated

A new batch of Analog Devices synthesiser chips has arrived, enabling me to finish populating one circuit board with components. I programmed the PIC MCU via the bootloader with my latest v2.00 code and, after powering up the board, all seems to be working fine.

20 January 2011

DDS #2 on test



Today I continued with the development of the second prototype frequency synthesiser. I have added the facility of changing the tuning step size in real time.
It is shown being tested on the work bench alongside "MyDev2", ( PIC18F4550 microcontroller ), and "ICD2", ( debugger and programmer ).
The output voltage at 137.7KHz is a 1.32v peak to peak pure sine wave across 300 Ohm. There is no output low-pass filter and I think this is the reason the output level is about twice that of prototype #1, which incorporates such a filter, probably introducing significant residual capacitive reactance.

30 December 2010

DDS deadline met


I have completed the first prototype of the dual-band frequency synthesiser, ( just before my self imposed deadline of the end of the decade ), by writing the last piece of the software to tune the output frequency up and down in 1Hz or 10Hz steps. This function works perfectly; whatever the actual output frequency, it precisely matches the frequency indicated on the display, as of course it should do. So 2010 will end on that happy note. But what about the future ?
This first prototype is what I would consider as a ' concept and technology demonstrator'. For the second prototype synthesiser I have decided to change to a more sophisticated PIC microcontroller, and one that has not been in production all that long, e.g., the Microchip PIC18F4550, which will allow me to implement more features. In fact I have already completed about 25% of this prototype , based on "MyDev2"; see posting on 2nd November.
Concerning software, until now I have been programming in Microchip's assembler language. Using 'C' language is probably a better choice in future. I have absolutely no prior experience of 'C'; but what I do know is that its command syntax is more descriptive than assembler, and the code is not type specific to any one manufacturer's microprocessor families. Some of the extended functionality I want for the second prototype is better suited to 'C' and would be extremely difficult to program in assembler for a novice programmer as myself. The PIC18F4550 can be programmed in both assembler and 'C'.
Back to the present, and the first prototype is shown in the upper picture placed on top of my longwave transmitter with which it will be used to gain some operational experience which may suggest improvements or further development. The middle picture is the post-filter rf output voltage displayed on an oscilloscope, showing a 656mV peak-peak pure sine wave. The lower picture is the output frequency of the synthesiser as I tune it from 137700Hz +/- 50Hz in 10Hz steps.

02 November 2010

MyDev2 replaces MyDev1

PIC18F4550 version
PIC18F4685 version
Schematic - note Vcc connection depends on usb-powered or self-powered application
Development boards for microcontrollers are essential for debugging code and checking hardware peripherals before committing to the final build-configuration.My first microcontroller development board, which I called "MyDev1", has served me quite well; see 25th January. It is a typical, solderless, experimenting board; component leads are a push-fit into the holes. Its limitations, however, began to become apparent; noisy, intermittent connections, lack of flexibility and a real nightmare if I had ever attempted to use it with 40 or even 28 pin microcontrollers and interfacing with several hardware peripherals at once. Having unreliable connections is a really bad situation when the microcontroller is waiting, or looking, for changes.It was therefore time to upgrade to a better system; so I have produced "MyDev2". Now it is much easier to reconfigure for different peripherals, e.g. display, keypad, rotary encoder, comms ports, and to check their operation. Of course, I haven't omitted the LEDs, and "MyDev2" has many, ( different colours for different ports ), as it is always nice to see pretty lights as a visual indication of I/O port output state ! I could not avoid solderless connections entirely; but those are of a high reliability using good quality pin-headers.
"MyDev2" connects to the Microchip ICD2, ( In-Circuit Debugger No.2 ), for programming and debugging operations, thereby replacing my original home-made programmer, ( see 25th Jan, 8:06PM, purple box ).
Using a development board I was easily able to change between two mechanical rotary shaft encoders, ( control with knob ), from different manufacturers, choose the more appropriate one for my final application, and 'fine-tune' the PIC code to suit.
Incidentally, the microcontrollers featured in the pictures above are 40 pin Microchip parts, ( lower ) type PIC18F4685-E/P, and ( upper ) type PIC18F4550-I/P which incorporates a USB interface.

25 January 2010

New design in progress


This is my current project which is still at the very early stages of development. I am hoping that eventually it will become a frequency synthesiser. For the first time I am using a programmable integrated circuit, PIC, which is basically a microprocessor using a reduced instruction set of around 40 commands. I am writing and testing the source code, burning the PIC, rewriting and retesting etc. Keep a look-out for future progress reports.