[Sdcc-user] C8051 clock and timers

2016-08-28 Thread Philipp Klaus Krause
I have some trouble understanding the C8051 clock and timers. In the tutorial code at http://www.colecovision.eu/mcs51/C8051F340%20380%20LED.shtml I get a timer interrupt at 1000 Hz. But I got the values for configuring the timer experimentally, and can't seem to get them from the datasheet. Accor

Re: [Sdcc-user] C8051 clock and timers

2016-08-28 Thread Philipp Klaus Krause
On 28.08.2016 10:48, Philipp Klaus Krause wrote: > I have some trouble understanding the C8051 clock and timers. > In the tutorial code at > http://www.colecovision.eu/mcs51/C8051F340%20380%20LED.shtml I get a > timer interrupt at 1000 Hz. But I got the values for configuring the > timer experiment

Re: [Sdcc-user] C8051 clock and timers

2016-08-28 Thread Maarten Brock
> On 28.08.2016 10:48, Philipp Klaus Krause wrote: >> I have some trouble understanding the C8051 clock and timers. >> In the tutorial code at >> http://www.colecovision.eu/mcs51/C8051F340%20380%20LED.shtml I get a >> timer interrupt at 1000 Hz. But I got the values for configuring the >> timer exp

Re: [Sdcc-user] C8051 clock and timers

2016-08-28 Thread Philipp Klaus Krause
On 28.08.2016 12:11, Maarten Brock wrote: >> On 28.08.2016 10:48, Philipp Klaus Krause wrote: >>> I have some trouble understanding the C8051 clock and timers. >>> In the tutorial code at >>> http://www.colecovision.eu/mcs51/C8051F340%20380%20LED.shtml I get a >>> timer interrupt at 1000 Hz. But I

Re: [Sdcc-user] getting started with C8051

2016-08-28 Thread Philipp Klaus Krause
On 19.08.2016 23:11, benja...@southpole.se wrote: > Hi, I created some small examples for the C8051F*** > > https://github.com/merbanan/C8051F300_examples > > I tried these examples on a F340 but something doesnt work correctly when > I send data over the serial port and sdcc. If I use Keil it wo

Re: [Sdcc-user] getting started with C8051

2016-08-28 Thread Benjamin Larsson
Hi. > > I have serial output on the C8051F330 board RDM6300 working via > putchar() (see attached code). But whenever I try to use printf(), > everything gets messed up: Garbage output on the serial line or the > device resets. That is exactly the same behaviour I got on the F330. My code is a me

[Sdcc-user] PIC compilation weirdness

2016-08-28 Thread Kustaa Nyholm
Hi, I've got this statement in main.c: // hid_tx_buffer.uint8[35] = g_stepper_state[0].position.uint8[3]; // and it compiles to: // DA C??? F??? 00630 MOVFF (_g_s

Re: [Sdcc-user] getting started with C8051

2016-08-28 Thread Maarten Brock
> Hi. > >> >> I have serial output on the C8051F330 board RDM6300 working via >> putchar() (see attached code). But whenever I try to use printf(), >> everything gets messed up: Garbage output on the serial line or the >> device resets. > > That is exactly the same behaviour I got on the F330. My c

Re: [Sdcc-user] getting started with C8051

2016-08-28 Thread Philipp Klaus Krause
On 28.08.2016 15:05, Benjamin Larsson wrote: > Hi. > >> >> I have serial output on the C8051F330 board RDM6300 working via >> putchar() (see attached code). But whenever I try to use printf(), >> everything gets messed up: Garbage output on the serial line or the >> device resets. > > That is exa

Re: [Sdcc-user] getting started with C8051

2016-08-28 Thread Philipp Klaus Krause
On 28.08.2016 21:44, Philipp Klaus Krause wrote: > On 28.08.2016 15:05, Benjamin Larsson wrote: >> Hi. >> >>> >>> I have serial output on the C8051F330 board RDM6300 working via >>> putchar() (see attached code). But whenever I try to use printf(), >>> everything gets messed up: Garbage output on t

Re: [Sdcc-user] getting started with C8051

2016-08-28 Thread Philipp Klaus Krause
Wondering how printf("") might cause problems, I looked at the executed code in printf_large. Basically it should just do a read from the pointer, see that we are at the end of the string and return. So I found the read from a pointer is the problem. Placing a read from a generic pointer in main()

Re: [Sdcc-user] getting started with C8051

2016-08-28 Thread Philipp Klaus Krause
Dear Benjamin, what tool are you using to write your program onto the board? Philipp -- ___ Sdcc-user mailing list Sdcc-user@lists.sourceforge.net https://lists.sourceforge.ne

Re: [Sdcc-user] getting started with C8051

2016-08-28 Thread Benjamin Larsson
On 08/28/2016 11:03 PM, Philipp Klaus Krause wrote: > Dear Benjamin, > > what tool are you using to write your program onto the board? > > Philipp Under windows I use simplicity studio with a UC6 device. Under linux I use ec2-new from https://github.com/paragonRobotics/ec2-new with the same dev

Re: [Sdcc-user] getting started with C8051

2016-08-28 Thread Philipp Klaus Krause
On 28.08.2016 23:13, Benjamin Larsson wrote: > On 08/28/2016 11:03 PM, Philipp Klaus Krause wrote: >> Dear Benjamin, >> >> what tool are you using to write your program onto the board? >> >> Philipp > > > Under windows I use simplicity studio with a UC6 device. Under linux I > use ec2-new from h

Re: [Sdcc-user] getting started with C8051

2016-08-28 Thread Benjamin Larsson
On 08/28/2016 11:00 PM, Philipp Klaus Krause wrote: > Wondering how printf("") might cause problems, I looked at the executed > code in printf_large. Basically it should just do a read from the > pointer, see that we are at the end of the string and return. > > So I found the read from a pointer is

Re: [Sdcc-user] getting started with C8051

2016-08-28 Thread Benjamin Larsson
On 08/28/2016 11:30 PM, Philipp Klaus Krause wrote: > On 28.08.2016 23:13, Benjamin Larsson wrote: >> On 08/28/2016 11:03 PM, Philipp Klaus Krause wrote: >>> Dear Benjamin, >>> >>> what tool are you using to write your program onto the board? >>> >>> Philipp >> >> >> Under windows I use simplicity