Giter Club home page Giter Club logo

Comments (13)

neu-rah avatar neu-rah commented on May 8, 2024

that error means that the AVR_ATmega1284 is not defined at compile time... maybe it is lacking a terminal p, try with AVR_ATmega1284P instead
and let me know if the code works so that we can include it into the lib

from arduinomenu.

benovitch avatar benovitch commented on May 8, 2024

Well I think I found a sollution.
I have changed the following in the PCINT.h file:

#if ( defined(__AVR_ATmega328__) || defined(__AVR_ATmega328P__) || defined(__AVR_ATmega16u4__) )
    const uint8_t PROGMEM pcintPinMap[4][8]={{8,9,10,11,12,13,-1,-1},{A0,A1,A2,A3,A4,A5,-1,-1},{0,1,2,3,4,5,6,7},{-1,-1,-1,-1,-1,-1,-1,-1}};
#elif ( defined(__AVR_ATmega2560__) )
    const uint8_t PROGMEM pcintPinMap[4][8]={{53,52,51,50,10,11,12,13},{0,15,14,-1,-1,-1,-1,-1},{A8,A9,A10,A11,A12,A13,A14,A15},{-1,-1,-1,-1,-1,-1,-1,-1}};
#elif ( defined(__AVR_ATmega1284P__) || defined(__AVR_ATmega644__))
    const uint8_t PROGMEM pcintPinMap[4][8]={{A0,A1,A2,A3,A4,A5,A6,A7},{0,1,2,3,4,5,6,7},{16,17,18,19,20,21,22,23},{8,9,10,11,12,13,14,15}};
#else
    #error "uC PCINT REVERSE MAP IS NOT DEFINED"
#endif

#define digitalPinFromPCINTSlot(slot,bit) pgm_read_byte(pcintPinMap+(((slot)<<4)+(bit)))
#define pcintPinMapBank(slot) ((uint8_t*)((uint8_t*)pcintPinMap+((slot)<<4)))
#define digitalPinFromPCINTBank(bank,bit) pgm_read_byte((uint8_t*)bank+bit)

It compilles but I still need to test it on the chip itself.

Ben

from arduinomenu.

benovitch avatar benovitch commented on May 8, 2024

Well I tried to run my code and unfortunatley it doesn't work. When I attach the encoder to D2 and D3 or D8 and D9 the chip seems to reset itself. On other digital pins I get no response. Maybe I did something wrong on the PCINT.h file.
I added my sketch.

EDF_Testbank_menu.zip

from arduinomenu.

neu-rah avatar neu-rah commented on May 8, 2024

try making port B the first port (you can leave the rest as -1 for now, just for testing), and of coz wire the encoder to portB pins

from arduinomenu.

benovitch avatar benovitch commented on May 8, 2024

Tested with only the B ports in the PCINT file. No succes on this side. I only got response on the pins D2 and D3. But then the board resets itself.

from arduinomenu.

neu-rah avatar neu-rah commented on May 8, 2024

on the above pin map "PROGMEM pcintPinMap[4][8]" there should be ONLY 3 bytes defined, as this code derives from atmega328p code and event tables support only 3 port.
then, what board definition are you using? and what IDE?
looking on the net i saw several pin numbering for the atmega1284p, the board definition maps arbitrary numbers over port pins... so board definition is crucial.
original maps define port B,C,D pins to the board defined pin number, should preserve this port order because of the PCINT port handler vectors

from arduinomenu.

benovitch avatar benovitch commented on May 8, 2024

I tried "PROGMEM pcintPinMap[4][8]" as well as PROGMEM pcintPinMap[3][8]". With the B pins first and all the rest -1.
I'm woorking with the 1.6.9 IDE. I'm using the board definitions from this link: https://github.com/JChristensen/mighty-1284p/tree/v1.6.3
I'm using the Bobuino variant.

from arduinomenu.

neu-rah avatar neu-rah commented on May 8, 2024

const uint8_t PROGMEM pcintPinMap[3][8]={{21,20,19,18,17,16,15,14},{4,5,6,7,10,11,12,13},{22,23,24,25,26,27,28,29}};

can you check this?

based on:
home/Sketchbook/hardware/mighty-1284p/avr/variants/bobuino/pins_arduino.h
home/Sketchbook/hardware/mighty-1284p/avr/variants/bobuino/pins.ods

from arduinomenu.

benovitch avatar benovitch commented on May 8, 2024

Well I've tested your input. With the Bobuino board I can't get it to work. I instaled the Uno Pro files in the \Arduino\hardware\arduino\avr\variants folder that i got from the vendors page: http://www.hobbytronics.co.uk/arduino-uno-pro-1284p It seems for now that I only can use the Analog pins to work with the encoder.

from arduinomenu.

neu-rah avatar neu-rah commented on May 8, 2024

const uint8_t PROGMEM pcintPinMap[3][8]={{21,20,19,18,17,16,15,14},{4,5,2,3,10,11,12,13},{22,23,24,25,26,27,28,29}};

extracted from the pins_arduino.h file downloaded from that link, mapping for the Uno*Pro board...

from arduinomenu.

neu-rah avatar neu-rah commented on May 8, 2024

I have created this sketch that can be used on any arduino like board and print out to Serial the c++ definition of board pin map

https://github.com/neu-rah/PCINT/tree/master/examples/mkPCIntMap

from arduinomenu.

benovitch avatar benovitch commented on May 8, 2024

Thanks for the help on the issue. Now the scroling true the menu works. But the selection of the menu item doesn't work. Its like the arduino doesn't rec the pushbutton. I ve tested the button in another sketch en the hardware works. When i touch the knob the screen begins to flicker.

from arduinomenu.

neu-rah avatar neu-rah commented on May 8, 2024

what output device are you using? I've just pushed some corrections on the LCD driver to deal with PROGMEM (was causing resets)

can you open this as other issue? it helps further users

from arduinomenu.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.