Electronics > Projects, Designs, and Technical Stuff
Replacing STC MCS-51?
Gall:
Hello,
I have a Chinese CNC display board like this: . Unfortunately it misses pulses. This is due to incorrect technique they're using - they poll GPIOs. I want to fix them but this cannot be fixed in software.
I'm too lazy to make a completely new board so I decided to replace the microcontroller. The MCU is STC12C5A08AD, a cheap MCS-51 one in TQFP44. It basically has MCS51 compatible pin layout with only two power pins and two xtal pins, everything else is GPIO. Pin 16 is GND, pin 38 is +5V VCC and pins 14 and 15 go to a 24 MHz xtal. I'm looking for a CPLD or something that can be soldered to this board instead of this MCU. Another MCU with 5 hardware counters would be nice but I'm afraid there's no MCU that has counter inputs at matching pins. (I haven't traced all the pins yet but inputs go somewhere near 8-11-13 edge of the chip).
Can someone please recommend a chip? Does it exist at all?
tycz:
--- Quote from: Gall on August 29, 2011, 03:03:23 pm ---I'm too lazy to make a completely new board so I decided to replace the microcontroller. The MCU is STC12C5A08AD, a cheap MCS-51 one in TQFP44. It basically has MCS51 compatible pin layout with only two power pins and two xtal pins, everything else is GPIO. Pin 16 is GND, pin 38 is +5V VCC and pins 14 and 15 go to a 24 MHz xtal. I'm looking for a CPLD or something that can be soldered to this board instead of this MCU. Another MCU with 5 hardware counters would be nice but I'm afraid there's no MCU that has counter inputs at matching pins. (I haven't traced all the pins yet but inputs go somewhere near 8-11-13 edge of the chip).
Can someone please recommend a chip? Does it exist at all?
--- End quote ---
No, doesn't exist.
Gall:
Ok, another opportunity to hijack is to replace these 74HC14s with latches. It were nice to use something like 14-pin 16V8 eqivalent but this doesn't exist. Maybe small and fast 14-pin PIC would do the trick?..
tycz:
Why do have to fix this with a drop in replacement part? Do you have one board or many?
The STC part is already quite fast, and is not running at full speed. They claim to operate up to 35 MHz. (want to try it?). To add or swap with another 8 bit MCU will not really result in any significant performance gain. I don't know any STC part with hardware USB - does this have a software USB controller or is something amiss?
Gall:
The problem is, no microcontroller is able to count short pulses in software in a reliable way. One has to use at least a 1:2 prescaler (flip-flop) to make pulses long enough, or better a fully hardware bidirectional counter.
STC running at 35 MHz would have only about 150 kHz sampling rate if the software is highly optimized because it has to count 5 inputs at once. Thus it can miss pulse that is shorter than 10 us. And it misses.
Plan A: Remove STC and place a CPLD instead, implement everything in hardware.
Plan B: Remove two 74HC14s and place a CPLD instead, make hardware counters.
Plan C: Throw this board away, take a CPLD and build my own design. But this board has lots of nice transistors to demux LEDs, why throw them away?
Plan D: Fit Cypress PSoC somewhere, probably instead of STC. It's programmable peripherals are good enough to implement 5 hardware counters.
Plan E. Remove two 74HC14s and fit 22V10 instead, turning them into 1:2 prescaler. (Or fit something else and make 1:4, 1:16 or programmable prescaler).
Plan F. Prescale the signal before this board. (Inconvenient).
Any suggestions?
This part does not have any hardware USB. Looks like no software USB, too. This "USB" port is directly wired to the MCU and looks like it isn't USB at all, they just used an USB connector for something like debug port. My first guess was that it's RS232 but it does not go to RX and TX pins. I never tried to connect it to USB - I'm afraid it's 5V instead of 3.3 V.
Navigation
[0] Message Index
[#] Next page
Go to full version