PIC32-EMZ64 Christmas tree lights ?

Started by KeesZagers, March 15, 2016, 02:02:42 PM

Previous topic - Next topic

JohnS

It should be OK - but you may need some setup (and maybe the addresses changed) e.g. to map things into the accessible address space or, er, well, setup LOL.

I have a different MZ board but it's in its bag unless a (at least partial) plib arrives.  (I looked at Harmony but will not accept its licence plus I just hate it.  I've met that sort of rubbish before and it's dead already.)

I suppose a LED blink using no Harmony would be a good start if anyone has one...

(I've got the toolchain and PICkit3 etc.)

John

KeesZagers

Hi John,

OK, I succeeded now to read the CAN CONFIG register. The address is different from the one in the MX controller, but I knew that. The problem was not the reading of the register, but getting it out to the debug output on USB. I forgot to convert the value to a string, like in the sprintf, stupid, stupid. Thanks for encouraging me, that it should work.

I'm going to configure the right I/O pins to the CAN controller and after that see if I can send some messages on the network.

As this is an "evening project" it will take some time, but I will keep the others informed about the progress.

JohnS

Progress - excellent!

Don't beat yourself up about a slip like that as we all make them.
(The local expression here is if you never did owt wrong you never did owt.  Er, "owt" is local word for "anything")

John

Samuel Mauro

hello !
i buy pic32emz64 and i dont now what i do with this module , so i need some  basic tutorial for start.
thanks 

KeesZagers

Welcome to the club Samuel,

My first reaction is if you buy something and you don't know what to do with it: Do you have too much money?

My second reaction: you can download the demo's on Github for the module and the Microchip MPLAB-X and Harmony environments and see how it is built up. At least you can see the hundreds of lines of C-code to get the "Hello World"  :( . Please don't try to debug it, because you will get frustrated like all the others.

My third reaction is my personal expirience with the CAN interface on the module. I still did not succeed in getting it up and running on this module. Communication with the CAN registers is no problem, but I did not succeed in getting the CANbus to the operating mode. This means probably that I do something wrong in configuring the I/O for the CAN Rx and Tx pins, but neither Microchip Harmony nor Olimex demo software is helping me further in this. I hope I will find some time again in the near future to get the module free from dust again and start from scratch.

I would like to know what are the plans of Olimex concerning the PIC32MZ controller in the future. I'm very happy with the PIC32MX hardware, but upgrading to MZ seems to be very complex.

Kees

JohnS

My PIC32MZ is also gathering dust.  If Microchip offer something sane instead of Harmony I'll blow the dust off, meanwhile I've moved on to ARM and other non-MZ chips.

It's crazy - the MZ look good but ruined by Harmony (was anything else so badly named?).  There again, Intel just would not drop the Itanium.  Until they did.

John

kyrk.5

Christmas is coming, shall we make a Christmas tree lights based on this HW? :)

JohnS

Microchip want you to learn Harmony.

Instead, I'm using Raspberry Pi and AW boards.

John

KeesZagers

Interactive Christmas lights, because the switches are functioning.

I guess we should further actualise the status concerning the CAN interfacing in the other discussion, because in there we also have the doubt concerning the hardware.

And John in my opinion we should leave Harmony out of this discussion. We all know now that this Harmony will never be on Broadway. Let us concentrate on the basic instruments (the PIC32MZ) which should have the possibility to produce a good tune with the right musicians.

JohnS

A thought but maybe a way to get CAN is use an SPI module like MCP2515 ones on ebay etc.

(Much easier with Arduino and costs almost nothing, though.)

John

kyrk.5

I just wanted to start analyze the CAN problem, but then I found my old MP3 player project and just changed the interrupt PWM sound generation to DMA based...
I wonder where can I download Jingle Bells :)

But now I will start to check the problem. Only problem is that I do not have any other CAN node. So I guess error frames will soon or later block me. Lets see, maybe the problem does not requires a fully operational CAN bus. Ideally I would use a CAN bus where some frames are sent and received by other nodes or by CANoe. I would try to attach the uC to this bus. When the things are not so ideally, I would try to get two samples of the HW and start to connect them. But this is hard, because there are 2 HW items and 1 SW. It must be flashed always twice to check if it is working. And as long as you are not sure that you can receive a frame, you can not check also the sending of it. Unless some other device can be used to check the bus like some kind of CAN analyzer tool (Vector CANoe or cheaper one) or an oscilloscope.
But let try it and I will see it :)


JohnS

Make each other node an Arduino or RPi.  They work, so you can start with a good CAN system.

Arduino + MCP2515 is very cheap, so are two of them!

John

kyrk.5

I have to think about this:

- Generally a shield with MCP2515 would be ok. I think I would need 2 items. Arduino I have never used, so no way, then I would choose a PIC32 with arduino interface where I can connect the MCP shiled. Raspy I have, but one of them is used as a server, the other one is free. But I would like to have 2 so that I have a CAN bus where 2 nodes are communicating. Here I could attach the PIC32 first as listen only, then as node. Every choice seems to require some new hardware that I have to order, that means shipping time... I had to wait some days or weeks until something arrives from Bulgaria or China.
- Some slightly modified variant would be one PIC32 arduino interface with two MCP shields on it, communicating to itself :) Would be easy to develop because I do not need to program 2 uC.
- Same as previous but I could simply connect the MPC2515 shiled to the PIC32-EMZ :)

- Other solution would be a Vector stuff with CANoe. Maybee I can ask someone to borrow me a CANcaseXL. Time factor is not so critical here, but I am not sure if I can get the HW and SW.

- I could order a second PIC32-EMZ64. I believe that there is no problem with the CAN, maybe the PIC32 is little bit buggy or something like this.

I think the best solution would be if i would just order 2 MCP shields from China and connect them to the PIC32-EMZ (or other PIC32 does not matter)

Heinz

#28
Quote from: JohnS on December 12, 2016, 01:32:11 PM
A thought but maybe a way to get CAN is use an SPI module like MCP2515 ones on ebay etc.

(Much easier with Arduino and costs almost nothing, though.)

John

Having a internal CAN connected to the processor bus has advantages compared with connecting CAN via SPI.
That makes the PIC32 interesting for me.
I don't like CAN controller connected to the SPI bus.


And important as well, the board comes with CAN controller + transceiver + CAN connector,
you only have to connect three wires.

Heinz

Quote from: kyrk.5 on December 12, 2016, 10:25:18 PM
...
Only problem is that I do not have any other CAN node. So I guess error frames will soon or later block me. Lets see, maybe the problem does not requires a fully operational CAN bus.

We would be happy if can reach one simple goal. Initialize the CAN controller and try to send out a frame. With no other node connected you will see the CAN frame on CAN_H and CAN_L repeated for ever.
You only need an oscilloscope to look at it

Heinz