Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.
|
Forum Index : Microcontroller and PC projects : Micromite EXTREME b5: SnadPic support
Author | Message | ||||
matherp Guru Joined: 11/12/2012 Location: United KingdomPosts: 8592 |
Please find attached the latest beta of the Hex file for the MZ chips. 2016-11-22_161652_MicromiteEXTREMEb5.zip The changes are as follows: * Implemented choice of SPI channel for SDcard connection * Implemented new commands and functions for SPI3 and SPI4 (same syntax as SPI and SPI2) - see pinout for pin usage on the 64 pin chip. These may not be necessary but were basically free in order to allow flexible SDcard connection * Fixed bug in "CPU SLEEP" and "CPU SLEEP time" commands * Completed conversion to Harmony Plib calls. I haven't received my Snadpic board yet and will publish the full pinout for the 100-pin chip when it arrives and has been tested. The current hex is configured for a 12MHz oscillator. I will post a hex for the 24MHz oscillator when tested on a my Snadpic. If you already have a Snadpic with a 24MHz oscillator, let me know by PM and I'll send you a hex to test. There is a slightly modified syntax for OPTION SDCARD with an additional mandatory parameter "channel" OPTION SDCARD channel,CS,[CD],[WP] so to use the SD card as normal on SPI2 with card select connected to pin 1 and no card detect type "OPTION SDCARD 2,1" The reason for the change is that the SnadPic PCB has the on-board SD slot connected to SPI channel 4 so rather than create a dedicated file for this I have added support for choosing the channel. The SnadPic wiring is: Pin 81 = RD4-------------------->CS Pin 67 = RA15------------------->SDO4 Pin 69 = RD10------------------->SCK4 Pin 70 = RD11------------------->SDI4 Pin 59 = RA2-------------------->CARD DETECT so the command on the SnadPic will be: "OPTION SDCARD 4,81,59" SDcard usage has been tested on all 4 SPI channels on the 64-pin MZ chip The pinout for the 64-pin chip is the same as b2 with the exception that SPI3 and 4 connections have been specified as additional options. E5 : 1 Analog / Digital / SSD1963-D5 E6 : 2 Analog / Digital / SSD1963-D6 E7 : 3 Analog / Digital / SSD1963-D7 G6 : 4 Analog / Digital / SPI2-CLK G7 : 5 Analog / Digital / SPI2-OUT G8 : 6 Console-RX / COM4-RX 7 VSS 8 3.3V 9 MCLR / 5V G9 : 10 Analog / Digital / PWM-1C B5 : 11 Analog / Digital / COM2-TX / SPI3-OUT B4 : 12 Analog / Digital B3 : 13 Analog / Digital / COM2-RX / SPI4-IN B2 : 14 Analog / Digital / COM1-EN / SPI4-OUT B1 : 15 Analog / Digital / COM1-TX B0 : 16 Analog / Digital / COM3-TX B6 : 17 Analog / Digital / COM3-RX B7 : 18 Analog / Digital 19 : AVDD 20 : AVSS B8 : 21 Analog / Digital B9 : 22 Analog / Digital /SPI3-IN B10 : 23 Analog / Digital / COUNT B11 : 24 Analog / Digital / SSD1963-WR 25 VSS 26 VDD B12 : 27 Analog / Digital / SSD1963-RS B13 : 28 Analog / Digital / SSD1963-RESET B14 : 29 Analog / Digital / PWM-1B / SPI3-CLK B15 : 30 Analog / Digital / PWM-2B 31 Oscillator 12MHz C15 : 32 Digital 33 USB-VBUS 34 USB-VUSB 35 VSS 36 USB-D- 37 USB-D+ F3 : 38 Digital 39 VDD 40 VSS F4 : 41 Digital / 5V / KYBD-CLK F5 : 42 Digital / 5V / KYBD-DAT D9 : 43 Digital / 5V / I2C-SDA D10 : 44 Digital / 5V / I2C-SCK / SPI4-CLK D11 : 45 Digital / 5V / SPI1-OUT D0 : 46 Digital / 5V / COUNT C13 : 47 Digital / SPI2-IN C14 : 48 Digital / PWM-1A D1 : 49 Digital / 5V / SPI1-CLK D2 : 50 Digital / 5V / SPI1-IN D3 : 51 Digital / 5V / COUNT D4 : 52 Digital / 5V / COUNT D5 : 53 Digital / 5V / PWM-2A 54 VDD 55 VSS F0 : 56 5V / Console-TX / COM4-TX F1 : 57 Digital / 5V / COM1-RX E0 : 58 Digital / 5V / SSD1963-D0 59 VSS 60 VDD E1 : 61 Digital / 5V / SSD1963-D1 E2 : 62 Digital / 5V / SSD1963-D2 E3 : 63 Digital / 5V / SSD1963-D3 E4 : 64 Digital / 5V / SSD1963-D4 |
||||
WhiteWizzard Guru Joined: 05/04/2013 Location: United KingdomPosts: 2794 |
Thanks Peter, this is brilliant progress In the future, will it be possible to have one HEX file that somehow 'auto-detects' whether 12MHz or 24MHz, OR will you have two hex files from which the 'user' has to select the correct one? Thanks . . .. For everything Micromite visit micromite.org Direct Email: whitewizzard@micromite.o |
||||
matherp Guru Joined: 11/12/2012 Location: United KingdomPosts: 8592 |
I can't think of a way of doing this but am open to any suggestions. I've posted a question on the Microchip forum. |
||||
matherp Guru Joined: 11/12/2012 Location: United KingdomPosts: 8592 |
Thanks to help on the Microchip forum I think I've found a way of doing this but need to wait for my 24MHz Snadpic to prove it. |
||||
WhiteWizzard Guru Joined: 05/04/2013 Location: United KingdomPosts: 2794 |
@matherp That is really good to hear if that is the case. Only thing now is something I recollect kiiid mentioned about only being able to get the full 200MHz speed with the 12MHz and not the 24MHz?? I may have this wrong, but will ask if you think 200MHz is achievable regardless of oscillator used. Also, what is the MZ running at now with a 12MHz osc, and with your port? For everything Micromite visit micromite.org Direct Email: whitewizzard@micromite.o |
||||
WhiteWizzard Guru Joined: 05/04/2013 Location: United KingdomPosts: 2794 |
JUST NOTICED on b5 that CPU accepts any value - probably an area you're working on? For everything Micromite visit micromite.org Direct Email: whitewizzard@micromite.o |
||||
WhiteWizzard Guru Joined: 05/04/2013 Location: United KingdomPosts: 2794 |
Is there a way to find out the current CPU setting without resorting to a C-Function? Thinking that something along the lines of Print MM.CPU could be useful maybe For everything Micromite visit micromite.org Direct Email: whitewizzard@micromite.o |
||||
matherp Guru Joined: 11/12/2012 Location: United KingdomPosts: 8592 |
12MHz can only be used up to 198MHz CPU speed 24MHz can be used up to 200MHz To make the code work with either it makes sense to limit the 24MHz also to 198MHz which is what kiiid has standardised on. Hardly a big difference. I haven't implemented changing the CPU clock speed it is fixed at 198MHz. I'm not sure what the advantage is of having slower speeds on a high end chip - views? |
||||
palcal Guru Joined: 12/10/2011 Location: AustraliaPosts: 1804 |
What kiid actually posted was Paul "It is better to be ignorant and ask a stupid question than to be plain Stupid and not ask at all" |
||||
JohnS Guru Joined: 18/11/2011 Location: United KingdomPosts: 3661 |
Maybe lower clock uses less power? (I'm thinking even users of MZ may sometimes need that, if it does.) John |
||||
matherp Guru Joined: 11/12/2012 Location: United KingdomPosts: 8592 |
Not sure it is going to make much difference. This device will never be suitable for long-term battery power power usage is 135mA at full speed. In sleep mode (clock = 32KHz) it is still 55mA I never understood that post 24MHz can be made to act just like a 12MHz by doubling the clock input divider PLLDIV=2 vs PLLDIV=1. So it can do everything a 12MHz clock can do and things (like 200MHz) that it can't |
||||
JohnS Guru Joined: 18/11/2011 Location: United KingdomPosts: 3661 |
Oh, that's a lot of power (much more than I would have guessed) so probably not then!! Thanks, John |
||||
matherp Guru Joined: 11/12/2012 Location: United KingdomPosts: 8592 |
Update: the answer is no I can make it work for everything except USB. I can measure the raw oscillator frequency against the 32Khz internal RTC and then configure the main oscillator PLL to give the correct output frequency but there is one configuration parameter UPLLFSEL which tells the USB PLL what input frequency it is receiving and that cannot be altered in software. I've tried briefly re-programming the configuration words from within the program but that doesn't seem to do anything but lock up the processor Oh well, I tried |
||||
WhiteWizzard Guru Joined: 05/04/2013 Location: United KingdomPosts: 2794 |
Shame about the oscillator auto detect but thanks for trying. By the way, isn't 55mA in sleep mode a bit excessive? Is it maybe because an inbuilt 'thing' inside the PIC is still turned on? I am 1000% sure you have done all that is necessary, but it just seems a bit too high (would have thought sub 2mA is more realistic). It is not an issue regarding the sleep current - just curious . . . b5 holding out well here - have you come across any known issues yourself with it? Thanks For everything Micromite visit micromite.org Direct Email: whitewizzard@micromite.o |
||||
HankR Senior Member Joined: 02/01/2015 Location: United StatesPosts: 209 |
|
||||
Print this page |