Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Topics - Chris

Pages: [1]
1
Hey Mark / Guys,
I am having an issue implementing ADC access in the Serial Bootloader....
I am using a slightly modified version of the uTaskerSerialBoot Application in KDS and I think something is going on that i might be simply overlooking.
I didn't see an easy way to access ADC channels so I attempted to initialize and read the hardware registers directly but I am running into resets when finishing the calibration routine or seemingly accessing any hardware addresses directly.


//----.h header-----
#define ADC0_CFG1            (*(volatile uint32_t *)0x4003B008)
#define ADC0_CFG2            (*(volatile uint32_t *)0x4003B00C)
#define ADC0_SC2                   (*(volatile uint32_t *)0x4003B020)
#define ADC0_SC3                   (*(volatile uint32_t *)0x4003B024)
#define ADC_SC3_CAL            ((uint32_t)0x80)

//----  I call this function first without problems

//----.c code-----

void analog_init(void)
{
   ADC0_CFG1 = (uint32_t)0x7B;
   ADC0_CFG2 = (uint32_t)0x48;
   ADC0_SC2 = (uint32_t)0;
   ADC0_SC3 = (uint32_t)0x87;
}

//----  Then I call the following

void wait_cal(void)
{
  int attemptscnt = 0;
   while (ADC0_SC3 & ADC_SC3_CAL) {
      attemptscnt += 1;
   }
}



The code fails and the board resets as soon as i try to read ADC0_SC3..

thinking i might be waiting too long and inadvertently triggering a watchdog reset I changed 

while (ADC0_SC3 & ADC_SC3_CAL) {
to
if (ADC0_SC3 & ADC_SC3_CAL) {

but the behavior continues...
It looks like the Kinetis_ADC stuff is all #ifdef out but I could be missing something that is causing a conflict
can you think of anything that might cause this or maybe have some things i could check for?
any help is greatly appreciated.

2
µTasker general / Getting Started with Teensy 3.1/3.2 mk20dx hw
« on: November 28, 2017, 11:39:30 PM »
Hello,
I am attempting to build in KDS IDE for mk20dx teensy 3.1/3.2 based hw.
so far i have not been able to get the project to compile properly.
the 'Bare Minimum' configuration builds but doesn't appear to work when loaded to the chip.
I am a little confused about how to configure the others. It seems the main project is missing teensy configuration in config.h

Just hoping to get some help getting started.
ultimately I am hoping to have a loader I can use which will allow for rawHID for application commands and debugging while normally appearing to the system as MSD
Is there any chance you could provide the projects you used to build the examples here http://www.utasker.com/kinetis/TEENSY_3.1.html ?
https://www.youtube.com/watch?v=K8ScSgpgQ6M was helpful to get me going but I am still missing something hopefully simple.

Pages: [1]