Jump to content

Malcolm White

  • Content Count

  • Joined

  • Last visited

Community Reputation

0 Neutral

About Malcolm White

  • Rank
  • Birthday 04/12/1974

Contact Methods

  • Website URL
  • ICQ

Profile Information

  • Gender
  • Location
  1. Ok.. I persisted (against sounder judgement), and I actually figured it out. This is what I ended up with, and modified it slightly to allow for the target "clock" to be supplied. typedef struct { unsigned char SECONDS; unsigned char MINUTES; unsigned char HOURS; } clock_t; clock_t CLOCK; void Clock_Next_Field(void); void Clock_Inc_Value(void); void Clock_59X_Rollover(void); void Clock_23H_Rollover(void); void Clock_Tick(clock_t &clockAddr) { asm { MOVLW _clockAddr MOVWF _fsr CALL Clock_Inc_Value CALL Clock_59X_Rollover CALL Clock_Next_Field CALL Clock_59X_Rollover CALL
  2. Take a look here... Roman Black's ZEZJ timer routines Down the bottom I think has something that will do.
  3. I thought that. That main concern was the application I want to use it in runs on two timer interrupts - one not that fast (about once a second), the other at about 15K/sec. So was trying to keep it small and fast. Rewriting it in C will increase both of these. I'll give it a go and see how it turns out.
  4. I don't know if this has been raised before, but a RS232 plugin would be nice - some way to either watch and/or interact with the serial port (physical or virtual. Maybe some way to pause the debug process to allow characters or data be sent or interacted with?
  5. Stored hours, minutes and seconds, with the rollover for 60 seconds, and 60 minutes, and 24 hours handled. Andrews page is here with the original source I thought of a way maybe to do it driving to work... (Probably not the smartest thing, but meh) void TICK(void) { asm { MOVLW SECONDS MOVWF FSR CALL SUB1 CALL SUB0 CALL SUB0 GOTO SUB2 } } void SUB0(void) { asm { INCF FSR SKPNC } SUB1(); } void SUB1(void) { asm { INCF INDF MOVLW 6 ADDWF INDF SKPDC SUBWF INDF MOVLW 0100H - 060H } SUB2(); } unsigned char SUB2(void) { asm { ADD
  6. I was going over a piece of assembler code (I admit, not written by me, but Andrew Warren with help from Scott Dattalo) that is a BCD clock. I liked the size of the code and simplicity. So I figured I would try and port it into C (using inline ASM), and found to my dismay that I couldn't due to the optimised nature of the code. SECONDS EQU [any register, on any page] MINUTES EQU SECONDS+1 HOURS EQU MINUTES+1 TICK: MOVLW SECONDS MOVWF FSR CALL SUB1 CALL SUB0 CALL SUB0 GOTO SUB2 SUB0: INCF FSR SKPNC SUB1: INCF INDF MOVLW 6 ADDWF INDF
  7. Did this ever get posted? I only ask because I am looking for the same. I have found one site with the code in ASM, but it doesn't handle the jitter too well.
  8. Has any one else had an issue with upgrading to 5.0.7 and trying to use the logic analyser and led segment plugins. There is an error message that comes up mentioning they are using the wrong API. Is there a newer version of these somewhere?
  9. I have noticed this issue too. It's not only excessive switching, theres also gotos not needed as well in some cases. I tried writing an optimisation script, but that seems to not want to work either. The source code looks like this... ;;;;;;;; if(!(pir1&(1<<0x0005))) return; // If bit set, we can go bcf STATUS, RP0 bcf STATUS, RP1 btfsc _pir1, D'5' goto label_0004 return ;;;;;;;; ;;;;;;;; if((rcsta&(1<<0x0001))) { // If there is an overrun error label_0004 bcf STATUS, RP0 bcf STATUS, RP1 ...so I wrote the following script //////////////////////////////////
  10. I have been using the compiler for the last couple of weeks and have one tiny nagging issue. In the Watch section, when you right click an option you have Bin, Oct, Hex, Dec. What would be nice is something like "String". If you have declared an array, or such, it would be nice to be able to see what is in that array/string, instead of the first two bytes only. This would be handy in things like circular buffers. Also struct would be another one that would be nice to be able to see - what elements have which values in a struct definition.
  11. I've realised you can't do it (works out to be about 8 clock cycles per interrupt.) Oh well.
  12. I am having some difficulty in trying to set up Timer1 on a PIC16C63A... I am trying to get Timer1 to interrupt exactly 115200 times per second using a 3.6864Mhz crystal... It doesn't matter which values I put in the Timer1 prescaler and counter I cannot get it to do it exactely... Can anyone please suggest a formula I can use, or such to work out the correct values...
  • Create New...