What is my clock speed?
Posted: Tue Feb 21, 2012 6:26 pm
Hello
I'm using dsPIC 4.3 to program a 30F6012A. I am using a 4MHz crystal and my clocksetting is X16 PLL mode. That should give me an internal frequency of 64MHz. And that is what I have entered in the projects setting and everything seams to be workin. A 100ms delay is realy 100us when I am checking with a scope. I have a 20x4 LCD display attached and it works fine. I also have internal CAN and UART1 enabled and here is the odd part. Both the CAN and the RS232 seams to be running at half speed. If a set the CAN speed to 250 b/s, my CAN diagnostic tools (I've tried two different models ) are telling me that I am running at 125b/s. Setting half the speed on the CAN diagnostics gives correct readings and communication is without any problem. Setting the CAN tools to 250b/s makes the data unreadable.
The same thing happens with my RS232 using UART1. If i set the speed to 9600, I can read the data beeing sent without any problem if I set the speed on the bus analyser tool or the serial port on a PC to 4800. Does anyone have any ideas about what is going on?
I'm using dsPIC 4.3 to program a 30F6012A. I am using a 4MHz crystal and my clocksetting is X16 PLL mode. That should give me an internal frequency of 64MHz. And that is what I have entered in the projects setting and everything seams to be workin. A 100ms delay is realy 100us when I am checking with a scope. I have a 20x4 LCD display attached and it works fine. I also have internal CAN and UART1 enabled and here is the odd part. Both the CAN and the RS232 seams to be running at half speed. If a set the CAN speed to 250 b/s, my CAN diagnostic tools (I've tried two different models ) are telling me that I am running at 125b/s. Setting half the speed on the CAN diagnostics gives correct readings and communication is without any problem. Setting the CAN tools to 250b/s makes the data unreadable.
The same thing happens with my RS232 using UART1. If i set the speed to 9600, I can read the data beeing sent without any problem if I set the speed on the bus analyser tool or the serial port on a PC to 4800. Does anyone have any ideas about what is going on?