On 15.08.2016 20:54, Maarten Brock wrote: >> On 15.08.2016 20:01, Philipp Klaus Krause wrote: >>> Hello, >>> >>> I wrote my first little mcs51 program today, for the Cypress FX2LP. But >>> I encountered a problem: Timer 1 runs too fast. When I set up Timer 0 >>> and Timer 1 the same, Timer 1 runs about 4 times faster. >>> >>> I first noticed the problem when trying to do a software UART, which >>> worked with Tiemr 1, but not with Timer 2. >>> >>> I have attached programs for a 2-bit counter on the LEDs of my board a >>> bits 0 and 1 of port A. With Timer 1, the counter increments once per >>> second. >> >> The previous two paragraphs were meant to be: >> >> I first noticed the problem when trying to do a software UART, which >> worked with Tiemer 0, but not with Timer 1. >> >> I have attached programs for a 2-bit counter on the LEDs of my board a >> bits 0 and 1 of port A. With Timer 0, the counter increments once per >> second. >> >>> I compile my programs using >>> sdcc -mmcs51 test2.c >>> and put them onto the FX2LP using >>> cycfx2prog prg:test2.ihx run >>> >>> Philipp > > Hello Philipp, > > You did not set CKCON which selects the prescaler clk/4 or clk/12. T0M and > T1M should be 0 after reset, but the loader may have left them > differently. > > Maarten
I didn't set it. But by setting it I can make the timer run even faster. Philipp ------------------------------------------------------------------------------ What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic patterns at an interface-level. Reveals which users, apps, and protocols are consuming the most bandwidth. Provides multi-vendor support for NetFlow, J-Flow, sFlow and other flows. Make informed decisions using capacity planning reports. http://sdm.link/zohodev2dev _______________________________________________ Sdcc-user mailing list Sdcc-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/sdcc-user