This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Help needed for keil MCBSTM32 CAN application

Hello,
I'm using Keil MCBSTM32 evaluation board and µVision3.
I use the example CAN program downloaded from keil. My application will be to use an external rotational transducer (instead of the potentiometer on the board) to send converted analog value in CAN message.
Which code should i change/add so that i could use the transducer (at port A chan 0 for example) instead PA ch 1 of the pot? I've read the reference manual from ST but i didn't see any indication telling which registers correspond to which channel to use.
Thank you in advance.

Parents
  • In STM32's control register they're ADC_CR1 et ADC_CR2:

    In CanDemo.c:

      ADC1->CR1   =  0x00000100; // use independant mode, SCAN mode
    

      ADC1->CR2   =  0x000E0003; // data align right, cont conversion
    

    In ADC_CR1 however there's AWDCH[4:0]: Analog watchdog channel select bits. Is that it? i dont wanna use watchdog though.

    Thanx!

Reply
  • In STM32's control register they're ADC_CR1 et ADC_CR2:

    In CanDemo.c:

      ADC1->CR1   =  0x00000100; // use independant mode, SCAN mode
    

      ADC1->CR2   =  0x000E0003; // data align right, cont conversion
    

    In ADC_CR1 however there's AWDCH[4:0]: Analog watchdog channel select bits. Is that it? i dont wanna use watchdog though.

    Thanx!

Children