some questions concerning the ZM-1350 Firmware
- Hi Chris,
I have nearly finished a Smartsocket-Display with 12x ZM-1350.
During this I encountered 2 Problems:
The enumeration of the smartsocke usually fails if I don't wait at least a minute after the last powerdown.
If I turn the power on too soon after the last powerdown, there are multiple "Number 1"-smartsockets in the row.
It seems like the internal RAM of the PIC still holds the data some time even when power is turned off.
Is there a simple solution to this (using the Brown-Out Detection, changing the firmware)?
I have seen in the setting of the Fusebits that the (unused) MCLR-Pin is programmed as I/O-Pin and not as MCLR.
As I understand it this pin is needed for (re-)programming the PIC with the low-voltage ICSP.
I have a simple JDK-Programmer attached to the serial port of my PC.
First (virgin) programming and identification of the PIC by the programmer-software always works but I have had problems to reprogramm some PICs.
Is it save to set this Fuse-Bit to "Use MCLR as MCLR"?
If this pin is configured as an input, couldn't it be used for the serial reception and thus make free another I/O-pin of the PIC?
For the ZM-1350 there would be a need for another I/O for the decimal point.
I had to use two separate shift-register ICs and another 3 I/O-Pins for clock, data and reset from my controller to use the decimal points.
Finally I have to speak a very big compliment for Your creation of the smartsocket software.
- Thanks for your comments Roger, it is nice to hear some feedback.
Your powerdown issue may have something to do with your power supply. Have you measured the voltage on the supply lines to the sockets after you have turned off the supply, it may have a large output filter cap which continues to provide power for a while. One solution if that is the case would be to fit a bleeder resistor across the supply lines.
You ought to be able to reprogram the PIC and set brown out detect to 'on'via your programmer. I have not had any issues like that but maybe it is a good idea for the firmware to be changed.
As for the MCLR pin, I have not used it because if it is set for the MCLR function then it needs a 10k resistor connected to Vdd to keep the pic operating. I can make the pic operate all the time just by not using that function. We don't need any external reset function so I defaulted it to 'off'. John Taylor has pointed out that if enough stray voltage built up on that pin then it could enter the program mode. Again, I have had no issues like that but if yoiu are concerned then using a high value capacitor to tie that pin to ground would stop it from happening
If the MCLR pin were to be used for serial data input the problem then would be how to create interrupts. At the moment, the serial data is handled by the onboard EUSART, which creates a software interrupt every time a byte of data is received, which allows all the serial data to be handled in the background without affecting the display functions. If I changed this to use the software serial commands then the program loop has to test for the existence of data or wait for data, which is all very time consuming in terms of processor activity, which in turn would create a disturbance of the display, particularly if an effect such as crossfading is in process.
For the decimal point I am confused because I do not think the ZM1350 has a decimal point, merely an underscore. There is a small electrode approximately in the position of the decimal point, but I have always been led to believe that this is the 'keep alive' electrode, which helps the other segments to light especially in dark conditions. If anyone else other information on this I would appreciate your comments. As far as I know Roger, using that electrode as a cathode is not using it as intended, but if you are having success using it as a decimal point then I've learned something new !
- Hi Chris,
I just checked my power supply for how long it holds the voltage after switching off.
Voltage is down to zero after about 1...2 seconds, so this can't be the reason for the failure in enumeration.
When I just tried again to reproduce the error I couldn't get the wrong enumeration to show up again. Strange.
I will observe under what conditions the enumeration-failure shows up again and if it can be eliminated by setting the brown-out detection bits.
Concerning the MCLR-pin:
As I understand the datasheet of the PIC correctly, there is an internal pullup-resistor if MCLR is programmed as MCLR.
It says in Section 18.104.22.168:
"The RA3/MCLR/VPP pin is configurable to function as one
of the following:
a general purpose input
as Master Clear Reset with weak pull-up"
But in Section 14.1 of the datasheet it says about the configuration bits:
MCLRE: MCLR Pin Function Select bit(4)
1 = MCLR pin function is MCLR
0 = MCLR pin function is digital input, MCLR internally tied to VDD
So this is quite confusing.
So the 10k-Resistor to Vdd is probably just for keeping the logic-level safely to Vdd in case of stray voltage?
Anyway the MCLR-function is necessary for low-voltage programming, isn't it?
I understand through your explanation that it will probably not be possible to use this pin for the serial input to make another pin available for an additional output.
So we have to live with 14 segments+underscore without adding additional additional hardware as I have build for the decimal point.
The ZM 1350 definitely does have (additional to the underscore) a true decimal point on the left side.
It's more like a little vertical comma.
The keep-alive cathode in contrast is on the right side.
Both are described in the datasheet which we have here in files section.
On the pc-board (made by Guus and made available by Jan at www.askjanfirst.de) there even is the right cathode-resistor for it.
Only the MPSA-43 transistor didn't make it to the pc-board :-)
I have a small low-quality movie of the display working (with only 11 of the 12 digits in place due to one broken display).
There You can see the decimal point "in action".
But I don't know how to send an attachment or how to place it in the files section.
- I'm glad you've resolved the enumeration failure issue. that was a piece of trouble to get working originally.
For MCLR, I wasn't aware that the 16F690 had an internal pullup. I probably read it but failed to digest because i new i didn't need that function. The previous pics I have worked with have no internal pullup and I assumed that this one followed suit.
I stand corrected over my mistake regarding the existence of the decimal point. Looking at the lack of IO I think my preference must have been for activating the underscore rather than the DP . As you have seen there is one pin too few with the 16F690 for both. I had to dig out a ZM1350 to check this out ! Well done with your workaround solution anyway.
The next size of micro up is 28 pin. Maybe someone wants to go there ? An SMD part would probably fit quite well with few alterations.