Post Reply 
PX41CX
06-07-2023, 04:27 PM (This post was last modified: 06-07-2023 04:47 PM by goosnarrggh.)
Post: #38
RE: PX41CX
(11-02-2022 05:18 AM)Sylvain Cote Wrote:  
(11-02-2022 02:43 AM)agarza Wrote:  Currently, the only way to add modules to the PX41CX is to flash them along with the firmware.
Are you sure ?

From what I am reading ...
1) the maximum directly Flash addressing space is 16 bits or 64 KB
2) the first 32KB is reserved for code, divided between boot code and app code while the second 32KB is reserved for data
3) of the 128KB Flash
3a) the first 32KB is reserved for code (mapped into the direct addressing space)
3b) and the last 96KB can be divided into three 32KB data blocks of which one can be mapped into the direct addressing space.
4) you also have three USART that can be used for RS232 transmission

So with code, you could come with a scheme that allows data transfer (ROM images) transfer over the serial interface and store the data into one of the three 32KB data pages.
You could then map a data page containing the ROMs into the address space. For sure it will be a little more complicated than that, but it seems doable.
Remember, the AVR is a Harvard architecture machine. It has two separate addressing spaces, one for fetching instructions, and the other for fetching/storing data. The Flash is mapped simultaneously into both address spaces via asymmetrical means. When it is accessed as program memory, it is addressed as an array of 16-bit words; when it is accessed as data memory, it is addressed as an array of 8-bit bytes.

Direct program memory addressing (via the JMP/CALL instructions) is able to directly access a theoretical maximum 22-bit address space, yielding a maximum of 4MiWords, or 8MiB. However, I am not aware of any AVR devices ever having been built which more than 256kiB of Flash.

Indirect program memory access is more limited; the IJMP and ICALL instructions are linked to the Z pointer register, which is 16-bits wide. Thus (unless page switching is employed) they are only able to address a maximum of 64kiWords, or 128kiB. For parts with 128kiB of flash or less, IJMP and ICALL are thus also able to reach the entire Flash memory without the need for page switching. However, page switching (via the RAMPZ register) is added in parts with larger amounts of Flash.

The entirety of Flash can also be indirectly treated as Data memory, using the LPM instruction, which (unlike when Flash is accessed as Program memory) actually addresses the Flash in terms of bytes instead of words. It also fetches data from Flash via the 16-bit Z pointer. Thus, page switching (via the RAMPZ register) is included to allow data to be fetched from Flash addresses above the 64kiB boundary.

One innovation in more recent AVR designs is the ability to also *directly* address Flash as data, by mapping a programmable 32kiB block of it into the direct addressing data space, where the full suite of direct and indirect addressing modes (normally used to access data in RAM) can also be used to access information within whichever 32kiB block of Flash is currently mapped into that space.

But mapping any given 32kiB subset block of Flash into the data address space does NOT take away from the WHOLE of flash always being accessible as program memory.
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
PX41CX - agarza - 10-29-2022, 07:58 PM
RE: PX41CX - Massimo Gnerucci - 10-29-2022, 09:05 PM
RE: PX41CX - Liam Hays - 10-31-2022, 01:50 PM
RE: PX41CX - SammysHP - 10-31-2022, 03:53 PM
RE: PX41CX - agarza - 11-01-2022, 01:50 AM
RE: PX41CX - johnb - 10-31-2022, 07:05 PM
RE: PX41CX - agarza - 11-01-2022, 01:44 AM
RE: PX41CX - Massimo Gnerucci - 10-31-2022, 07:16 PM
RE: PX41CX - Jlouis - 11-02-2022, 01:19 AM
RE: PX41CX - agarza - 11-02-2022, 02:43 AM
RE: PX41CX - Jlouis - 11-02-2022, 03:08 AM
RE: PX41CX - Sylvain Cote - 11-02-2022, 05:18 AM
RE: PX41CX - J-F Garnier - 11-02-2022, 08:29 AM
RE: PX41CX - Sylvain Cote - 11-02-2022, 02:49 PM
RE: PX41CX - J-F Garnier - 11-02-2022, 03:50 PM
RE: PX41CX - agarza - 11-02-2022, 06:48 PM
RE: PX41CX - rprosperi - 11-02-2022, 08:11 PM
RE: PX41CX - agarza - 11-02-2022, 10:17 PM
RE: PX41CX - goosnarrggh - 06-07-2023 04:27 PM
RE: PX41CX - goosnarrggh - 06-07-2023, 05:37 PM
RE: PX41CX - agarza - 06-07-2023, 09:38 PM
RE: PX41CX - Eric Rechlin - 06-08-2023, 02:12 AM
RE: PX41CX - toml_12953 - 11-04-2022, 03:58 AM
RE: PX41CX - Jlouis - 11-04-2022, 06:23 AM
RE: PX41CX - TomC - 11-04-2022, 02:19 PM
RE: PX41CX - agarza - 11-19-2022, 04:53 PM
RE: PX41CX - TomC - 11-19-2022, 06:00 PM
RE: PX41CX - TomC - 11-19-2022, 06:02 PM
RE: PX41CX - agarza - 11-19-2022, 08:20 PM
RE: PX41CX - Sylvain Cote - 11-20-2022, 02:25 AM
RE: PX41CX - agarza - 11-20-2022, 02:54 PM
RE: PX41CX - anetzer - 06-06-2023, 05:53 PM
RE: PX41CX - agarza - 06-06-2023, 06:24 PM
RE: PX41CX - Liam Hays - 11-20-2022, 05:15 PM
RE: PX41CX - agarza - 11-20-2022, 07:30 PM
RE: PX41CX - grbrum - 06-05-2023, 06:07 PM
RE: PX41CX - agarza - 06-06-2023, 04:37 PM
RE: PX41CX - rprosperi - 06-06-2023, 10:51 PM
RE: PX41CX - agarza - 06-07-2023, 02:20 AM
RE: PX41CX - rprosperi - 06-07-2023, 11:39 AM
RE: PX41CX - agarza - 06-07-2023, 04:33 PM
RE: PX41CX - goosnarrggh - 06-07-2023, 05:24 PM
RE: PX41CX - agarza - 06-07-2023, 09:32 PM
RE: PX41CX - goosnarrggh - 06-07-2023, 09:40 PM
RE: PX41CX - agarza - 06-07-2023, 10:35 PM
RE: PX41CX - goosnarrggh - 06-08-2023, 01:06 AM
RE: PX41CX - goosnarrggh - 06-08-2023, 11:48 AM
RE: PX41CX - rprosperi - 06-07-2023, 09:02 PM
RE: PX41CX - agarza - 06-07-2023, 09:57 PM
RE: PX41CX - thenozone - 06-06-2023, 05:36 PM
RE: PX41CX - revwillie - 06-11-2023, 04:10 PM
RE: PX41CX - agarza - 06-11-2023, 06:21 PM
RE: PX41CX - comabereni - 09-09-2023, 09:03 PM



User(s) browsing this thread: 1 Guest(s)