-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adc dma support #2
Conversation
On bluepill STM32F103C6 boards, using Timer5 results in a error() vector call. Switch to 4 since these are both general purpose, 16 bit timers.
Some low end machines doe not have EEPROM support. Simulate it using the last two pages of flash. Flash does not allow rewrite between erases, so skip writing the working version if that's enabled.
This is a work in progress to go hand in hand with the STM32 work.
…e pin enumerations in STM boards vs what marlin expects (i.e, try defining PA0 as a temp pin). The hack can be removed with we go to fastio completely. To see this work, set something in adc_pins to a value like PA0 and connect your pullup resistor'd thermistor.
We have an actual ADC init function now.
Remove the pin mode hack that I was using to init PA0.
Great, let me merge this one right away since it doesn't conflict with anything. I will try to test this later too. |
What is this line for? The SerialUSB should normally be automatically declared as "Serial" if you select the option to include SerialUSB in the board settings. I haven't had to add that line to get communication using USB serial, did you face any problem? |
I thought I deleted it before I committed (I have "Do not commit" markers around other problems unique to my build. I'm sorry. |
Ok I just tried to resolve all the conflicts and merge your changes and the changes upstream from the official Marling. Now I need to try to merge my changes. After that you should probably resync since all together there will be a lot of changes. I'll post once I have uploaded that. Keep your own configuration.h file, I try to avoid that in the uploads since it's specific for each user, but there is a folder with configuration.h example files for the different boards, I added 1 folder for the stmf1ret, if you want to add a folder to the Malyan board and put the config there, we should be able to submit that as a PR to Marlin and get it merged. |
@xC0000005 I am having trouble getting a reading for the TEMP_BED pin. First I had it set to PA0, so I thought perhaps there is a problem with that enum being 0, so I changed to have PA1 as BED, and PA0 as the extruder, and the problem followed to PA1. |
This seems to work fine for me, if you can test.
|
I had the enum exactly like that and for some reason, thought this was unnecessary. When I'm home I'll compile, hook up the thermistor and test. Sorry for the problem. |
No problem, let me know if it works for you. I think we still may have to account for a case in which temp_0 is not defined, in case someone defines temp_bed and temp_1 for example. I still need to make more changes around the timers so the channel are picked automatically depending which are not used for pwm and exist in that mcu version, haven't had time for that yet. I forgot to check, what speed is the adc sampling at the moment?
Get Outlook for Android<https://aka.ms/ghei36>
…________________________________
From: xC0000005 <[email protected]>
Sent: Wednesday, October 4, 2017 8:21:45 PM
To: victorpv/Marlin
Cc: victorpv; State change
Subject: Re: [victorpv/Marlin] Adc dma support (#2)
I had the enum exactly like that and for some reason, thought this was unnecessary. When I'm home I'll compile, hook up the thermistor and test. Sorry for the problem.
—
You are receiving this because you modified the open/close state.
Reply to this email directly, view it on GitHub<#2 (comment)>, or mute the thread<https://github.com/notifications/unsubscribe-auth/AKphQbG3xUnYHFmyTxo0Dvqita1nxpusks5spC8pgaJpZM4PsKBj>.
|
It's working. Given the way enums work, if someone doesn't have a value defined, they should drop out of the list. The result is that if TEMP_0 was not defined, the zero value of the enumeration (and the first entry in the array) would be that referenced by TEMP_1. Any combination should work in this manner. |
Ah - I know what's missing. ADC_PIN_COUNT should be the last enum, always present. Then we size adc_pins based on that. I swear I had that working and decided to "simplify." I should have left it in the working state. |
By the way I alse tested i2c eeprom yesterday and works fine. |
# This is the 1st commit message: Choose the timer based on MCU defintion. Timer5 is not valid on C8/CB class boards, so use Timer4 for the step timer. # This is the commit message #2: Readme.md update # This is the commit message #3: Readme.md update # This is the commit message #4: Trying to get readme.md updated # This is the commit message #5: readme.md update
This adds support for the ADC in DMA mode (I tested by soldering & connecting thermisters/pull up resistors). Longer term, it would make sense for the ADC read functions to be macros that pull the data from the right index in the DMA buffer since the ADC runs in continuous mode and the buffer is always up to date, but this works perfectly well for now.