bidirectional pin config
Moderators: RoccoMarco, lbednarz, tfAteba
bidirectional pin config
Is there an option to use bidirectional pins with the pal driver? Other I need to abandon the KS0108(oldies).
- Giovanni
- Site Admin
- Posts: 14895
- Joined: Wed May 27, 2009 8:48 am
- Has thanked: 1202 times
- Been thanked: 997 times
Re: bidirectional pin config
Using palSetPadMode() or palSetPortMode() you can reconfigure pins on the fly (input/output). Another way is to use open-drain outputs with pullups.
It depends on what you need to do exactly.
Giovanni
It depends on what you need to do exactly.
Giovanni
Re: bidirectional pin config
Tnx Giovanni,
Apparently the KS0108 must read busy state at the data pins. So it's reconfiguring on the fly of the data pins.
Apparently the KS0108 must read busy state at the data pins. So it's reconfiguring on the fly of the data pins.
Re: bidirectional pin config
Are you already using the µGFX library? If so this is what you would do at the beginning of the read_data() and write_data() functions in your board file.
The ChibiOS/HAL API allows you to define a bus group. This would allow you to easily change the configs of all the relevant pins.
~ Tectu
The ChibiOS/HAL API allows you to define a bus group. This would allow you to easily change the configs of all the relevant pins.
~ Tectu
Re: bidirectional pin config
Hi Tectu,
I'm using uGFX. The KS0108 is in mho verry expensive on pins. It works with palSetPadMode() but it's sloppy(I mean cumberson) and STM32 doesn't support DMA on its GPIO. I have a board file for the KS0108 in "boards/addons/gdisp/" but it requires specific functions like EnableController() and DisableController() were you need to give the relevant controller(CS1-CS3) as an argument.
I'm using uGFX. The KS0108 is in mho verry expensive on pins. It works with palSetPadMode() but it's sloppy(I mean cumberson) and STM32 doesn't support DMA on its GPIO. I have a board file for the KS0108 in "boards/addons/gdisp/" but it requires specific functions like EnableController() and DisableController() were you need to give the relevant controller(CS1-CS3) as an argument.
Re: bidirectional pin config
Hello JoVM,
It is common with these parallel bus interfaces that you have to switch the pin directions. That is why I recommended you to use the ChibiOS/HAL pal grouping feature. You can look at this board file. The thing that made it easy here is that all 16 pins of the LCD data bus are on one port of the STM32. This board file on the other hand shows you how to define a bus composed of arbitrary pins.
You should try to keep all the driver specific stuff like EnableController() inside the driver file and only have the actual hardware interface in the board file. This will save you a lot of trouble.
If you want you can post your code on the uGFX forum and I will have a look. I am happy to help where I can!
~ Tectu
It is common with these parallel bus interfaces that you have to switch the pin directions. That is why I recommended you to use the ChibiOS/HAL pal grouping feature. You can look at this board file. The thing that made it easy here is that all 16 pins of the LCD data bus are on one port of the STM32. This board file on the other hand shows you how to define a bus composed of arbitrary pins.
You should try to keep all the driver specific stuff like EnableController() inside the driver file and only have the actual hardware interface in the board file. This will save you a lot of trouble.
If you want you can post your code on the uGFX forum and I will have a look. I am happy to help where I can!
~ Tectu