Do the can messages look okay in the canDispatch function (states.c) On Thu, Dec 13, 2018 at 7:30 PM <canfestival-devel@lists.sourceforge.net> wrote: > > That's the strange thing. > > The node doesn't react to any message sent > > ----Messaggio originale---- > Da: canfestival-devel@lists.sourceforge.net > Data: 13-dic-2018 18.04 > A: <canfestival-devel@lists.sourceforge.net> > Ogg: Re: [Canfestival-devel] R: Re: R: R: R: R: R: R: R: R: R: Re: R: Re: R: > Re: CanFestival on ATmega64M1 in Arduino IDE > > Strange, > You should get a reply on "all" sdo messages > Does the node react to any messages you send to the node? > > > > > > > On Thu, Dec 13, 2018 at 10:57 AM > <canfestival-devel@lists.sourceforge.net> wrote: > > > > PDOs every 100ms are running correctly. > > > > The issue remaining is the response from the node. > > > > For instance if I wish to change the event cycle for the PDO from 100ms to > > 70 ms I need to write on the bus: > > > > nodeID 2Bh 00h 18h 05h 46h 00h 00h 00h > > > > where nodeID is 600+ID and in my case is 601 > > > > Normally when you send something on the canbus you get a response from the > > node that depends if the object dictionary element is implemented in the > > dictionary. > > > > In my case I don't get any reply from the node. > > > > I don't know why > > > > > > ----Messaggio originale---- > > Da: canfestival-devel@lists.sourceforge.net > > Data: 13-dic-2018 10.07 > > A: <canfestival-devel@lists.sourceforge.net> > > Ogg: Re: [Canfestival-devel] R: R: R: R: R: R: R: R: R: Re: R: Re: R: Re: > > CanFestival on ATmega64M1 in Arduino IDE > > > > so, everything is up and running? > > > > On Wed, 12 Dec 2018, 16:17 < canfestival-devel@lists.sourceforge.net wrote: > >> > >> Ok, > >> > >> solved with > >> > >> // CANIE1 = 0x7F; // Enable the interrupts of all MObs (0..14) > >> // CANIE2 = 0xFF; > >> CANIE2 = 0x3F; // Enable the interrupts of all MObs (0..5) edited for > >> ATmegaxxM1 > >> > >> in the can_AVR.c file > >> > >> ----Messaggio originale---- > >> Da: canfestival-devel@lists.sourceforge.net > >> Data: 12-dic-2018 11.49 > >> A: < canfestival-devel@lists.sourceforge.net> > >> Ogg: [Canfestival-devel] R: R: R: R: R: R: R: R: Re: R: Re: R: Re: > >> CanFestival on ATmega64M1 in Arduino IDE > >> > >> > >> the Atmega64M1 has only 6 Mobs instead of 15 of AT90CAN128. > >> > >> So I need to change some #define in the can_drv.h file > >> > >> // #define NB_MOB 15 > >> #define NB_MOB 6 // edited for ATmegaxxM1 > >> #define NB_DATA_MAX 8 > >> #define LAST_MOB_NB (NB_MOB-1) > >> #define NO_MOB 0xFF > >> // ---------- > >> //typedef enum { > >> // MOB_0, MOB_1, MOB_2, MOB_3, MOB_4, MOB_5, MOB_6, MOB_7, > >> // MOB_8, MOB_9, MOB_10, MOB_11, MOB_12, MOB_13, MOB_14 } > >> can_mob_t; > >> typedef enum {MOB_0, MOB_1, MOB_2, MOB_3, MOB_4, MOB_5} can_mob_t;// > >> edited for ATmegaxxM1 > >> > >> > >> > >> ----Messaggio originale---- > >> Da: canfestival-devel@lists.sourceforge.net > >> Data: 12-dic-2018 11.33 > >> A: < canfestival-devel@lists.sourceforge.net> > >> Ogg: [Canfestival-devel] R: R: R: R: R: R: R: Re: R: Re: R: Re: > >> CanFestival on ATmega64M1 in Arduino IDE > >> > >> Sorry my mistake, > >> > >> the number of PDO sent after the operational mode is, of course, equal to > >> NB_TX_MOB = (NB_MOB - NB_RX_MOB) > >> > >> ----Messaggio originale---- > >> Da: canfestival-devel@lists.sourceforge.net > >> Data: 12-dic-2018 10.58 > >> A: < canfestival-devel@lists.sourceforge.net> > >> Ogg: [Canfestival-devel] R: R: R: R: R: R: Re: R: Re: R: Re: CanFestival > >> on ATmega64M1 in Arduino IDE > >> > >> Hi, > >> after some proofs I found another issue on the ATmega64M1. > >> > >> Basically and actually I'm able to receive only some PDOs at the beginning > >> (after the operational mode). > >> The number of PDOs receive is based on the NB_RX_MOB define. > >> So if I define NB_RX_MOB = 3 I receive only 3 PDO after the operational > >> mode, if I define it = 6 I receive only 6 PDOs. > >> > >> After that the canbus goes in a sort of stuck mode and I need a master > >> reset to resume the node. > >> > >> The timer1 works properly just adding these instructions: > >> > >> /* Added by me for Arduino compliance */ > >> TCCR1A = 0; > >> TCCR1B = 0; > >> TIMSK1 = 0; > >> /**************************************/ > >> > >> in the timer_AVR.c > >> > >> Any suggestion? > >> > >> Thanks in advance > >> > >> ----Messaggio originale---- > >> Da: canfestival-devel@lists.sourceforge.net > >> Data: 11-dic-2018 16.01 > >> A: < canfestival-devel@lists.sourceforge.net> > >> Ogg: [Canfestival-devel] R: R: R: R: R: Re: R: Re: R: Re: CanFestival on > >> ATmega64M1 in Arduino IDE > >> > >> I've found the issue and it was relative to the TCCR1A value. > >> > >> Arduino touches this timer at the beginning in the wiring.c file. > >> > >> Then actually the timer works but I can receive only five PDO after the > >> startup. > >> > >> After that the CANBUS seems stuck and I don't receive PDO anymore. > >> > >> The only way is to make a master reset in order to receive other 5 PDO. > >> > >> ----Messaggio originale---- > >> Da: canfestival-devel@lists.sourceforge.net > >> Data: 11-dic-2018 12.21 > >> A: < canfestival-devel@lists.sourceforge.net> > >> Ogg: [Canfestival-devel] R: R: R: R: Re: R: Re: R: Re: CanFestival on > >> ATmega64M1 in Arduino IDE > >> > >> hello, > >> I found a strange bug with setting 16bit registers. > >> > >> I tried to set 16 bit register OCR1B, but only the lower 8 bits were > >> applied. > >> > >> The datasheet says that for OCR1B you have to first set the upper byte as > >> documented, and afterwards commit with the lower byte. > >> this however does not work for me. > >> > >> > >> ----Messaggio originale---- > >> Da: canfestival-devel@lists.sourceforge.net > >> Data: 11-dic-2018 11.30 > >> A: < canfestival-devel@lists.sourceforge.net> > >> Ogg: [Canfestival-devel] R: R: R: Re: R: Re: R: Re: CanFestival on > >> ATmega64M1 in Arduino IDE > >> > >> Hi, > >> something strange compare if I try to debug the TCNT1 and OCR1B values. > >> > >> Why I get only values from 0 to 255? > >> > >> The timer1 is a 16bit timer > >> > >> ??????????????????? > >> > >> ----Messaggio originale---- > >> Da: canfestival-devel@lists.sourceforge.net > >> Data: 11-dic-2018 10.04 > >> A: < canfestival-devel@lists.sourceforge.net> > >> Ogg: [Canfestival-devel] R: R: Re: R: Re: R: Re: CanFestival on ATmega64M1 > >> in Arduino IDE > >> > >> Hi, > >> > >> probably the issue is that for the ATmega64M1 I have to use the TIMER1 in > >> CTC mode up to OCR1A as top value? > >> > >> ----Messaggio originale---- > >> Da: canfestival-devel@lists.sourceforge.net > >> Data: 11-dic-2018 9.12 > >> A: < canfestival-devel@lists.sourceforge.net> > >> Ogg: [Canfestival-devel] R: Re: R: Re: R: Re: CanFestival on ATmega64M1 in > >> Arduino IDE > >> > >> I'm using 8MHz external clock. > >> > >> Timer should be 8us per tick since that I'm using the clkio/64 prescaler. > >> > >> So the timing frequency is, or I suppose, 125Khz --> 8us. > >> > >> // The timer is incrementing every 8 us. > >> #define MS_TO_TIMEVAL(ms) ((ms) * 125) > >> #define US_TO_TIMEVAL(us) ((us)>>3) > >> > >> This definition seems to be correct because each timer tick = 8us. > >> > >> In order to have us we have to divide the tick count value by 8 (>>3) > >> instead to have ms we have to multiply by 125. > >> > >> It seems exact. > >> > >> Why you told me that this define are incorrect? > >> > >> > >> > >> > >> ----Messaggio originale---- > >> Da: canfestival-devel@lists.sourceforge.net > >> Data: 10-dic-2018 20.58 > >> A: < canfestival-devel@lists.sourceforge.net> > >> Ogg: Re: [Canfestival-devel] R: Re: R: Re: CanFestival on ATmega64M1 in > >> Arduino IDE > >> > >> This I should be able to help you with > >> in timerscfg.h there are two macros that need to be correct > >> MS_TO_TIMEVAL and US_TO_TIMEVAL > >> > >> They are used to convert ms and us to timer ticks (TIMEVAL) > >> > >> What clock frequency are you using? > >> On Mon, Dec 10, 2018 at 3:13 PM < canfestival-devel@lists.sourceforge.net> > >> wrote: > >> > > >> > Hi, > >> > > >> > the issue seems relative to the timer event. > >> > > >> > If I program a transmist PDO every 100ms I can see at the beginning some > >> > PDO every 1 or 2 ms. > >> > > >> > After that the CANNUS stacks and I cannot receive PDOs anymore up to a > >> > new uC master reset, so a new canbus initialization process. > >> > > >> > Basically the timer_AVR.c file is exactly equal to the original one > >> > (for the at90can128) except in the initTimer function where I use the > >> > timer1 because the ATmega64M1 doesn't have the timer3 > >> > > >> > void initTimer(void) > >> > /****************************************************************************** > >> > Initializes the timer, turn on the interrupt and put the interrupt time > >> > to zero > >> > INPUT void > >> > OUTPUT void > >> > ******************************************************************************/ > >> > { > >> > TimerAlarm = 0; // Set it back to the zero > >> > > >> > // Set timer 1 for CANopen operation tick 8us max, time is 524ms > >> > TCCR1B = (1 << CS11) | (1 << CS10); // Timer 1 normal, mit CK/64 > >> > TIMSK1 = 1 << OCIE1B; // Enable the interrupt > >> > } > >> > > >> > Any comment/suggestion? > >> > > >> > Thanks in advance > >> > > >> > ----Messaggio originale---- > >> > Da: canfestival-devel@lists.sourceforge.net > >> > Data: 6-dic-2018 21.04 > >> > A: < canfestival-devel@lists.sourceforge.net> > >> > Ogg: Re: [Canfestival-devel] R: Re: CanFestival on ATmega64M1 in Arduino > >> > IDE > >> > > >> > Hi, > >> > I do not have access to a ATmega64M1, so there is no way AFIK for me > >> > to run and debug your code. > >> > Also near zero experience with Arduino, lots of experience with > >> > at90can128 though. > >> > > >> > I could always look at your code, but without knowing the general > >> > place where the problem is, it is close to impossible... for me :) > >> > > >> > When you say that only thing that is working is THE nmt message. > >> > Is there only one nmt message? > >> > What nmt state is the node in? > >> > Have you tried to set it to operational state? > >> > > >> > Best Regards > >> > Lars > >> > On Tue, Dec 4, 2018 at 5:26 PM < > >> > canfestival-devel@lists.sourceforge.net> wrote: > >> > > > >> > > The only thing which is working is the NMT message at the startup. > >> > > > >> > > No SDO response and I cannot able to make debug now. > >> > > > >> > > Can I attach the whole directory project which stay in the > >> > > Arduino/libraries folder to give you the whole files package? > >> > > > >> > > Thanks > >> > > > >> > > Bye > >> > > > >> > > Alessio > >> > > > >> > > ----Messaggio originale---- > >> > > Da: canfestival-devel@lists.sourceforge.net > >> > > Data: 3-dic-2018 17.52 > >> > > A: < canfestival-devel@lists.sourceforge.net> > >> > > Ogg: Re: [Canfestival-devel] CanFestival on ATmega64M1 in Arduino IDE > >> > > > >> > > Hi, > >> > > Does anything work? > >> > > Like heartbeat or sdo? > >> > > > >> > > could you check if the code reaches buildPDO? > >> > > > >> > > Best Regards > >> > > Lars > >> > > > >> > > On Sat, Dec 1, 2018 at 6:02 PM < > >> > > canfestival-devel@lists.sourceforge.net> wrote: > >> > > > > >> > > > > >> > > > Dear all, > >> > > > > >> > > > first of all many thanks to the developers and people in general > >> > > > that spent time on this project making it an affordable CanOpen > >> > > > platform for everyone. > >> > > > > >> > > > I'm new on this mailing list and here to explain my problem. > >> > > > > >> > > > I'm an electronic engineer and a researcher of University of Brescia > >> > > > (Italy) and I'm trying to make the canFestival working on Arduino > >> > > > using the Atmega64M1 uC. > >> > > > > >> > > > I know that there is the CanFestivino project that is the > >> > > > CanFestival porting for the Arduino IDE and the Atmega328p with the > >> > > > external controller MCP2515. > >> > > > > >> > > > It works but the guy that makes the porting cut several features to > >> > > > fit the code with the Atmega328 ROM and RAM. > >> > > > > >> > > > I reached it compilable in Arduino starting from the AVR example for > >> > > > the ATCAN90128. This uC is very similar to the ATmega64M1. > >> > > > > >> > > > The only things that I did was to change the timer, from timer3 to > >> > > > timer1 (timer3 is not present on the ATmega64M1) and some tiny > >> > > > modifications in the CAN driver. > >> > > > > >> > > > Actually my project is compilable in Arduino where I created an > >> > > > example to read an analog input (A0) sending it through a PDO each > >> > > > 100ms. > >> > > > > >> > > > The only thing to need in order to compile it is the Arduino IDE > >> > > > support files for CAN enabled Amtel AVR chips: ATmega64M1, > >> > > > ATmega32M1, ...HERE. > >> > > > > >> > > > I cannot figure out why but actually the example doesn't work and > >> > > > I'm struggling on it....making me a bit crazy because I don't > >> > > > understand why. > >> > > > > >> > > > > >> > > > > >> > > > Hope that someone can help me in this.... > >> > > > > >> > > > Thanks > >> > > > > >> > > > Alessio > >> > > > _______________________________________________ > >> > > > Canfestival-devel mailing list > >> > > > Canfestival-devel@lists.sourceforge.net > >> > > > https://lists.sourceforge.net/lists/listinfo/canfestival-devel > >> > > > >> > > > >> > > _______________________________________________ > >> > > Canfestival-devel mailing list > >> > > Canfestival-devel@lists.sourceforge.net > >> > > https://lists.sourceforge.net/lists/listinfo/canfestival-devel > >> > > > >> > > > >> > > _______________________________________________ > >> > > Canfestival-devel mailing list > >> > > Canfestival-devel@lists.sourceforge.net > >> > > https://lists.sourceforge.net/lists/listinfo/canfestival-devel > >> > > >> > > >> > _______________________________________________ > >> > Canfestival-devel mailing list > >> > Canfestival-devel@lists.sourceforge.net > >> > https://lists.sourceforge.net/lists/listinfo/canfestival-devel > >> > > >> > > >> > _______________________________________________ > >> > Canfestival-devel mailing list > >> > Canfestival-devel@lists.sourceforge.net > >> > https://lists.sourceforge.net/lists/listinfo/canfestival-devel > >> > >> > >> _______________________________________________ > >> Canfestival-devel mailing list > >> Canfestival-devel@lists.sourceforge.net > >> https://lists.sourceforge.net/lists/listinfo/canfestival-devel > >> > >> > >> > >> > >> > >> > >> > >> > >> > >> > >> > >> > >> > >> > >> > >> > >> > >> > >> _______________________________________________ > >> Canfestival-devel mailing list > >> Canfestival-devel@lists.sourceforge.net > >> https://lists.sourceforge.net/lists/listinfo/canfestival-devel > > > > > > > > _______________________________________________ > > Canfestival-devel mailing list > > Canfestival-devel@lists.sourceforge.net > > https://lists.sourceforge.net/lists/listinfo/canfestival-devel > > > _______________________________________________ > Canfestival-devel mailing list > Canfestival-devel@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/canfestival-devel > > > _______________________________________________ > Canfestival-devel mailing list > Canfestival-devel@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/canfestival-devel
_______________________________________________ Canfestival-devel mailing list Canfestival-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/canfestival-devel