chipKIT-core v1.4.3 released

Announcements for new builds and MPIDE enhancements
Post Reply
EmbeddedMan
Posts: 602
Joined: Tue May 24, 2011 9:24 pm
Location: Minneapolis, MN
Contact:

chipKIT-core v1.4.3 released

Post by EmbeddedMan » Sat Jul 29, 2017 2:00 pm

A very minor release:

https://github.com/chipKIT32/chipKIT-core/releases

And release notes:

http://chipkit.net/wiki/index.php?title ... ease_notes

Only change was core changes to support running Flip-N-Click MZ board at 252 MHz (was 200 MHz)

Enjoy!

bliviudaniel
Posts: 1
Joined: Tue Nov 28, 2017 10:22 am

Re: chipKIT-core v1.4.3 released

Post by bliviudaniel » Tue Nov 28, 2017 10:39 am

Hello,

I implemented an ADC driver for Chipkit Uno32 and I used the structure p32_adc from p32_defs.h file. The definition of the structure is not good because it does not respect the order and the addresses of the registers. Here is how it's defined now:

Code: Select all

typedef struct {
    volatile p32_regset adxCon1;
    volatile p32_regset adxCon2;
    volatile p32_regset adxCon3;
    volatile p32_regset adxChs;
    volatile p32_regset adxPcfg;
    volatile p32_regset adxCssl;
    volatile p32_regbuf adxBuf0;
    volatile p32_regbuf adxBuf1;
    volatile p32_regbuf adxBuf2;
    volatile p32_regbuf adxBuf3;
    volatile p32_regbuf adxBuf4;
    volatile p32_regbuf adxBuf5;
    volatile p32_regbuf adxBuf6;
    volatile p32_regbuf adxBuf7;
    volatile p32_regbuf adxBuf8;
    volatile p32_regbuf adxBuf9;
    volatile p32_regbuf adxBufA;
    volatile p32_regbuf adxBufB;
    volatile p32_regbuf adxBufC;
    volatile p32_regbuf adxBufD;
    volatile p32_regbuf adxBufE;
    volatile p32_regbuf adxBufF;
} p32_adc;
With this definition the ADC driver does not work because AD1PCFG is never written. Between adxCon3 and adxChs it should be an empty field as the address 0xBF809030 is not used by ADC (according to datasheet). Also, adxCssl is at address 0xBF809050 and must be before adxPcfg which is at address 0xBF809060.
I made the described modifications, based on the correct order of the registers in memory:

Code: Select all

typedef struct {
    volatile p32_regset adxCon1;
    volatile p32_regset adxCon2;
    volatile p32_regset adxCon3;
    volatile p32_regset unused;
    volatile p32_regset adxChs;
    volatile p32_regset adxCssl;
    volatile p32_regset adxPcfg;
    volatile p32_regbuf adxBuf0;
    volatile p32_regbuf adxBuf1;
    volatile p32_regbuf adxBuf2;
    volatile p32_regbuf adxBuf3;
    volatile p32_regbuf adxBuf4;
    volatile p32_regbuf adxBuf5;
    volatile p32_regbuf adxBuf6;
    volatile p32_regbuf adxBuf7;
    volatile p32_regbuf adxBuf8;
    volatile p32_regbuf adxBuf9;
    volatile p32_regbuf adxBufA;
    volatile p32_regbuf adxBufB;
    volatile p32_regbuf adxBufC;
    volatile p32_regbuf adxBufD;
    volatile p32_regbuf adxBufE;
    volatile p32_regbuf adxBufF;
} p32_adc;
and now, my ADC driver is working well.

Maybe this correction of p32_defs.h should be implemented in the next release of Chikit core...

User avatar
majenko
Site Admin
Posts: 2179
Joined: Wed Nov 09, 2011 7:51 pm
Location: UK
Contact:

Re: chipKIT-core v1.4.3 released

Post by majenko » Tue Nov 28, 2017 11:37 am

Yes, that looks like an error to me. For some bizarre reason the datasheet can't count. It goes 0x...10 0x....20 0x....30 0x....60 0x.....50..... bah!

So yes, they should be swapped over and the gap plugged. The reason this hasn't been noticed is that we don't actively use that structure in the core. It was, along with many others, created in the dim and distant past in order to help abstract stuff, and never actually got used. So in all that time you're the first to spot the error.

I'll add it to the next release.
Why not visit my shop? http://majenko.co.uk/catalog
Universal IDE: http://uecide.org
"I was trying to find out if it was possible to only eat one Jaffa Cake. I had to abandon the experiment because I ran out of Jaffa Cakes".

EmbeddedMan
Posts: 602
Joined: Tue May 24, 2011 9:24 pm
Location: Minneapolis, MN
Contact:

Re: chipKIT-core v1.4.3 released

Post by EmbeddedMan » Tue Nov 28, 2017 2:35 pm

Thanks for spotting this guys. Majenko, you added the fix to your USB branch. Did you mean to do that vs. a separate pull request?

*Brian

User avatar
majenko
Site Admin
Posts: 2179
Joined: Wed Nov 09, 2011 7:51 pm
Location: UK
Contact:

Re: chipKIT-core v1.4.3 released

Post by majenko » Tue Nov 28, 2017 4:40 pm

Yeah, that was intentional. Little fixes like this I just throw in. They are of little or no consequence since they aren't actually used by anything (as far as I can tell), and if they were we'd know about it already ;)

I'm hoping we can get this bad boy merged soon anyway, so we can get it out and in the wild for Christmas.
Why not visit my shop? http://majenko.co.uk/catalog
Universal IDE: http://uecide.org
"I was trying to find out if it was possible to only eat one Jaffa Cake. I had to abandon the experiment because I ran out of Jaffa Cakes".

EmbeddedMan
Posts: 602
Joined: Tue May 24, 2011 9:24 pm
Location: Minneapolis, MN
Contact:

Re: chipKIT-core v1.4.3 released

Post by EmbeddedMan » Tue Nov 28, 2017 6:38 pm

Agreed. -

Post Reply