Jump to content

meththas

EstablishedMember
  • Content count

    6
  • Joined

  • Last visited

Community Reputation

0 Neutral

About meththas

  • Rank
    Newbrie
  1. Hi guys, I have a ECIO40 development board that has a 18F4455 PIC on it. The PIC will read some data from input pins and store it in an array. I want to be able to read that array and send it through to my PC via USB. Can you please help me get started on this. Also, I am confused as to if the ECIO40 comes with the USB driver such that I don't need to include the Microchip dll files.. or do I still need to do this as well? Any help in figuring this out will be much appreciated. Thanks.
  2. Hi, can someone please tell me how I can connect an ECIO40 development board (with the PIC 18F4455 chip) to external power. I have tried giving a 5V DC input from a power supply to VDD_IN and changing the Jumper setting from USB to EXT. but nothing happens. I was expecting a PWM clock output on C2, but everything is LOW when I check on the oscilloscope. Can someone please help me figure it out. Thanks. Meththa
  3. Hi Dave, Reynard, Thank you so much for your help. I see what you mean about the number of cycles now. I will look at how to get the Timer 2 or the PWM working to generate the clock then. Does the compiler have anything to do with how many cycles it takes to run an instruction? Like I said I am using BoostC compiler with SourceBoost. But I have seen that others recommend using either CC8E (CC5X version for 18F chips) or even something like CCS etc. So from what you have explained to me, the inside of the PIC chip is never going to run as fast as the clock frequency is it? I mean if I am reading data from a port within a while loop, the time it takes to read the data will depend on all the other code I've got and therefore will be at a slower rate than what I am expecting or what I should be reading the data at. In such instances is it better to use interrupts or is there any other method to read data from ports at specific frequencies? I can't thank you guys enough for your help. Meththa
  4. Thank you for the quick reply guys. Reynard - could you please clarify to me what you mean please. Do you mean it is taking 36 steps to go through the while loop? Is there anything I can do to minimise that time. Would you also be able to tell me how you calculated the number of cycles please so that I can use the same method in the future. Also what would the best method be for generating a clock signal that is needed to drive another CMOS chip. Thank you for all your help. Meththa
  5. #include <system.h> #include "Light_Sensor.h" #pragma CLOCK_FREQ 48000000 //Configuration data #pragma DATA 0x300000, 0x20 //00100000 CONFIG1L #pragma DATA 0x300001, 0xe //00001110 CONFIG1H #pragma DATA 0x300002, 0x3e //00111110 CONFIG2L #pragma DATA 0x300003, 0x1e //00011110 CONFIG2H #pragma DATA 0x300004, 0x0 //00000000 #pragma DATA 0x300005, 0x81 //10000001 CONFIG3H #pragma DATA 0x300006, 0x81 //10000001 CONFIG4L #pragma DATA 0x300007, 0x0 //00000000 #pragma DATA 0x300008, 0xf //00001111 CONFIG5L #pragma DATA 0x300009, 0x80 //10000000 CONFIG5H #pragma DATA 0x30000a, 0xf //00001111 CONFIG6L #pragma DATA 0x30000b, 0xa0 //10100000 CONFIG6H #pragma DATA 0x30000c, 0xf //00001111 CONFIG7L #pragma DATA 0x30000d, 0x0 //00000000 CONFIG7H void main(void) { trisd = 0; //All pins configured as output portd.2 = 0; // initialise outputs unsigned char x = 1; while(1){ x = 1-x; portd.0 = x; } } sorry - I should've included this. As you can see, it doesnt do much at all apart from toggle the output pin.
  6. Hi Guys, I am a newbie to PIC microcontroller programming and struggling to understand some the ways pics function. I've got the ECIO40 development board which has a PIC18F4455 chip on board. After reading the data sheet, I was under the impression that the primary clock will default to 48MHz at which both USB and the PIC core and peripherals will run at. I've got a c program written in sourceboost, where all I do is toggle a variable ON-OFF and write it to an output port. Now, I was expecting this generated clock to be in the MHz range, whereas, the output I am actually getting is 600 kHz. I have tried to modify registers etc to no avail. Can someone please explain why the output is at this frequency and not at the higher rate. Regards, Meththa
×