ok before i update i want to moan!! i still havnt unpacked everything for the lab!! so loads of stuff i cant find yet. ALSO dad has been in here doing stuff so the lab is now a complete TIP!! GRRRRRRRRRRrrrrrrrrr. anyway
have changed psu just to make sure that any odd readings and the OC trip i kept getting wasnt down to the PSU, i am using exactly same model just a different unit, for the record the PSU is a HP6632A, these are utterly brilliant!
i have now put a socket on the board for crystals as seen in the following pic
i couldnt find info in the datasheet about caps to use with a crystal but the family datasheet says to use between 22pf and 33pf, actually what it says is
this on page 194 of the family datasheet, the top line basically says to me take a wild guess between the values of 22pf and 33pf and take it from there
the value i chose was the first cap i found that was in the range and it happened to be 25pf, or to be precise
the other is 25.4pf so close enough!
so the board with a 12 MgHz crystal is bellow
while the oscilloscope on this bench is a good LA and reasonable oscilloscope i am not sure how accurate this one is so i normally use it as a rough guide when i use the scope on it, i will at some point swap the scope over to one the other ones that i am pretty sure are fairly accurate. Anyway the following is a pic of the output from the crystal, now i dont know why but as i have never used a crystal before i was expecting to see a square wave that was fosc/4, but instead as those in the know will tell you i got the following
just so you know what i am using to do these simple tests its only the following code
C:
#include <p30fxxxx.h>
_FOSC(CSW_FSCM_OFF & HS);
_FWDT(WDT_OFF);
_FBORPOR(PBOR_OFF & MCLR_EN);
_FGS(CODE_PROT_OFF);
_FICD( ICS_PGD );
main()
{
while(1){
TRISB = 0; // all PORTB pins output
PORTB = 0xff;
PORTB = 0x00;
}
}
and yes i know i am using 8 bit number not 16bit but for this i didnt think it was going matter!
now for the output i was moaning about in an earlier post, it seems the frequency was right! with the crystal its about 50% higher but then again the crystal is 50% than the internal frequency i was using. however as seen in the following pic the trace is still ugly!!
i assume the fact its not a nice square wave has something to do with the output drivers on the pin, i dont know but might look into it at a later stage, if i have to make a wild guess then i would go with the mosfet driver charging and discharging etc, but its only a wild guess and i will look into it later. anyway thats where we are at! the socket allows me to change crystal easily if i want to switch frequency as we go, next up will be the RS232 layout and board or messing with timer's not sure wich yet but we are at least onto more interesting stuff! thats if anyone is still following my ramblings lol