Jump to content

Tim Zim

  • Content Count

  • Joined

  • Last visited

Community Reputation

0 Neutral

About Tim Zim

  • Rank

Contact Methods

  • Website URL
  • ICQ

Profile Information

  • Gender
  • Location
    Hampshire, UK
  1. Hi Reynard Excellent. Thanks for the clear instructions. All working well now. Onwards & upwards... Cheers Tim
  2. Hi Reynard Thanks for that - can you give me a little more information on what I need to do, as I can't seem to make sense of the issue here. Is it the case that my Sourceboost is not setup right? Regards Tim
  3. Hi I wonder if anyone can help. I've bought a few PIC18F26J50's and have just upgraded to the latest version of SourceBooost (7.20), but cannot seem to get this particular PIC to work with a simple startup example (tried both the PIC's I have in case). I've had no problem with any of the previous types of PIC's I've been using. When I write to the PIC with my PICKIT2, the LED's I'm trying to flash light up briefly, as I would expect on writing the hex, showing me the hardware is likely ok. The loaded program just does not work. Code: #include <system.h> //#include
  4. Hi Chuck Don't forget, you don't HAVE to use interrupts, you can simply check the status of the interrupt flags in your main loop. This may actually prove quicker in some circumstances.... Tim
  5. Hi davidb I agree that depending on the requirement, there are different ways of doing things, no problem there. I see so many code snippets posted which seem unnecessarily complex, or bloated, that from time to time I feel compelled to put in my 10p worth. In all cases writing robust, easy to comprehend, code provides the basis for reliable operation. Cheers Tim
  6. Just because you own a pair of snow shoes doesn't mean you have to wear them to work every day of the year. In the same respect, just because the PIC has interrupts does not mean they have to be coded or used. The sample code corrected by davidb could be cleaned up to: void interrupt(void) { // Timer0 Interrupt tmr0=tmr0_offset; clear_bit( intcon, T0IF ); // Clear T0IF every time } The other interrupts can be turned off in INTCON or whatever, as they are not being used. Also, seeing as I'm off on one here, why check to see if an interrupt is enabled as well as checkin
  7. Hi Ian Great - I have a few of these MRF24J40MA's winging their way to me and am planning on using PIC18F13K50's to drive them. Fancy collaborating on this? Regards Tim
  8. Hi all Has anyone done any interfacing between PICs and the MRF24J40MA, also from Microchip, using SourceBoost? I'm thinking of using the ZigBee protocol, probably starting with the stack from Microchip. I've seen a few enquiries on this in the past, but have not seen any replies.
  9. Hi Raghunathan In my view, using USB for serial comms is a little like using a Ferrari as a tractor. Send me a separate message with your email address, and I'll email you some PIC USB code I have been working on which will address these issues. Tim
  10. Raghunathan - you don't need anything between Vusb and D+. The configuration will do the job of setting the USB speed for you. That may wll be your problem. Regards Tim
  11. I use a slight variant on that for my generic EEProm writes, which I often use for simple/quick debugging: void WriteEEP(unsigned char address, unsigned char data){ eecon1=0b00000100; // Initial eecon1 state - enables write while( test_bit(eecon1, WR) ){ } eeadr=address; eedata=data; eecon2=0x55; eecon2=0xaa; set_bit(eecon1, WR); eecon1=0; // disable write (does not affect WR) } Here, the checking to see if the write is complete is at the top of the code - so avoiding a wait for the write to complete if there is no need to. Also, as interrupts are not used, the GIE flag does no
  12. Keni I used the i2c_test example code in C:\Program Files\SourceBoost\Samples\C\BoostC Set the i2c software args etc. for the 18F88 as: //////////////////////////////////////////////////////////////////////////// // i2c software implementation template arguments //////////////////////////////////////////////////////////////////////////// // SCL = PORTB.3 // SDA = PORTB.4 #define i2c_ARGS 3, PORTB, TRISB, 4, PORTB, TRISB, e_SSPCON1, e_SSPCON2, \ e_SSPSTAT, e_SSPBUF, e_SSPIF_BIT, e_SSPIF_PIR, \ e_BCLIF_BIT, e_BCLIF_PIR, 7, e_SSPADD, (i2c_reset_wdt | i2c_SMP) // RAM used
  13. Mike Looks like it may be worth you looking at the PWM module - this may save you some effort.
  14. Hi Raghunathan I had to add the 18F2550 to the analog_inputs_off() def in picutils.h and it compiles and runs just fine. With the serial debug turned on, at a slower baud rate than Ian's, the code did not work. I turned the debug code off and it all runs perfectly. I hope that helps Regards Tim
  • Create New...