Menu

Issues with serial port(s) on Mega162

2021-10-08
2021-10-09
  • Bertrand BAROTH

    Bertrand BAROTH - 2021-10-08

    This progam runs ...

     
  • Bertrand BAROTH

    Bertrand BAROTH - 2021-10-08

    This one does not. The only modifications were made in lines 6 and 7. Inserting "test" instructions shows that locking occurs line 114. I used the newest compiler, downloaded June 19th.

     

    Last edit: Bertrand BAROTH 2021-10-08
  • Anobium

    Anobium - 2021-10-08

    Does this resolve? Add and test.

    #DEFINE USART1_BAUD_RATE USART_BAUD_RATE
    #DEFINE USART1_BLOCKING  USART_BLOCKING
    

    The issue is that USART1_BAUD_RATE is not valid, there, for the serial is not being setup. Adding those two defines may resolve. Maybe we should add USART1_BAUD_RATE (and the others) to make this compatible with USART2_BAUD_RATE.

     
  • Bertrand BAROTH

    Bertrand BAROTH - 2021-10-08

    Here is the new version ... and it does not work. And this trick could not solve my problem, because I wanna in a near future use UART2, too (otherwise a 8515 would be satisfying) ... And I can add that I tested the same algorithm, written in MikroPascal, with the same processor : it worked, so the processor is not defective.

     
  • Anobium

    Anobium - 2021-10-08

    Please compile without comments in the ASM. Test.

     
  • Anobium

    Anobium - 2021-10-08

    Please update the .h attached. Test.

     
  • Bertrand BAROTH

    Bertrand BAROTH - 2021-10-08

    Now with the bew usart.h the initial version of V3_2 works, even with comments in ASM ; now I will test if it works with UART2, too.

     
  • Anobium

    Anobium - 2021-10-08

    Excellent.

    The root cause is:

    Users may wish to define USART1_BAUD_RATE to use USART 1 as this makes logical sense in the context that USART2_BAUD_RATE, USART3_BAUD_RATE etc exist, But, all the USART1 methods() use USART_BAUD_RATE - so, if USART_BAUD_RATE is not defined then USART1 is not operational.

    Fix:

    If users define USART1_BAUD_RATE the updated usart.h library has a script that will automatically create the correct CONSTANTs for USART1.

     
  • Bertrand BAROTH

    Bertrand BAROTH - 2021-10-08

    Here is the final version : IT WORKS ; it should allow voice control for my railroad layout, using Elechouse's V3 voice recognition and AdaFruit's Sound FX sample player for feedback, these seem to work fine ... at least on the bench ! Now I must "embed" this into my console, and this will need some amount of time (I am presently working on the landscape). But prior to this I will test again the SimpleVR recognition, it should be speaker independent (V3 is speaker dependent and training is a bit finicky), hope it is not too sensitive to background noise : even when no train is running there are the motors of the fun fair.

     

    Last edit: Bertrand BAROTH 2021-10-08
  • Bertrand BAROTH

    Bertrand BAROTH - 2021-10-09

    Meanwhile I got and tested the SimpleVR module : it is very sensitive to "external" expressions which can trigger unwanted commands, and so maybe to some ambient noise ! But I noticed that this can be solved with an appropriate mike, and that the recognition process is reliable with a carefully chosen "vocabulary". Again, it cannot be used by children/youngsters who would try "external" vocabularies to test, and then would say that the system can't be compared with their "super" Siri or Alexa ! :(

     

    Last edit: Bertrand BAROTH 2021-10-13

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.