Update (Part 2)
Purpose: Multi-application project.
Application 1: Read remote NTC thermistor, output temperature over RS232 and USB. Temperature to be displayed on OLED. Ability to compensate for cable resistance in software. Powered via USB.
Application 2: Handheld device to read sensor battery status over RS232. The sensor islocated in extremely harsh environment, so utilises wireless charging in order to allow sealed enclosure to reduce the likelihood of damage to the electronics.
Firsts
First STM32 based PCB.
Using MAX3250 for isolated RS232 communication
Not using a FT232/FT231 for USB communication
Using a rotary encoder in a real project
Wireless Charging
Using the TPS63020 for 3.3V boost/buck regulation
Using the MCP73833 for charging
Using MAX6682 to read NTC
Goals
First build of this PCB. Due to various reasons beyond my control the PCB was pushed to manufacture before a full validation of the schematic and layout. A case of how much is going to work, rather than expecting everything to be perfectly working.
Summary of Testing
Prior to delivery of the PCB, when I was ordering the rotary encoder, it became evident that I had two of the pins (B&C) reversed. Mistake #1.
Initial inspection, under the microscope, of the PCB showed no obvious deviations from intended design. Other than the holes for the OLED do not line up with PCB. Normally I 3D print the PCB to check fit but alas I relied on the datasheet. Mistake #2.
Power was connected to USB. No magic smoke. Output from voltage regulator showed, steady, clean 3.40V.
Programming STM32 was successful. PLL frequency set to 48MHz and master clock output enabled. Checking clock output on frequency counter showed 48000000.17Hz. Crystal loading circuitry would appear to be correct.
OLED added. Worked as expected.
MCP73833 Status pins read successfully.
Added battery with multimeter in series to read current. Battery charging at ~200mA as per design. No excess heat on PCB. TPS63020 showing no deviation in output under load.
Internal Battery ADC tested. Required increasing STM32 ADC samples but otherwise reading accurately.
USB communication failed to work. On checking data sheet for STM32 a 1.5K resistor should have been added to pull up the D+ to 3.3V. After adding a resistor USB communication worked as expected. Mistake #3.
Battery No. 1 fully charged and MCP73833 shutdown as expected.
Wireless charging coil connected. Wireless charging worked as expected.
Disaster #1: now unable to program STM32 (device not found). Regulator now showing 6.3V output.
Components added to PCB No.2 - completed above testing with same result. Did not connect wireless charging coil this time.
Low voltage shutdown (3V) detection working as expected.
MAX3250 RS232 transmit and receive tested OK up to 115200. Not expected to be used above 9600.
MAX3250 Shutdown and fault detection tested OK.
Checked isolation - extremely high resistance between VCC’s and GND’s as expected.
Button input - not connected to 3.3V plane as per design. Eagle has done something weird here. Connecting wire between button and 3.3V leads to expected behaviour. Mistake #4.
Checked communication with MAX6682. All tested OK. Checked linearity of reading using precision variable resistor. Calculated 7.1C offset correction needed. Excellent linearity between expected usage range of 0C and 10C. 1.2C drift at 25C. May add LUT of corrections.
Standby current measured. Unable to get current lower than 14mA. Checked by disconnecting various components and discovered that by measuring the state of the MAX3250 shutdown pin with the oscilloscope the current usage would drop to 230uA (without OLED). Connected 10K resistor between shutdown pin and gnd. Standby current now 230uA, and MAX3250 still working correctly in normal usage. Guessing that there is a very small amount of current leaking from the STM32 in standby mode therefore the signal needs to be actively pulled low. Mistake #5.
Rotary encoder hardwired to correct mistake #1. Works as expected.
Tested with actual real world sensors. Works as intended.
Application #2:
Conclusions
Overall I am happy with where I got to with this attempt. Apart from disaster #1 I have been able to test all the significant parts of the board and shown that it will meet the needs for both applications (and others). I still need to investigate what happened with the first PCB, however the second one has been working perfectly for the last almost two weeks. It may be that I add a second USB connector for the wireless coil to attach to with a zener diode to protect against transient spikes (my guess as to what happened) In the next revision other than the obvious mistakes to be fixed I think I’m going to add a FT232 or FT231. I’m not convinced by the STM32 VCP and would prefer to go with what I know. I need to add test points. I may look to add a FET to shutdown the MCP73833 in standby mode which has shown it would save another 30uA. I may remove the programming header in order to save space and use a pogo pin jig to program the board instead.
Comments welcome.