07-03-2023, 06:44 PM
I thought it was time to start a new thread as the previous one was about exploring the possibility of using the iCE40HX1K in a converter. This thread is about the converter.
I will call it "Hedghog L" as it uses a Lattice FPGA.
I done up a circuit for the complete converter and got a PCB made for it.
I have kept the rotary encoders and LCD display. Among other things keeping them will allow the modulators to be fully utilised.
I am using a PIC16F18856 microcontroller. There appears to be a decent amount of them in stock. One feature it has is a reference clock output module. The module has a selectable clock source. Which in this case will be a crystal controlled oscillator. It has a programmable clock divider and selectable duty cycle. This module will be used to provide the clock for the modulators. On all previous Hedghogs that clock was provided by the FPGA.
The microcontroller operates from 5V but it has to communicate with both 5V and 3.3V devices. I will be using open drain outputs on the microcontroller with pull up resistors to +V of the devices.
The inputs of the microcontroller can be configured as TTL. When configured as TTL any voltage of 2V or over is considered as logic 1.
The combination of open drain output and TTL input will allow bidirectional communication between the microcontroller and any of the devices.
One thing that I ran short of was pins on the microcontroller. The modulator chips MBS373 came to the rescue. Each modulator has one pin which is a logical output port that is controlled via I2C.
The port of each modulator is used to control one of the two analogue switches.
I have just done some basic tests on the microcontroller . I thought that I may be able to alter the microcontroller program from the PSC to suit. But after looking at it I think it will probably be easier to start from scratch.
I had hoped that this PCB would be a final one but that is not the case. There is a problem with it.
After populating it with components and powering up I discovered that there was a short on one of the 5V rails. It was eventually traced to the track being connected to ground at one point close to a via.
I cut the short away with a scalpel and every thing else worked fine. The PCB was designed on DesignSpark PCB. I checked the PCB again on DesignSpark using the design rule checker and no fault showed up.
But looking at the area on DesignSpark a short could be seen between the 5V track and the ground plane. At some stage I moved the via to make room for some tracks. Instead of the track that was connect to the via been shortened it doubled back on itself creating a tail. This in itself isn't a problem other than not being neat. One of the last things I do is a copper pour for the ground plane. It fills any part of the board that hasn't tracks with copper and connects it to ground where possible. It should keep an equal distance away from all tracks that aren't connected to ground. The copper pour should have avoided that tail but for some reason it didn't recognise it as a track. I guess for the same reason it didn't show up on the design rule check. I have been using DesignSpark for years and have used the same method many many times without incident. I guess sometimes %@!? happens. Could have been worse at least it was easily corrected. The area can be seen on the photo of the top of the PCB. It is the via just above where "LCD CONTRAST" is printed.
Frank
I will call it "Hedghog L" as it uses a Lattice FPGA.
I done up a circuit for the complete converter and got a PCB made for it.
I have kept the rotary encoders and LCD display. Among other things keeping them will allow the modulators to be fully utilised.
I am using a PIC16F18856 microcontroller. There appears to be a decent amount of them in stock. One feature it has is a reference clock output module. The module has a selectable clock source. Which in this case will be a crystal controlled oscillator. It has a programmable clock divider and selectable duty cycle. This module will be used to provide the clock for the modulators. On all previous Hedghogs that clock was provided by the FPGA.
The microcontroller operates from 5V but it has to communicate with both 5V and 3.3V devices. I will be using open drain outputs on the microcontroller with pull up resistors to +V of the devices.
The inputs of the microcontroller can be configured as TTL. When configured as TTL any voltage of 2V or over is considered as logic 1.
The combination of open drain output and TTL input will allow bidirectional communication between the microcontroller and any of the devices.
One thing that I ran short of was pins on the microcontroller. The modulator chips MBS373 came to the rescue. Each modulator has one pin which is a logical output port that is controlled via I2C.
The port of each modulator is used to control one of the two analogue switches.
I have just done some basic tests on the microcontroller . I thought that I may be able to alter the microcontroller program from the PSC to suit. But after looking at it I think it will probably be easier to start from scratch.
I had hoped that this PCB would be a final one but that is not the case. There is a problem with it.
After populating it with components and powering up I discovered that there was a short on one of the 5V rails. It was eventually traced to the track being connected to ground at one point close to a via.
I cut the short away with a scalpel and every thing else worked fine. The PCB was designed on DesignSpark PCB. I checked the PCB again on DesignSpark using the design rule checker and no fault showed up.
But looking at the area on DesignSpark a short could be seen between the 5V track and the ground plane. At some stage I moved the via to make room for some tracks. Instead of the track that was connect to the via been shortened it doubled back on itself creating a tail. This in itself isn't a problem other than not being neat. One of the last things I do is a copper pour for the ground plane. It fills any part of the board that hasn't tracks with copper and connects it to ground where possible. It should keep an equal distance away from all tracks that aren't connected to ground. The copper pour should have avoided that tail but for some reason it didn't recognise it as a track. I guess for the same reason it didn't show up on the design rule check. I have been using DesignSpark for years and have used the same method many many times without incident. I guess sometimes %@!? happens. Could have been worse at least it was easily corrected. The area can be seen on the photo of the top of the PCB. It is the via just above where "LCD CONTRAST" is printed.
Frank