Lee Mulvogue wrote: > Thanks for the reply Jan-Erik, > >> const char okay[5399]={0x39, 0x26,.... > >OK, fine. Have you checked that you can create a such large array > at all ? > Sorry, can you give some more details on where I should be looking? Well, if your tools (compiler) doesn't complain, well... :-) > Do you mean with regards to compiler limits, PIC architecture, memory > limits? The 18F2620 has 64K, the "ok" sample only took it to 9% > memory useage. Well, such an array would go into flash. Maybe that you have checked that the array-read in the code actualy does read from flash. I have no idea. This might not be the issue at all... > >> int16 sample = 0; //current sample value > >> set_pwm2_duty(sample); //send it to the PWM > >Is set_pwm2_duty designed/documented to take a 16-bit value ? And > why use a 16 bit value anyway ? Your values in the array are 8-bit > values, not ? > Good point, I think you may hopefully have hit it on the head. I > didn't specify 16bit... Then what does "int16" mean ? Doesn't that make the "sample" variable a 16-bit variable. I just thought so but I'm not sure. Jan-Erik. -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist