Jump to content

DavidT

EstablishedMember
  • Content Count

    60
  • Joined

  • Last visited

Everything posted by DavidT

  1. Hi. I can create and read an array created with the rom char statement. Is it possible to write to this array from within the program to use as a temporary data logging store (before writing to SD card)? Thanks, David.
  2. That site is mine. The differences I've observed between BoostC and CC5X appear at the bottom of the page in the above link. Most of my 'projects' (linking off that page) are BoostC based but done after starting with CC5X. Regards, David.
  3. I suggest you move an LED trap through your code so you can tell where it is getting to before it fails. Trisio is controlling whether ports are input or out, and ansel controls whether they are analogue or digital. I'm not familiar with your command to merge the high and low results. One other thing I do different is how I pick up that the conversion is complete. I'm using: while(pir1.6==0); instead of your while(adcon0.1==1); I'm also not using your header files. I'm using ADCs in many programs, most with BoostC now; perhaps these will help you walk through the steps: http://www.flyelectric.ukgateway.net/pic2.htm I have simple examples on my 'beginners' page but written for CC5X which has a slightly different style. David.
  4. I use trisa.0=1 and ansel.0=1 to configure port A0; does your trisa=255 do the same thing? I think ansel defaults to 1's so try configuring your LED output as '0' to be a digital output. The data sheet does not list '111' as a valid adcon1 clock setting. I don't think you need the 100ms delays in a_d(). The first can be much shorter (incrementing a counter by 1 takes longer than you need to charge the internal ADC capacitor) and the other in the while statement is unnecessary since it will continue as soon as the conversion is complete. Use MAKESHORT(cSpeed, adresl, adresh); if you want the complete conversion value. I've used the 16F687 which is in the same family so can provide a number of more complex examples if you wish. David.
  5. I have been making a temperature monitoring device to help set up, tune and cool model aeroplane motors, 2 and 4 cylinder petrol engines 150/300cc. Temperatures are displayed via 12 LEDs, 3 per cylinder. 'Short' interrupts toggle between 'hold' and 'real-time' displays, and the 'long' interrupt clears EEPROM just before flight. These features are working well now, thank you. MMC cards next! I'm using the MCLR pin to detect a change in state from the push-button. And yes, I have put the simple 100ms delay at the start of my interrupt to debounce the switch. If the switch is still being pressed at the end of that, and while it continues to be pressed, I increment a counter every 100ms within a 'while' statement. Having this counter as a global variable I can make decisions both within the interrupt and elsewhere. So at the moment I make the hold/real-time mode decision in the interrupt and flash the LEDs in a pattern to reveal that as you suggest. I've moved the initialisation of memory and various buffers to main(). I believe my main problem was I was trying to clear some variables that had probably been saved by the interrupt. When I stopped doing this my lockups went away. No surprise I guess! Regards, David.
  6. Thanks, Richard. This interrupt will be an input state change triggered by a push-button so I don't have another on it's way if I debounce it adequately and disable interrupts while in the interrupt function itself. I would like to measure the button press duration to select modes, write to EEPROM, make 12 LED's flash in special patterns, etc. This quickly builds up into code of some substance. I will take another look at ra68qi's post; its been helpful before. Thanks for the prototyping example. David.
  7. Hi. I have some questions about using interrupts please: 1. Is there any limit to how much code you can put in the interrupt function? 2. Interrupts have to be at address location 4. Does this limit how many functions/code size that can precede the interrupt function so I can call them from the interrupt? 3. Related to 2, how do I do function prototyping so I can call functions that are written 'after' the interrupt function? I'm a novice at programming but do have have many simple programs working successfully and can make basic interrupts work. More complex ones are causing me some grief hence my questions. Thanks, David.
  8. Thank you. The standard way in the manual is doing the trick. Regards, David
  9. Hi. I'm wanting to select the lower 8 bits (and upper) from a 16bit variable. How do I do this with BoostC please? With CC5X I'm used to variable.low8 and .high8. Thanks, David.
  10. Hi, More of an inquiry than bug I suspect. I've just installed v6.7 to try and the project wizard only has 4 devices. Is this normal? Thanks, David.
×
×
  • Create New...